diff for duplicates of <54B0D133.4020101@gmail.com> diff --git a/a/1.txt b/N1/1.txt index 3bfcae1..4e37378 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -45,7 +45,7 @@ And there is a problem [*] and nothing I've seen so far in this conversation seems to provide a solution within the current kernel implementation (but, maybe I am not clever enough to see it). -== += [*] A summary of the problem for bystanders: @@ -88,8 +88,7 @@ For an example of the leak, consider the following simple program and script. The program is just a simple command-line interface to exercise execveat(): -===== -/* t_execveat.c +==/* t_execveat.c */ #define _GNU_SOURCE #include <fcntl.h> @@ -127,16 +126,16 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - if (argv[1][0] == '-') + if (argv[1][0] = '-') dirfd = AT_FDCWD; else { dirfd = open(argv[1], O_RDONLY); - if (dirfd == -1) + if (dirfd = -1) errExit("open"); } path = argv[2]; - if (strlen(path) == 0) + if (strlen(path) = 0) flags = AT_EMPTY_PATH; execveat(dirfd, path, &argv[3], environ, flags); @@ -144,23 +143,19 @@ main(int argc, char *argv[]) exit(EXIT_SUCCESS); } -===== - +== And then a simple script (necho.sh) that recursively invokes itself using the above program demonstrates the problem. -===== -#!/bin/sh +==#!/bin/sh echo echo '$0 =' $0 ls -l /proc/$$/fd ./t_execveat ./necho.sh "" arg1 # $arg -===== - +== When we run this script, we see: -===== - +== # chmod +x necho.sh # ./t_execveat ./necho.sh "" arg1 @@ -216,8 +211,7 @@ lr-x------. 1 root root 64 Jan 10 07:59 7 -> /home/mtk/necho.sh [and so on until we run out of file descriptors] -===== - +== (I think the FD 199 in the above output is some bash(1) artifact, unrelated to the conversation at hand.) diff --git a/a/content_digest b/N1/content_digest index bd3d0d5..9ef33ba 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -11,7 +11,7 @@ "ref\087lhlbvbzs.fsf@x220.int.ebiederm.org\0" "From\0Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>\0" "Subject\0Re: [PATCHv10 man-pages 5/5] execveat.2: initial man page for execveat(2)\0" - "Date\0Sat, 10 Jan 2015 08:13:55 +0100\0" + "Date\0Sat, 10 Jan 2015 07:13:55 +0000\0" "To\0Eric W. Biederman <ebiederm@xmission.com>" " Rich Felker <dalias@aerifal.cx>\0" "Cc\0mtk.manpages@gmail.com" @@ -83,7 +83,7 @@ "conversation seems to provide a solution within the current \n" "kernel implementation (but, maybe I am not clever enough to see it).\n" "\n" - "==\n" + "=\n" "\n" "[*] A summary of the problem for bystanders:\n" "\n" @@ -126,8 +126,7 @@ "and script. The program is just a simple command-line interface to \n" "exercise execveat():\n" "\n" - "=====\n" - "/* t_execveat.c\n" + "==/* t_execveat.c\n" "*/\n" "#define _GNU_SOURCE\n" "#include <fcntl.h>\n" @@ -165,16 +164,16 @@ " exit(EXIT_FAILURE);\n" " }\n" "\n" - " if (argv[1][0] == '-')\n" + " if (argv[1][0] = '-')\n" " dirfd = AT_FDCWD;\n" " else {\n" " dirfd = open(argv[1], O_RDONLY);\n" - " if (dirfd == -1)\n" + " if (dirfd = -1)\n" " errExit(\"open\");\n" " }\n" "\n" " path = argv[2];\n" - " if (strlen(path) == 0)\n" + " if (strlen(path) = 0)\n" " flags = AT_EMPTY_PATH;\n" "\n" " execveat(dirfd, path, &argv[3], environ, flags);\n" @@ -182,23 +181,19 @@ "\n" " exit(EXIT_SUCCESS);\n" "}\n" - "=====\n" - "\n" + "==\n" "And then a simple script (necho.sh) that recursively invokes itself using\n" "the above program demonstrates the problem.\n" "\n" - "=====\n" - "#!/bin/sh\n" + "==#!/bin/sh\n" "echo \n" "echo '$0 =' $0\n" "ls -l /proc/$$/fd\n" "./t_execveat ./necho.sh \"\" arg1 # $arg\n" - "=====\n" - "\n" + "==\n" "When we run this script, we see:\n" "\n" - "=====\n" - "\n" + "==\n" "# chmod +x necho.sh\n" "# ./t_execveat ./necho.sh \"\" arg1\n" "\n" @@ -254,8 +249,7 @@ "\n" "\n" "[and so on until we run out of file descriptors]\n" - "=====\n" - "\n" + "==\n" "(I think the FD 199 in the above output is some bash(1) artifact, unrelated \n" "to the conversation at hand.)\n" "\n" @@ -268,4 +262,4 @@ "Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/\n" Linux/UNIX System Programming Training: http://man7.org/training/ -5e722fa3e561586980d64ca57368e6a2cdd256d86ad6877b61a6b37881ceabc2 +5f988824443d696460c07fe551b26b5920a26250a98b602e7cec63d683c2004f
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.