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
This commit is contained in:
parent
87628fd213
commit
66122aeb32
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user