From owner-freebsd-bugs Wed Nov 5 07:40:07 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id HAA16542 for bugs-outgoing; Wed, 5 Nov 1997 07:40:07 -0800 (PST) (envelope-from owner-freebsd-bugs) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id HAA16520; Wed, 5 Nov 1997 07:40:03 -0800 (PST) (envelope-from gnats) Resent-Date: Wed, 5 Nov 1997 07:40:03 -0800 (PST) Resent-Message-Id: <199711051540.HAA16520@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, ovg@nusun.jinr.ru Received: (from nobody@localhost) by hub.freebsd.org (8.8.7/8.8.7) id HAA16167; Wed, 5 Nov 1997 07:35:59 -0800 (PST) (envelope-from nobody) Message-Id: <199711051535.HAA16167@hub.freebsd.org> Date: Wed, 5 Nov 1997 07:35:59 -0800 (PST) From: ovg@nusun.jinr.ru To: freebsd-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: www-1.0 Subject: bin/4949: rpc.rquotad stat()s fs with quota file instead of one given in fs_file Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >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: