Date: Wed, 5 Nov 1997 07:35:59 -0800 (PST) From: ovg@nusun.jinr.ru To: freebsd-gnats-submit@FreeBSD.ORG Subject: bin/4949: rpc.rquotad stat()s fs with quota file instead of one given in fs_file Message-ID: <199711051535.HAA16167@hub.freebsd.org> Resent-Message-ID: <199711051540.HAA16520@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 4949
>Category: bin
>Synopsis: rpc.rquotad stat()s fs with quota file instead of one given in fs_file
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Nov 5 07:40:02 PST 1997
>Last-Modified:
>Originator: Vladimir Olshevsky
>Organization:
Joint Institute for Nuclear Research
>Release: 2.2.5-RELEASE
>Environment:
FreeBSD nuraid.jinr.ru 2.2.5-RELEASE FreeBSD 2.2.5-RELEASE #0: Tue Nov 4 13:05:21 MSK 1997 ovg@nuraid.jinr.ru:/usr/src/sys/compile/NURAID i386
>Description:
2.2.5-RELEASE rpc.rquotad fails, when quota file for one filesystem
resides on other filesystem. Say, quotas for /export placed in
file /var/quotas/export.quota. During initialization, it gets st_dev
for /var, and on request - for /export.
Due to this, comparison
if (fs->st_dev != st_path.st_dev)
in getfsquota() fails.
>How-To-Repeat:
Place file with user quotas for given fs on other fs and enable
rpc.rquotad.
>Fix:
Apply following patch to rquotad.c:
*** rquotad.c Wed Nov 5 18:34:52 1997
--- rquotad.c.orig Wed Nov 5 18:31:35 1997
***************
*** 227,233 ****
fs_current->qfpathname = malloc(sizeof(char) * (strlen(qfpathname) + 1));
strcpy(fs_current->qfpathname, qfpathname);
! stat(fs_current->fs_file, &st);
fs_current->st_dev = st.st_dev;
fs_next = fs_current;
--- 227,233 ----
fs_current->qfpathname = malloc(sizeof(char) * (strlen(qfpathname) + 1));
strcpy(fs_current->qfpathname, qfpathname);
! stat(qfpathname, &st);
fs_current->st_dev = st.st_dev;
fs_next = fs_current;
>Audit-Trail:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199711051535.HAA16167>
