From nobody  Wed Nov  5 07:35:59 1997
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
Subject: rpc.rquotad stat()s fs with quota file instead of one given in fs_file
X-Send-Pr-Version: www-1.0

>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:    mikeh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov  5 07:40:02 PST 1997
>Closed-Date:    Mon Jul 2 17:51:13 PDT 2001
>Last-Modified:  Mon Jul 02 17:51:46 PDT 2001
>Originator:     Vladimir Olshevsky
>Release:        2.2.5-RELEASE
>Organization:
Joint Institute for Nuclear Research
>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;

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: mikeh 
State-Changed-When: Mon Jun 18 21:47:04 PDT 2001 
State-Changed-Why:  
Fix committed to current (only 3.5 years late ;( ). MFC in 2 weeks. 


Responsible-Changed-From-To: freebsd-bugs->mikeh 
Responsible-Changed-By: mikeh 
Responsible-Changed-When: Mon Jun 18 21:47:04 PDT 2001 
Responsible-Changed-Why:  
My MFC reminder. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=4949 
State-Changed-From-To: analyzed->closed 
State-Changed-By: mikeh 
State-Changed-When: Mon Jul 2 17:51:13 PDT 2001 
State-Changed-Why:  
Fix MFC'd. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=4949 
>Unformatted:
