diff options
Diffstat (limited to 'src/firejail/mountinfo.c')
-rw-r--r-- | src/firejail/mountinfo.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/firejail/mountinfo.c b/src/firejail/mountinfo.c index 42e160dec..162f5dbec 100644 --- a/src/firejail/mountinfo.c +++ b/src/firejail/mountinfo.c | |||
@@ -225,9 +225,9 @@ char **build_mount_array(const int mount_id, const char *path) { | |||
225 | exit(1); | 225 | exit(1); |
226 | } | 226 | } |
227 | do { | 227 | do { |
228 | parse_line(buf, &mntp); | ||
228 | // find mount point with mount id | 229 | // find mount point with mount id |
229 | if (!found) { | 230 | if (!found) { |
230 | parse_line(buf, &mntp); | ||
231 | if (mntp.mountid == mount_id) { | 231 | if (mntp.mountid == mount_id) { |
232 | // give up if mount id has been reassigned, | 232 | // give up if mount id has been reassigned, |
233 | // don't remount blacklisted path | 233 | // don't remount blacklisted path |
@@ -236,19 +236,17 @@ char **build_mount_array(const int mount_id, const char *path) { | |||
236 | strstr(mntp.fsname, "firejail.ro.file")) | 236 | strstr(mntp.fsname, "firejail.ro.file")) |
237 | break; | 237 | break; |
238 | 238 | ||
239 | rv[0] = strdup(path); | 239 | rv[cnt] = strdup(path); |
240 | if (rv[0] == NULL) | 240 | if (rv[cnt] == NULL) |
241 | errExit("strdup"); | 241 | errExit("strdup"); |
242 | cnt++; | 242 | cnt++; |
243 | found = 1; | 243 | found = 1; |
244 | continue; | 244 | continue; |
245 | } | 245 | } |
246 | else | 246 | continue; |
247 | continue; | ||
248 | } | 247 | } |
249 | // from here on add all mount points below path, | 248 | // from here on add all mount points below path, |
250 | // don't remount blacklisted paths | 249 | // don't remount blacklisted paths |
251 | parse_line(buf, &mntp); | ||
252 | if (strncmp(mntp.dir, path, pathlen) == 0 && | 250 | if (strncmp(mntp.dir, path, pathlen) == 0 && |
253 | mntp.dir[pathlen] == '/' && | 251 | mntp.dir[pathlen] == '/' && |
254 | strstr(mntp.fsname, "firejail.ro.dir") == NULL && | 252 | strstr(mntp.fsname, "firejail.ro.dir") == NULL && |