diff options
author | 2020-10-19 08:29:46 -0400 | |
---|---|---|
committer | 2020-10-19 08:29:46 -0400 | |
commit | 35e476170ba347dede12601791ccb9a67e9cc8da (patch) | |
tree | c2604c10b6172c02de3892079cee3865d5d80308 | |
parent | fix manpage wanings (#3563) (diff) | |
download | firejail-35e476170ba347dede12601791ccb9a67e9cc8da.tar.gz firejail-35e476170ba347dede12601791ccb9a67e9cc8da.tar.zst firejail-35e476170ba347dede12601791ccb9a67e9cc8da.zip |
fix #3478
-rw-r--r-- | src/firejail/profile.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/firejail/profile.c b/src/firejail/profile.c index ed736521a..5d83e6a73 100644 --- a/src/firejail/profile.c +++ b/src/firejail/profile.c | |||
@@ -1633,10 +1633,11 @@ void profile_read(const char *fname) { | |||
1633 | exit(1); | 1633 | exit(1); |
1634 | } | 1634 | } |
1635 | if (access(fname, R_OK)) { | 1635 | if (access(fname, R_OK)) { |
1636 | int errsv = errno; | ||
1636 | // if the file ends in ".local", do not exit | 1637 | // if the file ends in ".local", do not exit |
1637 | const char *base = gnu_basename(fname); | 1638 | const char *base = gnu_basename(fname); |
1638 | char *ptr = strstr(base, ".local"); | 1639 | char *ptr = strstr(base, ".local"); |
1639 | if (ptr && strlen(ptr) == 6) | 1640 | if (ptr && strlen(ptr) == 6 && errsv != EACCES) |
1640 | return; | 1641 | return; |
1641 | 1642 | ||
1642 | fprintf(stderr, "Error: cannot access profile file: %s\n", fname); | 1643 | fprintf(stderr, "Error: cannot access profile file: %s\n", fname); |