patch-1.3.28 linux/fs/binfmt_elf.c

Next file: linux/fs/block_dev.c
Previous file: linux/drivers/sound/soundcard.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.27/linux/fs/binfmt_elf.c linux/fs/binfmt_elf.c
@@ -633,6 +633,8 @@
 #ifdef LOW_ELF_STACK
 	current->start_stack = p = elf_stack - 4;
 #endif
+	current->suid = current->euid = current->fsuid = bprm->e_uid;
+	current->sgid = current->egid = current->fsgid = bprm->e_gid;
 	bprm->p -= MAX_ARG_PAGES*PAGE_SIZE;
 	bprm->p = (unsigned long) 
 	  create_elf_tables((char *)bprm->p,
@@ -649,8 +651,6 @@
 	current->mm->start_code = start_code;
 	current->mm->end_data = end_data;
 	current->mm->start_stack = bprm->p;
-	current->suid = current->euid = current->fsuid = bprm->e_uid;
-	current->sgid = current->egid = current->fsgid = bprm->e_gid;
 
 	/* Calling sys_brk effectively mmaps the pages that we need for the bss and break
 	   sections */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this