aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2001-05-04 14:49:58 +0000
committerMatt Kraai <kraai@debian.org>2001-05-04 14:49:58 +0000
commite6bf66eada0a5d34d2a04fba1638d3f7dc5cd276 (patch)
tree40ad37b3ae456d2aaa02de47419630bad480b5b4
parentb0aca921beb3345f5b61405f8915af82cad77d35 (diff)
downloadbusybox-w32-e6bf66eada0a5d34d2a04fba1638d3f7dc5cd276.tar.gz
busybox-w32-e6bf66eada0a5d34d2a04fba1638d3f7dc5cd276.tar.bz2
busybox-w32-e6bf66eada0a5d34d2a04fba1638d3f7dc5cd276.zip
Fix two bugs reported by Ralph Jones.
-rw-r--r--mount.c10
-rw-r--r--util-linux/mount.c10
2 files changed, 14 insertions, 6 deletions
diff --git a/mount.c b/mount.c
index 89eb099c5..9d61bd3e3 100644
--- a/mount.c
+++ b/mount.c
@@ -381,9 +381,13 @@ extern int mount_main(int argc, char **argv)
381 if (!all && optind == argc) 381 if (!all && optind == argc)
382 show_mounts(); 382 show_mounts();
383 383
384 if (optind < argc) 384 if (optind < argc) {
385 if (realpath(argv[optind], device) == NULL) 385 /* Don't canonicalize NFS devices. */
386 if (strchr(argv[optind], ':') != NULL)
387 safe_strncpy(device, argv[optind], PATH_MAX);
388 else if (realpath(argv[optind], device) == NULL)
386 perror_msg_and_die("%s", device); 389 perror_msg_and_die("%s", device);
390 }
387 391
388 if (optind + 1 < argc) 392 if (optind + 1 < argc)
389 if (realpath(argv[optind + 1], directory) == NULL) 393 if (realpath(argv[optind + 1], directory) == NULL)
@@ -444,7 +448,7 @@ singlemount:
444 if (fstabmount == TRUE) 448 if (fstabmount == TRUE)
445 endmntent(f); 449 endmntent(f);
446 450
447 if (all == FALSE && fstabmount == TRUE && optind + 1 == argc) 451 if (all == FALSE && fstabmount == TRUE && m == NULL)
448 fprintf(stderr, "Can't find %s in /etc/fstab\n", device); 452 fprintf(stderr, "Can't find %s in /etc/fstab\n", device);
449 453
450 return rc; 454 return rc;
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 89eb099c5..9d61bd3e3 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -381,9 +381,13 @@ extern int mount_main(int argc, char **argv)
381 if (!all && optind == argc) 381 if (!all && optind == argc)
382 show_mounts(); 382 show_mounts();
383 383
384 if (optind < argc) 384 if (optind < argc) {
385 if (realpath(argv[optind], device) == NULL) 385 /* Don't canonicalize NFS devices. */
386 if (strchr(argv[optind], ':') != NULL)
387 safe_strncpy(device, argv[optind], PATH_MAX);
388 else if (realpath(argv[optind], device) == NULL)
386 perror_msg_and_die("%s", device); 389 perror_msg_and_die("%s", device);
390 }
387 391
388 if (optind + 1 < argc) 392 if (optind + 1 < argc)
389 if (realpath(argv[optind + 1], directory) == NULL) 393 if (realpath(argv[optind + 1], directory) == NULL)
@@ -444,7 +448,7 @@ singlemount:
444 if (fstabmount == TRUE) 448 if (fstabmount == TRUE)
445 endmntent(f); 449 endmntent(f);
446 450
447 if (all == FALSE && fstabmount == TRUE && optind + 1 == argc) 451 if (all == FALSE && fstabmount == TRUE && m == NULL)
448 fprintf(stderr, "Can't find %s in /etc/fstab\n", device); 452 fprintf(stderr, "Can't find %s in /etc/fstab\n", device);
449 453
450 return rc; 454 return rc;