Proposed LUID implementation patch (for 2.3.99pre5) and test files (.tar)

From: Linda Walsh (law@sgi.com)
Date: Mon Apr 17 2000 - 15:46:47 EST


Please consider the attached patch for inclusion into 2.3.99pre5.

Thanks,
-linda

-- 
Linda A Walsh                    | Trust Technology, Core Linux, SGI
law@sgi.com                      | Voice: (650) 933-5338


diff -r -c linux-2.3.99-pre5untainted/arch/i386/kernel/entry.S linux-2.3.99-pre5/arch/i386/kernel/entry.S *** linux-2.3.99-pre5untainted/arch/i386/kernel/entry.S Thu Mar 23 08:15:02 2000 --- linux-2.3.99-pre5/arch/i386/kernel/entry.S Mon Apr 17 09:28:17 2000 *************** *** 634,639 **** --- 634,641 ---- .long SYMBOL_NAME(sys_pivot_root) .long SYMBOL_NAME(sys_mincore) .long SYMBOL_NAME(sys_madvise) + .long SYMBOL_NAME(sys_setluid) /* 220 */ + .long SYMBOL_NAME(sys_getluid) /* diff -r -c linux-2.3.99-pre5untainted/include/asm-i386/unistd.h linux-2.3.99-pre5/include/asm-i386/unistd.h *** linux-2.3.99-pre5untainted/include/asm-i386/unistd.h Tue Mar 14 17:45:20 2000 --- linux-2.3.99-pre5/include/asm-i386/unistd.h Mon Apr 17 09:31:45 2000 *************** *** 225,230 **** --- 225,232 ---- #define __NR_mincore 218 #define __NR_madvise 219 #define __NR_madvise1 219 /* delete when C lib stub is removed */ + #define __NR_setluid 220 + #define __NR_getluid 221 /* user-visible error numbers are in the range -1 - -124: see <asm-i386/errno.h> */ diff -r -c linux-2.3.99-pre5untainted/include/linux/capability.h linux-2.3.99-pre5/include/linux/capability.h *** linux-2.3.99-pre5untainted/include/linux/capability.h Tue Apr 11 17:31:26 2000 --- linux-2.3.99-pre5/include/linux/capability.h Mon Apr 17 09:33:05 2000 *************** *** 269,274 **** --- 269,278 ---- #define CAP_MKNOD 27 + /* allow setting of Login user ID */ + + #define CAP_SETLUID 28 + #ifdef __KERNEL__ /* * Bounding set diff -r -c linux-2.3.99-pre5untainted/include/linux/sched.h linux-2.3.99-pre5/include/linux/sched.h *** linux-2.3.99-pre5untainted/include/linux/sched.h Tue Apr 11 17:31:26 2000 --- linux-2.3.99-pre5/include/linux/sched.h Mon Apr 17 09:34:11 2000 *************** *** 322,328 **** unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap; int swappable:1; /* process credentials */ ! uid_t uid,euid,suid,fsuid; gid_t gid,egid,sgid,fsgid; int ngroups; gid_t groups[NGROUPS]; --- 322,328 ---- unsigned long min_flt, maj_flt, nswap, cmin_flt, cmaj_flt, cnswap; int swappable:1; /* process credentials */ ! uid_t uid,euid,suid,fsuid,luid; gid_t gid,egid,sgid,fsgid; int ngroups; gid_t groups[NGROUPS]; diff -r -c linux-2.3.99-pre5untainted/kernel/sys.c linux-2.3.99-pre5/kernel/sys.c *** linux-2.3.99-pre5untainted/kernel/sys.c Sun Mar 19 11:15:32 2000 --- linux-2.3.99-pre5/kernel/sys.c Mon Apr 17 09:36:59 2000 *************** *** 516,521 **** --- 516,537 ---- return 0; } + /* login uid functions for auditing purposes */ + + asmlinkage int sys_setluid(uid_t luid) + { + if (!capable(CAP_SETLUID)) return -EPERM; + return (current->luid = luid); + } + + asmlinkage int sys_getluid() + { + return current->luid; + } + + + + asmlinkage long sys_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid) { int retval;

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:11 EST