summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-09-16 20:02:22 +0000
committerMiles Bader <miles@gnu.org>1997-09-16 20:02:22 +0000
commitefe5620ef78061983cadbb100cf299fbdaf6dd4e (patch)
treee1bb5a81856b1dadad2d9196b034856526256342 /libdiskfs
parent1849a29fecadd21b919ea10bb7981aa04fb31d1c (diff)
(diskfs_append_std_options):
Add --no-suid and --no-exec options. Don't deallocate ARGZ when we get an error.
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/opts-append-std.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/libdiskfs/opts-append-std.c b/libdiskfs/opts-append-std.c
index 22762722..7e846715 100644
--- a/libdiskfs/opts-append-std.c
+++ b/libdiskfs/opts-append-std.c
@@ -31,35 +31,27 @@ diskfs_append_std_options (char **argz, unsigned *argz_len)
error_t err;
extern int diskfs_sync_interval;
- if (nosuid)
- err = argz_add (argz, argz_len, "--no-suid");
- if (err)
- return err;
-
- if (noexec)
- err = argz_add (argz, argz_len, "--no-exec");
- if (err)
- return err;
-
if (diskfs_readonly)
err = argz_add (argz, argz_len, "--readonly");
else
err = argz_add (argz, argz_len, "--writable");
- if (err)
- return err;
- if (diskfs_synchronous)
- err = argz_add (argz, argz_len, "--sync");
- else if (diskfs_sync_interval == 0)
- err = argz_add (argz, argz_len, "--nosync");
- else
- {
- char buf[80];
- sprintf (buf, "--sync=%d", diskfs_sync_interval);
- err = argz_add (argz, argz_len, buf);
- }
- if (err)
- free (argz); /* Free the first option allocated. */
+ if (!err && _diskfs_nosuid)
+ err = argz_add (argz, argz_len, "--no-suid");
+ if (!err && _diskfs_noexec)
+ err = argz_add (argz, argz_len, "--no-exec");
+
+ if (! err)
+ if (diskfs_synchronous)
+ err = argz_add (argz, argz_len, "--sync");
+ else if (diskfs_sync_interval == 0)
+ err = argz_add (argz, argz_len, "--no-sync");
+ else
+ {
+ char buf[80];
+ sprintf (buf, "--sync=%d", diskfs_sync_interval);
+ err = argz_add (argz, argz_len, buf);
+ }
return err;
}