commit 5b16b70e47d37f51f377efffd23663cf86a35311 Author: Steve Dickson 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 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);