[Patch 6/8] NFS Mount Configuration File (Vers 2)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 5b16b70e47d37f51f377efffd23663cf86a35311
Author: Steve Dickson <steved@xxxxxxxxxx>
Date:   Sun Aug 2 12:37:19 2009 -0400

    Added hooks to the mount command that allow
    mount options to be set in a configuration file
    
    Signed-off-by: Steve Dickson <steved@xxxxxxxxxx>

diff --git a/utils/mount/mount.c b/utils/mount/mount.c
index a668cd9..30d087e 100644
--- a/utils/mount/mount.c
+++ b/utils/mount/mount.c
@@ -47,6 +47,11 @@
 #include "stropts.h"
 #include "version.h"
 
+#ifdef MOUNT_CONFIG
+#include "conffile.h"
+extern char *conf_get_mntopts(char *, char *, char *);
+#endif
+
 char *progname;
 int nfs_mount_data_version;
 int nomtab;
@@ -474,6 +479,13 @@ int main(int argc, char *argv[])
 	spec = argv[1];
 	mount_point = argv[2];
 
+#ifdef MOUNT_CONFIG
+	/*
+	 * Read the the default mount options
+	 */
+	conf_init();
+#endif
+
 	argv[2] = argv[0]; /* so that getopt error messages are correct */
 	while ((c = getopt_long(argc - 2, argv + 2, "rvVwfno:hs",
 				longopts, NULL)) != -1) {
@@ -559,6 +571,12 @@ int main(int argc, char *argv[])
 		mnt_err = EX_USAGE;
 		goto out;
 	}
+#ifdef MOUNT_CONFIG
+	/*
+	 * Concatenate mount options from the configuration file
+	 */
+	mount_opts = conf_get_mntopts(spec, mount_point, mount_opts);
+#endif
 
 	parse_opts(mount_opts, &flags, &extra_opts);
 

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux