diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-18 11:08:33 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-18 11:08:33 +0000 |
commit | c9ca0a32745a43eaa6cb6b7b460718de8ccb84f2 (patch) | |
tree | 2b4bdf035b3a3c0436ce823e137d969af4d3a06f /util-linux | |
parent | 56244736ec7d0a3c338f542204aae83fb0200346 (diff) | |
download | busybox-w32-c9ca0a32745a43eaa6cb6b7b460718de8ccb84f2.tar.gz busybox-w32-c9ca0a32745a43eaa6cb6b7b460718de8ccb84f2.tar.bz2 busybox-w32-c9ca0a32745a43eaa6cb6b7b460718de8ccb84f2.zip |
mount: recognize "dirsync" (closes bug 835)
mount: sanitize environ if called by non-root
*: adjust for slightly different sanitize routine
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/mount.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c index dd753235e..054db57b3 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -33,6 +33,11 @@ | |||
33 | #ifndef MS_SILENT | 33 | #ifndef MS_SILENT |
34 | #define MS_SILENT (1 << 15) | 34 | #define MS_SILENT (1 << 15) |
35 | #endif | 35 | #endif |
36 | /* Grab more as needed from util-linux's mount/mount_constants.h */ | ||
37 | #ifndef MS_DIRSYNC | ||
38 | #define MS_DIRSYNC 128 /* Directory modifications are synchronous */ | ||
39 | #endif | ||
40 | |||
36 | 41 | ||
37 | #if defined(__dietlibc__) | 42 | #if defined(__dietlibc__) |
38 | /* 16.12.2006, Sampo Kellomaki (sampo@iki.fi) | 43 | /* 16.12.2006, Sampo Kellomaki (sampo@iki.fi) |
@@ -122,6 +127,7 @@ static const int32_t mount_options[] = { | |||
122 | /* "exec" */ ~MS_NOEXEC, | 127 | /* "exec" */ ~MS_NOEXEC, |
123 | /* "noexec" */ MS_NOEXEC, | 128 | /* "noexec" */ MS_NOEXEC, |
124 | /* "sync" */ MS_SYNCHRONOUS, | 129 | /* "sync" */ MS_SYNCHRONOUS, |
130 | /* "dirsync" */ MS_DIRSYNC, | ||
125 | /* "async" */ ~MS_SYNCHRONOUS, | 131 | /* "async" */ ~MS_SYNCHRONOUS, |
126 | /* "atime" */ ~MS_NOATIME, | 132 | /* "atime" */ ~MS_NOATIME, |
127 | /* "noatime" */ MS_NOATIME, | 133 | /* "noatime" */ MS_NOATIME, |
@@ -171,6 +177,7 @@ static const char mount_option_str[] = | |||
171 | "exec" "\0" | 177 | "exec" "\0" |
172 | "noexec" "\0" | 178 | "noexec" "\0" |
173 | "sync" "\0" | 179 | "sync" "\0" |
180 | "dirsync" "\0" | ||
174 | "async" "\0" | 181 | "async" "\0" |
175 | "atime" "\0" | 182 | "atime" "\0" |
176 | "noatime" "\0" | 183 | "noatime" "\0" |
@@ -1665,6 +1672,8 @@ int mount_main(int argc, char **argv) | |||
1665 | SKIP_DESKTOP(const int nonroot = 0;) | 1672 | SKIP_DESKTOP(const int nonroot = 0;) |
1666 | USE_DESKTOP( int nonroot = (getuid() != 0);) | 1673 | USE_DESKTOP( int nonroot = (getuid() != 0);) |
1667 | 1674 | ||
1675 | sanitize_env_if_suid(); | ||
1676 | |||
1668 | /* parse long options, like --bind and --move. Note that -o option | 1677 | /* parse long options, like --bind and --move. Note that -o option |
1669 | * and --option are synonymous. Yes, this means --remount,rw works. */ | 1678 | * and --option are synonymous. Yes, this means --remount,rw works. */ |
1670 | 1679 | ||