diff options
Diffstat (limited to 'libdiskfs/opts-std-runtime.c')
-rw-r--r-- | libdiskfs/opts-std-runtime.c | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/libdiskfs/opts-std-runtime.c b/libdiskfs/opts-std-runtime.c index 47cebeb7..177dfaf6 100644 --- a/libdiskfs/opts-std-runtime.c +++ b/libdiskfs/opts-std-runtime.c @@ -1,6 +1,6 @@ /* Parse standard run-time options - Copyright (C) 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. This file is part of the GNU Hurd. @@ -32,7 +32,8 @@ std_runtime_options[] = struct parse_hook { - int readonly, sync, sync_interval, remount; + int readonly, sync, sync_interval, remount, nosuid, noexec, noatime, + noinheritdirgroup; }; /* Implement the options in H, and free H. */ @@ -53,10 +54,12 @@ set_opts (struct parse_hook *h) } if (h->readonly != diskfs_readonly) - if (err) - diskfs_set_readonly (h->readonly); /* keep the old error. */ - else - err = diskfs_set_readonly (h->readonly); + { + if (err) + diskfs_set_readonly (h->readonly); /* keep the old error. */ + else + err = diskfs_set_readonly (h->readonly); + } /* Change sync mode. */ if (h->sync) @@ -71,6 +74,15 @@ set_opts (struct parse_hook *h) diskfs_set_sync_interval (h->sync_interval); } + if (h->nosuid != -1) + _diskfs_nosuid = h->nosuid; + if (h->noexec != -1) + _diskfs_noexec = h->noexec; + if (h->noatime != -1) + _diskfs_noatime = h->noatime; + if (h->noinheritdirgroup != -1) + _diskfs_no_inherit_dir_group = h->noinheritdirgroup; + free (h); return err; @@ -86,10 +98,21 @@ parse_opt (int opt, char *arg, struct argp_state *state) case 'r': h->readonly = 1; break; case 'w': h->readonly = 0; break; case 'u': h->remount = 1; break; + case 'S': h->nosuid = 1; break; + case 'E': h->noexec = 1; break; + case 'A': h->noatime = 1; break; + case OPT_SUID_OK: h->nosuid = 0; break; + case OPT_EXEC_OK: h->noexec = 0; break; + case OPT_ATIME: h->noatime = 0; break; + case OPT_NO_INHERIT_DIR_GROUP: h->noinheritdirgroup = 1; break; + case OPT_INHERIT_DIR_GROUP: h->noinheritdirgroup = 0; break; case 'n': h->sync_interval = 0; h->sync = 0; break; case 's': if (arg) - h->sync_interval = atoi (arg); + { + h->sync = 0; + h->sync_interval = atoi (arg); + } else h->sync = 1; break; @@ -106,6 +129,7 @@ parse_opt (int opt, char *arg, struct argp_state *state) h->sync = diskfs_synchronous; h->sync_interval = -1; h->remount = 0; + h->nosuid = h->noexec = h->noatime = h->noinheritdirgroup = -1; /* We know that we have one child, with which we share our hook. */ state->child_inputs[0] = h; |