OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "sandbox/linux/suid/common/sandbox.h" | 7 #include "sandbox/linux/suid/common/sandbox.h" |
8 | 8 |
9 #define _GNU_SOURCE | 9 #define _GNU_SOURCE |
10 #include <asm/unistd.h> | 10 #include <asm/unistd.h> |
11 #include <errno.h> | 11 #include <errno.h> |
12 #include <fcntl.h> | 12 #include <fcntl.h> |
13 #include <limits.h> | 13 #include <limits.h> |
14 #include <sched.h> | 14 #include <sched.h> |
15 #include <signal.h> | 15 #include <signal.h> |
16 #include <stdarg.h> | 16 #include <stdarg.h> |
17 #include <stdbool.h> | 17 #include <stdbool.h> |
| 18 #include <stddef.h> |
18 #include <stdint.h> | 19 #include <stdint.h> |
19 #include <stdio.h> | 20 #include <stdio.h> |
20 #include <stdlib.h> | 21 #include <stdlib.h> |
21 #include <string.h> | 22 #include <string.h> |
22 #include <sys/prctl.h> | 23 #include <sys/prctl.h> |
23 #include <sys/resource.h> | 24 #include <sys/resource.h> |
24 #include <sys/socket.h> | 25 #include <sys/socket.h> |
25 #include <sys/stat.h> | 26 #include <sys/stat.h> |
26 #include <sys/time.h> | 27 #include <sys/time.h> |
27 #include <sys/types.h> | 28 #include <sys/types.h> |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 if (!DropRoot()) | 474 if (!DropRoot()) |
474 return 1; | 475 return 1; |
475 if (!SetupChildEnvironment()) | 476 if (!SetupChildEnvironment()) |
476 return 1; | 477 return 1; |
477 | 478 |
478 execv(argv[1], &argv[1]); | 479 execv(argv[1], &argv[1]); |
479 FatalError("execv failed"); | 480 FatalError("execv failed"); |
480 | 481 |
481 return 1; | 482 return 1; |
482 } | 483 } |
OLD | NEW |