summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorMatt Kraai2001-05-04 14:49:58 +0000
committerMatt Kraai2001-05-04 14:49:58 +0000
commite6bf66eada0a5d34d2a04fba1638d3f7dc5cd276 (patch)
tree40ad37b3ae456d2aaa02de47419630bad480b5b4 /util-linux
parentb0aca921beb3345f5b61405f8915af82cad77d35 (diff)
downloadbusybox-e6bf66eada0a5d34d2a04fba1638d3f7dc5cd276.zip
busybox-e6bf66eada0a5d34d2a04fba1638d3f7dc5cd276.tar.gz
Fix two bugs reported by Ralph Jones.
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/mount.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 89eb099..9d61bd3 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -381,9 +381,13 @@ extern int mount_main(int argc, char **argv)
if (!all && optind == argc)
show_mounts();
- if (optind < argc)
- if (realpath(argv[optind], device) == NULL)
+ if (optind < argc) {
+ /* Don't canonicalize NFS devices. */
+ if (strchr(argv[optind], ':') != NULL)
+ safe_strncpy(device, argv[optind], PATH_MAX);
+ else if (realpath(argv[optind], device) == NULL)
perror_msg_and_die("%s", device);
+ }
if (optind + 1 < argc)
if (realpath(argv[optind + 1], directory) == NULL)
@@ -444,7 +448,7 @@ singlemount:
if (fstabmount == TRUE)
endmntent(f);
- if (all == FALSE && fstabmount == TRUE && optind + 1 == argc)
+ if (all == FALSE && fstabmount == TRUE && m == NULL)
fprintf(stderr, "Can't find %s in /etc/fstab\n", device);
return rc;