summaryrefslogtreecommitdiff
path: root/util-linux/mount.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2005-08-30 17:07:49 +0000
committerRob Landley <rob@landley.net>2005-08-30 17:07:49 +0000
commit9a643149def4bcfe046ddc7863e315b217c7dc04 (patch)
tree714d4752ffc979afd89a05bc222cb499d4094e7c /util-linux/mount.c
parentcc8885f6f336e6901791dbb082fdc31957303f0a (diff)
downloadbusybox-w32-9a643149def4bcfe046ddc7863e315b217c7dc04.tar.gz
busybox-w32-9a643149def4bcfe046ddc7863e315b217c7dc04.tar.bz2
busybox-w32-9a643149def4bcfe046ddc7863e315b217c7dc04.zip
Amir Shalem found some bugs in the new mount code; unknown options didn't get
added to the list, and my assumption that nfsmount() actually called mount() was incorrect (and I coded it wrong anyway; I hate having to touch codepaths I can't personally test).
Diffstat (limited to 'util-linux/mount.c')
-rw-r--r--util-linux/mount.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 35866ea76..05f25a70d 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -99,12 +99,12 @@ static void parse_mount_options(char *options, int *flags, char **strflags)
99 } 99 }
100 } 100 }
101 // Unrecognized mount option? 101 // Unrecognized mount option?
102 if(i == sizeof(mount_options)) { 102 if(i == (sizeof(mount_options) / sizeof(*mount_options))) {
103 // Add it to strflags, to pass on to kernel 103 // Add it to strflags, to pass on to kernel
104 i = *strflags ? strlen(*strflags) : 0; 104 i = *strflags ? strlen(*strflags) : 0;
105 *strflags = xrealloc(*strflags, i+strlen(options)+2); 105 *strflags = xrealloc(*strflags, i+strlen(options)+2);
106 // Comma separated if it's not the first one 106 // Comma separated if it's not the first one
107 if(i) (*strflags)[i] = ','; 107 if(i) (*strflags)[i++] = ',';
108 strcpy((*strflags)+i, options); 108 strcpy((*strflags)+i, options);
109 } 109 }
110 // Advance to next option, or finish 110 // Advance to next option, or finish
@@ -286,6 +286,8 @@ singlemount:
286 else { 286 else {
287 rc = 0; 287 rc = 0;
288 fsType="nfs"; 288 fsType="nfs";
289 // Strangely enough, nfsmount() doesn't actually mount()
290 goto mount_it_now;
289 } 291 }
290 } else { 292 } else {
291 293