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/fs_whitelist.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/fs_whitelist.c')
-rw-r--r-- | src/firejail/fs_whitelist.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/firejail/fs_whitelist.c b/src/firejail/fs_whitelist.c index 6cd445433..913fc71ba 100644 --- a/src/firejail/fs_whitelist.c +++ b/src/firejail/fs_whitelist.c | |||
@@ -33,7 +33,6 @@ | |||
33 | //#define TEST_MOUNTINFO | 33 | //#define TEST_MOUNTINFO |
34 | 34 | ||
35 | #define EMPTY_STRING ("") | 35 | #define EMPTY_STRING ("") |
36 | #define MAXBUF 4098 | ||
37 | static size_t homedir_len; // cache length of homedir string | 36 | static size_t homedir_len; // cache length of homedir string |
38 | 37 | ||
39 | 38 | ||
@@ -68,11 +67,6 @@ static int mkpath(const char* path, mode_t mode) { | |||
68 | char *tok = strtok(dup, "/"); | 67 | char *tok = strtok(dup, "/"); |
69 | assert(tok); // path is no top level directory | 68 | assert(tok); // path is no top level directory |
70 | while (tok) { | 69 | while (tok) { |
71 | // skip all instances of "/./" | ||
72 | if (strcmp(tok, ".") == 0) { | ||
73 | tok = strtok(NULL, "/"); | ||
74 | continue; | ||
75 | } | ||
76 | // create the directory if necessary | 70 | // create the directory if necessary |
77 | if (mkdirat(parentfd, tok, mode) == -1) { | 71 | if (mkdirat(parentfd, tok, mode) == -1) { |
78 | if (errno != EEXIST) { | 72 | if (errno != EEXIST) { |