aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-04-05 03:10:42 +0000
committerRob Landley <rob@landley.net>2006-04-05 03:10:42 +0000
commit8dc83c654d895f82da4059be7d8709edf66bba36 (patch)
treef6362d7e23e852a8561e3657b26f0325e34ce05b
parent7fe9dd5dd701e4933dd2bfc91e43d47a1780a9a5 (diff)
downloadbusybox-w32-8dc83c654d895f82da4059be7d8709edf66bba36.tar.gz
busybox-w32-8dc83c654d895f82da4059be7d8709edf66bba36.tar.bz2
busybox-w32-8dc83c654d895f82da4059be7d8709edf66bba36.zip
Bring this up to date with busybox-1.1.1.fixes.patch by importing
svn 14653, 14684, 14746, and 14749.
-rw-r--r--modutils/insmod.c4
-rw-r--r--util-linux/mount.c47
2 files changed, 25 insertions, 26 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c
index 2eebf560f..efa0499e4 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -681,9 +681,9 @@ static enum obj_reloc arch_apply_relocation (struct obj_file *f,
681 ElfW(RelM) *rel, ElfW(Addr) value); 681 ElfW(RelM) *rel, ElfW(Addr) value);
682 682
683static void arch_create_got (struct obj_file *f); 683static void arch_create_got (struct obj_file *f);
684#if ENABLE_FEATURE_CHECK_TAINTED_MODULE 684
685static int obj_gpl_license(struct obj_file *f, const char **license); 685static int obj_gpl_license(struct obj_file *f, const char **license);
686#endif /* ENABLE_FEATURE_CHECK_TAINTED_MODULE */ 686
687#endif /* obj.h */ 687#endif /* obj.h */
688//---------------------------------------------------------------------------- 688//----------------------------------------------------------------------------
689//--------end of modutils obj.h 689//--------end of modutils obj.h
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 1e4d5aa31..68f483555 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -184,6 +184,8 @@ static void delete_block_backed_filesystems(void)
184{ 184{
185 llist_free(fslist); 185 llist_free(fslist);
186} 186}
187#else
188void delete_block_backed_filesystems(void);
187#endif 189#endif
188 190
189#if ENABLE_FEATURE_MTAB_SUPPORT 191#if ENABLE_FEATURE_MTAB_SUPPORT
@@ -196,12 +198,9 @@ static int fakeIt;
196 198
197// Perform actual mount of specific filesystem at specific location. 199// Perform actual mount of specific filesystem at specific location.
198 200
199static int mount_it_now(struct mntent *mp, int vfsflags) 201static int mount_it_now(struct mntent *mp, int vfsflags, char *filteropts)
200{ 202{
201 int rc; 203 int rc;
202 char *filteropts = 0;
203
204 parse_mount_options(mp->mnt_opts, &filteropts);
205 204
206 if (fakeIt) { return 0; } 205 if (fakeIt) { return 0; }
207 206
@@ -217,8 +216,6 @@ static int mount_it_now(struct mntent *mp, int vfsflags)
217 vfsflags |= MS_RDONLY; 216 vfsflags |= MS_RDONLY;
218 } 217 }
219 218
220 free(filteropts);
221
222 // Abort entirely if permission denied. 219 // Abort entirely if permission denied.
223 220
224 if (rc && errno == EPERM) 221 if (rc && errno == EPERM)
@@ -266,11 +263,11 @@ static int mount_it_now(struct mntent *mp, int vfsflags)
266static int singlemount(struct mntent *mp) 263static int singlemount(struct mntent *mp)
267{ 264{
268 int rc = 1, vfsflags; 265 int rc = 1, vfsflags;
269 char *loopFile = 0; 266 char *loopFile = 0, *filteropts = 0;
270 llist_t *fl = 0; 267 llist_t *fl = 0;
271 struct stat st; 268 struct stat st;
272 269
273 vfsflags = parse_mount_options(mp->mnt_opts, 0); 270 vfsflags = parse_mount_options(mp->mnt_opts, &filteropts);
274 271
275 // Treat fstype "auto" as unspecified. 272 // Treat fstype "auto" as unspecified.
276 273
@@ -282,23 +279,24 @@ static int singlemount(struct mntent *mp)
282 (!mp->mnt_type || !strcmp(mp->mnt_type,"nfs")) && 279 (!mp->mnt_type || !strcmp(mp->mnt_type,"nfs")) &&
283 strchr(mp->mnt_fsname, ':') != NULL) 280 strchr(mp->mnt_fsname, ':') != NULL)
284 { 281 {
285 char *options=0; 282 if (nfsmount(mp->mnt_fsname, mp->mnt_dir, &vfsflags, &filteropts, 1)) {
286 parse_mount_options(mp->mnt_opts, &options);
287 if (nfsmount(mp->mnt_fsname, mp->mnt_dir, &vfsflags, &options, 1)) {
288 bb_perror_msg("nfsmount failed"); 283 bb_perror_msg("nfsmount failed");
289 return 1; 284 return 1;
285 } else {
286 // Strangely enough, nfsmount() doesn't actually mount() anything.
287 mp->mnt_type = "nfs";
288 rc = mount_it_now(mp, vfsflags, filteropts);
289 if (ENABLE_FEATURE_CLEAN_UP) free(filteropts);
290
291 return rc;
290 } 292 }
291
292 // Strangely enough, nfsmount() doesn't actually mount() anything.
293
294 else return mount_it_now(mp, vfsflags);
295 } 293 }
296 294
297 // Look at the file. (Not found isn't a failure for remount.) 295 // Look at the file. (Not found isn't a failure for remount, or for
296 // a synthetic filesystem like proc or sysfs.)
298 297
299 if (lstat(mp->mnt_fsname, &st)); 298 if (lstat(mp->mnt_fsname, &st));
300 299 else if (!(vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE))) {
301 if (!(vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE))) {
302 // Do we need to allocate a loopback device for it? 300 // Do we need to allocate a loopback device for it?
303 301
304 if (ENABLE_FEATURE_MOUNT_LOOP && S_ISREG(st.st_mode)) { 302 if (ENABLE_FEATURE_MOUNT_LOOP && S_ISREG(st.st_mode)) {
@@ -324,7 +322,7 @@ static int singlemount(struct mntent *mp)
324 * to the actual mount. */ 322 * to the actual mount. */
325 323
326 if (mp->mnt_type || (vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE))) 324 if (mp->mnt_type || (vfsflags & (MS_REMOUNT | MS_BIND | MS_MOVE)))
327 rc = mount_it_now(mp, vfsflags); 325 rc = mount_it_now(mp, vfsflags, filteropts);
328 326
329 // Loop through filesystem types until mount succeeds or we run out 327 // Loop through filesystem types until mount succeeds or we run out
330 328
@@ -336,25 +334,26 @@ static int singlemount(struct mntent *mp)
336 334
337 if (!fslist) { 335 if (!fslist) {
338 fslist = get_block_backed_filesystems(); 336 fslist = get_block_backed_filesystems();
339#if ENABLE_FEATURE_CLEAN_UP
340 if (ENABLE_FEATURE_CLEAN_UP && fslist) 337 if (ENABLE_FEATURE_CLEAN_UP && fslist)
341 atexit(delete_block_backed_filesystems); 338 atexit(delete_block_backed_filesystems);
342#endif
343 } 339 }
344 340
345 for (fl = fslist; fl; fl = fl->link) { 341 for (fl = fslist; fl; fl = fl->link) {
346 mp->mnt_type = fl->data; 342 mp->mnt_type = fl->data;
347 343
348 if (!(rc = mount_it_now(mp,vfsflags))) break; 344 if (!(rc = mount_it_now(mp,vfsflags, filteropts))) break;
349 345
350 mp->mnt_type = 0; 346 mp->mnt_type = 0;
351 } 347 }
352 } 348 }
353 349
354 // Mount failed. Clean up 350 if (ENABLE_FEATURE_CLEAN_UP) free(filteropts);
351
352 // If mount failed, clean up loop file (if any).
353
355 if (rc && loopFile) { 354 if (rc && loopFile) {
356 del_loop(mp->mnt_fsname); 355 del_loop(mp->mnt_fsname);
357 if(ENABLE_FEATURE_CLEAN_UP) { 356 if (ENABLE_FEATURE_CLEAN_UP) {
358 free(loopFile); 357 free(loopFile);
359 free(mp->mnt_fsname); 358 free(mp->mnt_fsname);
360 } 359 }