mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
remount fix - #3280
This commit is contained in:
parent
b7e4f402f4
commit
0d99824028
1 changed files with 6 additions and 3 deletions
|
|
@ -479,7 +479,7 @@ static void fs_remount_simple(const char *path, OPERATION op) {
|
|||
// open path without following symbolic links
|
||||
int fd = safe_fd(path, O_PATH|O_NOFOLLOW|O_CLOEXEC);
|
||||
if (fd == -1)
|
||||
errExit("open");
|
||||
goto out;
|
||||
// identify file owner
|
||||
struct stat s;
|
||||
if (fstat(fd, &s) == -1) {
|
||||
|
|
@ -487,9 +487,8 @@ static void fs_remount_simple(const char *path, OPERATION op) {
|
|||
// mounted without 'allow_root' or 'allow_other'
|
||||
if (errno != EACCES)
|
||||
errExit("fstat");
|
||||
fwarning("not remounting %s\n", path);
|
||||
close(fd);
|
||||
return;
|
||||
goto out;
|
||||
}
|
||||
// get mount flags
|
||||
struct statvfs buf;
|
||||
|
|
@ -566,6 +565,10 @@ static void fs_remount_simple(const char *path, OPERATION op) {
|
|||
fs_logger2(opstr[op], path);
|
||||
free(proc);
|
||||
close(fd);
|
||||
return;
|
||||
|
||||
out:
|
||||
fwarning("not remounting %s\n", path);
|
||||
}
|
||||
|
||||
// remount recursively; requires a resolved path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue