-
Notifications
You must be signed in to change notification settings - Fork 296
Closed
Description
ensure_file() in utils.c intends to reject symlinks as bind-mount destinations — the comment says "non-directory, non-symlink is acceptable" and the code checks !S_ISLNK(buf.st_mode).
However, it uses stat() which follows symlinks. Since stat() resolves the symlink before returning, S_ISLNK() is never true for valid symlinks, making the check dead code.
Lines 513 to 519 in 0c408e1
| We're trying to set up a mount point for a non-directory, so any | |
| non-directory, non-symlink is acceptable - it doesn't necessarily | |
| have to be a regular file. */ | |
| if (stat (path, &buf) == 0 && | |
| !S_ISDIR (buf.st_mode) && | |
| !S_ISLNK (buf.st_mode)) | |
| return 0; |
Should use lstat() so the S_ISLNK check works as intended.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels