| 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 // The following is duplicated from base/linux_utils.cc. | 5 // The following is duplicated from base/linux_utils.cc. |
| 6 // We shouldn't link against C++ code in a setuid binary. | 6 // We shouldn't link against C++ code in a setuid binary. |
| 7 | 7 |
| 8 // Needed for O_DIRECTORY, must be defined before fcntl.h is included |
| 9 // (and it can be included earlier than the explicit #include below |
| 10 // in some versions of glibc). |
| 11 #define _GNU_SOURCE |
| 12 |
| 8 #include "sandbox/linux/suid/linux_util.h" | 13 #include "sandbox/linux/suid/linux_util.h" |
| 9 | 14 |
| 10 #define _GNU_SOURCE // For O_DIRECTORY | |
| 11 | |
| 12 #include <dirent.h> | 15 #include <dirent.h> |
| 13 #include <errno.h> | 16 #include <errno.h> |
| 14 #include <fcntl.h> | 17 #include <fcntl.h> |
| 15 #include <limits.h> | 18 #include <limits.h> |
| 16 #include <stdio.h> | 19 #include <stdio.h> |
| 17 #include <stdlib.h> | 20 #include <stdlib.h> |
| 18 #include <string.h> | 21 #include <string.h> |
| 19 #include <sys/stat.h> | 22 #include <sys/stat.h> |
| 20 #include <sys/types.h> | 23 #include <sys/types.h> |
| 21 #include <unistd.h> | 24 #include <unistd.h> |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 } | 131 } |
| 129 } | 132 } |
| 130 } | 133 } |
| 131 closedir(fd); | 134 closedir(fd); |
| 132 close(proc_pid_fd); | 135 close(proc_pid_fd); |
| 133 } | 136 } |
| 134 closedir(proc); | 137 closedir(proc); |
| 135 | 138 |
| 136 return already_found; | 139 return already_found; |
| 137 } | 140 } |
| OLD | NEW |