16 changed files with 29 additions and 68 deletions
			
			
		@ -1,26 +0,0 @@ | 
				
			|||||
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
 | 
					 | 
				
			||||
@@ -2185,6 +2185,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; | 
					 | 
				
			||||
@@ -2285,6 +2286,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 | 
					 | 
				
			||||
@ -1,5 +0,0 @@ | 
				
			|||||
# /etc/auto.master: automounter map definitions | 
					 | 
				
			||||
# | 
					 | 
				
			||||
# <mount-point> [map-type[,format]:]<map> [options] | 
					 | 
				
			||||
# | 
					 | 
				
			||||
/mnt/autofs	/etc/auto.net | 
					 | 
				
			||||
@ -1,6 +0,0 @@ | 
				
			|||||
# /etc/auto.net: dynamic file system information. | 
					 | 
				
			||||
# | 
					 | 
				
			||||
# Every single mount point below will be available in /mnt/autofs during start | 
					 | 
				
			||||
# or possibly even later if you request it. | 
					 | 
				
			||||
# | 
					 | 
				
			||||
# <mount point> -fstype=<type>,<options> <file system> | 
					 | 
				
			||||
@ -1,3 +1,3 @@ | 
				
			|||||
# /var/etc/fstab: static file system information. | 
					# /var/etc/fstab: static net file system information. | 
				
			||||
# | 
					# | 
				
			||||
# <file system> <mount point> <type> <options> <dump> <pass> | 
					# <file system> <mount point> <type> <options> <dump> <pass> | 
				
			||||
@ -1,3 +0,0 @@ | 
				
			|||||
# /etc/fstab: static file system information. | 
					 | 
				
			||||
# | 
					 | 
				
			||||
# <file system> <mount point> <type> <options> <dump> <pass> | 
					 | 
				
			||||
@ -1,3 +0,0 @@ | 
				
			|||||
# /etc/fstab: static file system information. | 
					 | 
				
			||||
# | 
					 | 
				
			||||
# <file system> <mount point> <type> <options> <dump> <pass> | 
					 | 
				
			||||
@ -1,3 +0,0 @@ | 
				
			|||||
# /etc/fstab: static file system information. | 
					 | 
				
			||||
# | 
					 | 
				
			||||
# <file system> <mount point> <type> <options> <dump> <pass> | 
					 | 
				
			||||
@ -1,3 +0,0 @@ | 
				
			|||||
# /etc/fstab: static file system information. | 
					 | 
				
			||||
# | 
					 | 
				
			||||
# <file system> <mount point> <type> <options> <dump> <pass> | 
					 | 
				
			||||
					Loading…
					
					
				
		Reference in new issue