Re: About the sys_execve()

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

 



thanks, but it is not the things flush_old_files() do.
it seems not get rid off the 0, 1, 2 file descriptors.

2007/4/23, Rik van Riel <riel@xxxxxxxxxxx >:
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.


[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