diff options
author | ed <ed@FreeBSD.org> | 2008-09-14 11:50:19 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2008-09-14 11:50:19 +0000 |
commit | 66122aeb32919c85ac1b773cc446626b1ff436b2 (patch) | |
tree | c90fc0615a8025f62a02f64062ec8a295836cfc9 /usr.sbin/quot/quot.c | |
parent | 87628fd213cbfdff692cb411ac64d4f006a8e6e4 (diff) | |
download | FreeBSD-src-66122aeb32919c85ac1b773cc446626b1ff436b2.zip FreeBSD-src-66122aeb32919c85ac1b773cc446626b1ff436b2.tar.gz |
Make `quot -a' work when we've got slashes in the device name.
A very long time ago we had raw device nodes. quot(8) was supposed to
use these when running `quot -a'. For some reason the code got once
changed to strip the device name until it reaches the last slash. This
is not reliable, because this means /dev/mirror/foo will be stripped to
/dev/foo.
This bug also exists on RELENG_7 and RELENG_6, but I think I'll just
merge them back somewhere after the upcoming releases. There's no rush.
MFC after: 2 months
Diffstat (limited to 'usr.sbin/quot/quot.c')
-rw-r--r-- | usr.sbin/quot/quot.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c index 0d61fbb..4da58ba 100644 --- a/usr.sbin/quot/quot.c +++ b/usr.sbin/quot/quot.c @@ -589,8 +589,6 @@ main(int argc, char *argv[]) char all = 0; struct statfs *mp; struct fstab *fs; - char dev[MNAMELEN + 1]; - char *nm; int cnt; func = douser; @@ -631,14 +629,8 @@ main(int argc, char *argv[]) if (all) { cnt = getmntinfo(&mp,MNT_NOWAIT); for (; --cnt >= 0; mp++) { - if (!strncmp(mp->f_fstypename, "ufs", MFSNAMELEN)) { - if ((nm = strrchr(mp->f_mntfromname,'/'))) { - sprintf(dev,"%s%s",_PATH_DEV,nm + 1); - nm = dev; - } else - nm = mp->f_mntfromname; - quot(nm,mp->f_mntonname); - } + if (!strncmp(mp->f_fstypename, "ufs", MFSNAMELEN)) + quot(mp->f_mntfromname, mp->f_mntonname); } } while (--argc >= 0) { |