From 66122aeb32919c85ac1b773cc446626b1ff436b2 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 14 Sep 2008 11:50:19 +0000 Subject: 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 --- usr.sbin/quot/quot.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'usr.sbin') 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) { -- cgit v1.1