From setantae@submonkey.net  Thu Oct 31 14:09:02 2002
Return-Path: <setantae@submonkey.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D814237B401
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 31 Oct 2002 14:09:02 -0800 (PST)
Received: from rhadamanth.submonkey.net (pc1-cdif2-4-cust210.cdf.cable.ntl.com [80.4.10.210])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 605E343E6E
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 31 Oct 2002 14:09:01 -0800 (PST)
	(envelope-from setantae@submonkey.net)
Received: from setantae by rhadamanth.submonkey.net with local (Exim 4.10)
	id 187NUp-0003id-00
	for FreeBSD-gnats-submit@freebsd.org; Thu, 31 Oct 2002 22:08:59 +0000
Message-Id: <E187NUp-0003id-00@rhadamanth.submonkey.net>
Date: Thu, 31 Oct 2002 22:08:59 +0000
From: Ceri Davies <ceri@FreeBSD.org>
Sender: Ceri Davies <setantae@submonkey.net>
Reply-To: Ceri Davies <ceri@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: edquota -p only changes first username or first uid given
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         44797
>Category:       bin
>Synopsis:       edquota -p only changes first username or first uid given
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 31 14:10:01 PST 2002
>Closed-Date:    Thu Oct 31 14:43:27 PST 2002
>Last-Modified:  Thu Oct 31 14:43:27 PST 2002
>Originator:     Ceri Davies
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
>Environment:
System: FreeBSD shaft.techsupport.co.uk 4.7-STABLE FreeBSD 4.7-STABLE #0: Fri Oct 25 10:56:23 BST 2002 setantae@shaft.techsupport.co.uk:/usr/obj/usr/src/sys/SHAFT i386


	
>Description:
	From edquota(8):
		edquota [-u] [-f fspath] [-p proto-username] username ...

	This in fact only works for the first "username" given.

>How-To-Repeat:
	{root@shaft}-{~} # pw useradd quota100
	{root@shaft}-{~} # pw useradd quota101
	{root@shaft}-{~} # pw useradd quota102
	{root@shaft}-{~} # edquota -u -e /dev/ad0s1g:1024:2048 quota100
	{root@shaft}-{~} # quota -v quota100
	Disk quotas for user quota100 (uid 1026): 
	     Filesystem   usage   quota   limit   grace   files   quota   limit   grace
	          /home       0    1024    2048               0       0       0        
	{root@shaft}-{~} # edquota -p quota100 quota101 quota102
	{root@shaft}-{~} # quota -v quota100
	Disk quotas for user quota100 (uid 1026): 
	     Filesystem   usage   quota   limit   grace   files   quota   limit   grace
	          /home       0    1024    2048               0       0       0        
	{root@shaft}-{~} # quota -v quota101
	Disk quotas for user quota101 (uid 1027): 
	     Filesystem   usage   quota   limit   grace   files   quota   limit   grace
	          /home       0    1024    2048               0       0       0        
	{root@shaft}-{~} # quota -v quota102
	Disk quotas for user quota102 (uid 1028): 
	     Filesystem   usage   quota   limit   grace   files   quota   limit   grace
	          /home       0       0       0               0       0       0        
	{root@shaft}-{~} #

	This also fails with uid's:

	{root@shaft}-{~} # pw useradd quota100 -u 2000
	{root@shaft}-{~} # pw useradd quota101 -u 2001
	{root@shaft}-{~} # pw useradd quota102 -u 2002
	{root@shaft}-{~} # edquota -u -e /home:1024:2048 2000
	{root@shaft}-{~} # quota -v quota100
	Disk quotas for user quota100 (uid 2000): 
	     Filesystem   usage   quota   limit   grace   files   quota   limit   grace
	          /home       0    1024    2048               0       0       0        
	{root@shaft}-{~} # edquota -p 2000 2001 2002
	{root@shaft}-{~} # quota -v quota101
	Disk quotas for user quota101 (uid 2001): 
	     Filesystem   usage   quota   limit   grace   files   quota   limit   grace
	          /home       0    1024    2048               0       0       0        
	{root@shaft}-{~} # quota -v quota102
	Disk quotas for user quota102 (uid 2002): 
	     Filesystem   usage   quota   limit   grace   files   quota   limit   grace
	          /home       0       0       0               0       0       0        

	But works when an actual range is specified:

	{root@shaft}-{~} # edquota -u -e /home:0:0 2001
	{root@shaft}-{~} # edquota -p 2000 2001-2002
	{root@shaft}-{~} # quota -v quota101
	Disk quotas for user quota101 (uid 2001): 
	     Filesystem   usage   quota   limit   grace   files   quota   limit   grace
	          /home       0    1024    2048               0       0       0        
	{root@shaft}-{~} # quota -v quota102
	Disk quotas for user quota102 (uid 2002): 
	     Filesystem   usage   quota   limit   grace   files   quota   limit   grace
	          /home       0    1024    2048
	
	The manual does state:

	If the -p option is specified, edquota will duplicate the quotas of the
	prototypical user specified for each user specified.

	It seems that the -p option requires a range of uid's, and does not
	work when either a list of usernames or a list of uid's is presented.

>Fix:

	This may just be a documentation bug.

>Release-Note:
>Audit-Trail:

From: Ian Dowse <iedowse@maths.tcd.ie>
To: Ceri Davies <ceri@FreeBSD.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: bin/44797: edquota -p only changes first username or first uid given 
Date: Thu, 31 Oct 2002 22:14:52 +0000

 In message <E187NUp-0003id-00@rhadamanth.submonkey.net>, Ceri Davies writes:
 >
 >>Synopsis:       edquota -p only changes first username or first uid given
 
 Try applying revision 1.17 of edquota.c, which it looks like I
 forgot to MFC.
 
 Ian

From: Ceri Davies <setantae@submonkey.net>
To: Ian Dowse <iedowse@maths.tcd.ie>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/44797: edquota -p only changes first username or first uid given
Date: Thu, 31 Oct 2002 22:25:00 +0000

 On Thu, Oct 31, 2002 at 02:20:01PM -0800, Ian Dowse wrote:
 >  
 >  Try applying revision 1.17 of edquota.c, which it looks like I
 >  forgot to MFC.
 
 Yes, that fixes the problem (although the patch doesn't apply cleanly).
 
 Thanks!
 
 Ceri
 -- 
 you can't see when light's so strong
 you can't see when light is gone

From: Ian Dowse <iedowse@maths.tcd.ie>
To: Ceri Davies <setantae@submonkey.net>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: bin/44797: edquota -p only changes first username or first uid given 
Date: Thu, 31 Oct 2002 22:33:46 +0000

 In message <20021031222500.GB14307@submonkey.net>, Ceri Davies writes:
 >On Thu, Oct 31, 2002 at 02:20:01PM -0800, Ian Dowse wrote:
 >>  Try applying revision 1.17 of edquota.c, which it looks like I
 >>  forgot to MFC.
 >
 >Yes, that fixes the problem (although the patch doesn't apply cleanly).
 
 Thanks for testing it - I'll just bring the file into sync with
 -CURRENT, as the only other changes there are cosmetic.
 
 Ian
State-Changed-From-To: open->closed 
State-Changed-By: iedowse 
State-Changed-When: Thu Oct 31 14:40:41 PST 2002 
State-Changed-Why:  

This had been fixed in -CURRENT by revision 1.17 of edquota.c (PR 
misc/15658), but I had forgotten the MFC. Now merged in revision 
1.9.2.6. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=44797 
>Unformatted:
