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
While realpath() used rmslashes() is not need at all. Index: getmntopts.c =================================================================== RCS file: /home/ncvs/src/sbin/mount/getmntopts.c,v retrieving revision 1.10 diff -u -r1.10 getmntopts.c --- getmntopts.c 3 May 2003 18:41:58 -0000 1.10 +++ getmntopts.c 24 Oct 2003 12:40:57 -0000 @@ -110,28 +110,6 @@ } void -rmslashes(rrpin, rrpout) - char *rrpin; - char *rrpout; -{ - char *rrpoutstart; - - *rrpout = *rrpin; - for (rrpoutstart = rrpout; *rrpin != '\0'; *rrpout++ = *rrpin++) { - - /* skip all double slashes */ - while (*rrpin == '/' && *(rrpin + 1) == '/') - rrpin++; - } - - /* remove trailing slash if necessary */ - if (rrpout - rrpoutstart > 1 && *(rrpout - 1) == '/') - *(rrpout - 1) = '\0'; - else - *rrpout = '\0'; -} - -void checkpath(path, resolved) const char *path; char *resolved; Index: mntopts.h =================================================================== RCS file: /home/ncvs/src/sbin/mount/mntopts.h,v retrieving revision 1.20 diff -u -r1.20 mntopts.h --- mntopts.h 14 Oct 2002 19:40:00 -0000 1.20 +++ mntopts.h 24 Oct 2003 12:40:57 -0000 @@ -93,6 +93,5 @@ MOPT_ACLS void getmntopts(const char *, const struct mntopt *, int *, int *); -void rmslashes(char *, char *); void checkpath(const char *, char resolved_path[]); extern int getmnt_silent; 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 12:40:58 -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]; all = init_flags = 0; options = NULL; @@ -271,9 +272,9 @@ mntbuf->f_mntonname, init_flags, options, 0); 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)) -- WBR, Oleg Karachevtsev http://dik.pp.ru
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>