Re: About the sys_execve()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



rwen2012 wrote:
HI, all
it seems sys_execve() do not close the file descriptors 0, 1, 2 by default.

This is necessary, otherwise many shell commands would not work:

$ cat /path/to/backup/etc/passwd > /etc/passwd
$ bzcat /path/to/patch.bz2 | patch -p1

But I can find where the kernel do that.
  can anyone tell me where is it in the source code?

From a 1 minute look at fs/exec.c (waiting for a compile), I
suspect you want flush_old_files().

--
Politics is the struggle between those who want to make their country
the best in the world, and those who believe it already is.  Each group
calls the other unpatriotic.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux