diff options
author | smitsohu <smitsohu@gmail.com> | 2019-02-22 18:41:38 +0100 |
---|---|---|
committer | smitsohu <smitsohu@gmail.com> | 2019-02-22 18:45:07 +0100 |
commit | 5cabd894a9d700bd4457d6e6dbd9472629a6dbfe (patch) | |
tree | 5deb5581385d0cc33898462c35257be3b2503b07 /src/firejail/util.c | |
parent | Harden gnome-recipes.profile (#2444) (diff) | |
download | firejail-5cabd894a9d700bd4457d6e6dbd9472629a6dbfe.tar.gz firejail-5cabd894a9d700bd4457d6e6dbd9472629a6dbfe.tar.zst firejail-5cabd894a9d700bd4457d6e6dbd9472629a6dbfe.zip |
misc cleanup
removing the branches checking for "." has no effect,
as calling openat on this just reopens the previous path element.
Diffstat (limited to 'src/firejail/util.c')
-rw-r--r-- | src/firejail/util.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/firejail/util.c b/src/firejail/util.c index 0e869ef7a..dd298a31a 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c | |||
@@ -1163,11 +1163,6 @@ int safe_fd(const char *path, int flags) { | |||
1163 | char *tok = strtok(dup, "/"); | 1163 | char *tok = strtok(dup, "/"); |
1164 | assert(tok); | 1164 | assert(tok); |
1165 | while (tok) { | 1165 | while (tok) { |
1166 | // skip all "/./" | ||
1167 | if (strcmp(tok, ".") == 0) { | ||
1168 | tok = strtok(NULL, "/"); | ||
1169 | continue; | ||
1170 | } | ||
1171 | // open the element, assuming it is a directory; this fails with ENOTDIR if it is a symbolic link | 1166 | // open the element, assuming it is a directory; this fails with ENOTDIR if it is a symbolic link |
1172 | fd = openat(parentfd, tok, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC); | 1167 | fd = openat(parentfd, tok, O_PATH|O_DIRECTORY|O_NOFOLLOW|O_CLOEXEC); |
1173 | if (fd == -1) { | 1168 | if (fd == -1) { |
@@ -1267,7 +1262,7 @@ int invalid_sandbox(const pid_t pid) { | |||
1267 | } | 1262 | } |
1268 | 1263 | ||
1269 | int has_handler(pid_t pid, int signal) { | 1264 | int has_handler(pid_t pid, int signal) { |
1270 | if (signal > 0) { | 1265 | if (signal > 0 && signal <= SIGRTMAX) { |
1271 | char *fname; | 1266 | char *fname; |
1272 | if (asprintf(&fname, "/proc/%d/status", pid) == -1) | 1267 | if (asprintf(&fname, "/proc/%d/status", pid) == -1) |
1273 | errExit("asprintf"); | 1268 | errExit("asprintf"); |