aboutsummaryrefslogtreecommitdiff
path: root/util-linux/mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux/mount.c')
-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 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;