| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // http://code.google.com/p/chromium/wiki/LinuxSUIDSandbox | 5 // http://code.google.com/p/chromium/wiki/LinuxSUIDSandbox |
| 6 | 6 |
| 7 #define _GNU_SOURCE | 7 #define _GNU_SOURCE |
| 8 #include <asm/unistd.h> | 8 #include <asm/unistd.h> |
| 9 #include <errno.h> | 9 #include <errno.h> |
| 10 #include <fcntl.h> | 10 #include <fcntl.h> |
| 11 #include <limits.h> |
| 11 #include <sched.h> | 12 #include <sched.h> |
| 12 #include <signal.h> | 13 #include <signal.h> |
| 13 #include <stdarg.h> | 14 #include <stdarg.h> |
| 14 #include <stdbool.h> | 15 #include <stdbool.h> |
| 15 #include <stdint.h> | 16 #include <stdint.h> |
| 16 #include <stdio.h> | 17 #include <stdio.h> |
| 17 #include <stdlib.h> | 18 #include <stdlib.h> |
| 18 #include <string.h> | 19 #include <string.h> |
| 19 #include <sys/prctl.h> | 20 #include <sys/prctl.h> |
| 20 #include <sys/resource.h> | 21 #include <sys/resource.h> |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 if (!DropRoot()) | 326 if (!DropRoot()) |
| 326 return 1; | 327 return 1; |
| 327 if (!SetupChildEnvironment()) | 328 if (!SetupChildEnvironment()) |
| 328 return 1; | 329 return 1; |
| 329 | 330 |
| 330 execv(argv[1], &argv[1]); | 331 execv(argv[1], &argv[1]); |
| 331 FatalError("execv failed"); | 332 FatalError("execv failed"); |
| 332 | 333 |
| 333 return 1; | 334 return 1; |
| 334 } | 335 } |
| OLD | NEW |