This commit is contained in:
Josh Soref 2024-07-30 09:10:00 -07:00 committed by GitHub
commit e6bbd1a832
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -7445,9 +7445,14 @@ unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual)
} }
(void) fprintf(stderr, gettext("warning: %s not in" (void) fprintf(stderr, gettext("warning: %s not in"
"/proc/self/mounts\n"), path); "/proc/self/mounts\n"), path);
if ((ret = umount2(path, flags)) != 0) if ((ret = umount2(path, flags)) != 0) {
(void) fprintf(stderr, gettext("%s: %s\n"), path, (void) fprintf(stderr, gettext("%s: %s\n"), path,
strerror(errno)); strerror(errno));
if (ret == EPERM && geteuid() != 0) {
(void) fprintf(stderr, gettext("filesystems "
"may only be unmounted by root\n"));
}
}
return (ret != 0); return (ret != 0);
} }
path_inode = statbuf.st_ino; path_inode = statbuf.st_ino;