You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
diff --git a/util-linux/mount.c b/util-linux/mount.c
|
|
|
|
index 5fcc795..ba279f5 100644
|
|
|
|
--- a/util-linux/mount.c
|
|
|
|
+++ b/util-linux/mount.c
|
|
|
|
@@ -2184,6 +2184,7 @@ int mount_main(int argc UNUSED_PARAM, char **argv)
|
|
|
|
llist_t *lst_o = NULL;
|
|
|
|
const char *fstabname = "/etc/fstab";
|
|
|
|
FILE *fstab;
|
|
|
|
+ FILE *fstab_var; //NI
|
|
|
|
int i, j;
|
|
|
|
int rc = EXIT_SUCCESS;
|
|
|
|
unsigned long cmdopt_flags;
|
|
|
|
@@ -2280,6 +2281,13 @@ int mount_main(int argc UNUSED_PARAM, char **argv)
|
|
|
|
// A malicious user could overmount /usr without this.
|
|
|
|
if (ENABLE_FEATURE_MOUNT_OTHERTAB && nonroot)
|
|
|
|
fstabname = "/etc/fstab";
|
|
|
|
+ //NI use /var/etc/fstab if accessible
|
|
|
|
+ fstab_var = fopen("/var/etc/fstab", "r");
|
|
|
|
+ if (fstab_var) {
|
|
|
|
+ fstabname = "/var/etc/fstab";
|
|
|
|
+ fclose(fstab_var);
|
|
|
|
+ }
|
|
|
|
+ printf("mount: using %s\n", fstabname);
|
|
|
|
// Open either fstab or mtab
|
|
|
|
if (cmdopt_flags & MS_REMOUNT) {
|
|
|
|
// WARNING. I am not sure this matches util-linux's
|