bin/58483: [PATCH]

Oleg Karachevtsev ok at etrust.ru
Fri Oct 24 04:00:37 PDT 2003


>Number:         58483
>Category:       bin
>Synopsis:       [PATCH]
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 24 04:00:34 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Oleg Karachevtsev
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD 5.1-CURRENT i386

>Description:
	Allows type special or node relative names.
>How-To-Repeat:
	>cd /dev; mount acd0
	mount: acd0: unknown special file or file system
	>cd /mnt; mount cdrom
	mount: cdrom: unknown special file or file system

>Fix:
Index: mount.c
===================================================================
RCS file: /home/ncvs/src/sbin/mount/mount.c,v
retrieving revision 1.54
diff -u -r1.54 mount.c
--- mount.c	7 Aug 2003 04:51:41 -0000	1.54
+++ mount.c	24 Oct 2003 09:43:17 -0000
@@ -136,6 +136,7 @@
 	pid_t pid;
 	int all, ch, i, init_flags, mntsize, rval, have_fstab;
 	char *cp, *ep, *options;
+	char mntnamereal[MAXPATHLEN + 1];
 
 	all = init_flags = 0;
 	options = NULL;
@@ -272,8 +273,9 @@
 			break;
 		}
 		rmslashes(*argv, *argv);
-		if ((fs = getfsfile(*argv)) == NULL &&
-		    (fs = getfsspec(*argv)) == NULL)
+		if (realpath(*argv,mntnamereal) == NULL ||
+		    ((fs = getfsfile(mntnamereal)) == NULL &&
+		     (fs = getfsspec(mntnamereal)) == NULL))
 			errx(1, "%s: unknown special file or file system",
 			    *argv);
 		if (BADTYPE(fs->fs_type))
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list