Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 638578

Summary: Confusing `-r' option at setquota/edquota grace/period setting
Product: Red Hat Enterprise Linux 5 Reporter: Petr Pisar <ppisar>
Component: quotaAssignee: Petr Pisar <ppisar>
Status: CLOSED ERRATA QA Contact: Martin Cermak <mcermak>
Severity: medium Docs Contact:
Priority: low    
Version: 5.6CC: mcermak, rvokal
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://sourceforge.net/tracker/?func=detail&aid=3202953&group_id=18136&atid=118136
Whiteboard:
Fixed In Version: quota-3.13-5.el5 Doc Type: Bug Fix
Doc Text:
The setquota and edquota utilities provide the "-r" command line option, which allows users to set quotas over the remote procedure call (RPC) protocol. Prior to this update, the usage information for edquota incorrectly stated that this option can be used along with the "-t" and "-T" command line options to set a grace period and grace time. With this update, the usage information has been corrected, and the setquota and edquota utilities have been adapted to report an error when this combination of options is used.
Story Points: ---
Clone Of:
: 683554 (view as bug list) Environment:
Last Closed: 2011-04-06 09:34:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix none

Description Petr Pisar 2010-09-29 12:13:23 UTC
# rpm -q quota
quota-3.13-3.el5

# setquota -h
setquota: invalid option -- h
setquota: Usage:
  setquota [-u|-g] [-x] [-r] [-F quotaformat] <user|group>
        <block-softlimit> <block-hardlimit> <inode-softlimit> <inode-hardlimit> -a|<filesystem>...
  setquota [-u|-g] [-x] [-r] [-F quotaformat] <-p protouser|protogroup> <user|group> -a|<filesystem>...
  setquota [-u|-g] [-x] [-r] [-F quotaformat] -b -a|<filesystem>...
  setquota [-u|-g] [-x] [-F quotaformat] -t <blockgrace> <inodegrace> -a|<filesystem>...
  setquota [-u|-g] [-x] [-F quotaformat] <user|group> -T <blockgrace> <inodegrace> -a|<filesystem>...
Bugs to: mvw.net, jack


There is no `-r' option described in contrast to setquota(8) manual page and that RPC quota manipulation has been enabled as fix of bug #469753.

quota-tools-3.17 (from Fedora) shows:

  setquota [-u|-g] [-rm] [-F quotaformat] <user|group>
        <block-softlimit> <block-hardlimit> <inode-softlimit> <inode-hardlimit> -a|<filesystem>...
  setquota [-u|-g] [-rm] [-F quotaformat] <-p protouser|protogroup> <user|group> -a|<filesystem>...
  setquota [-u|-g] [-rm] [-F quotaformat] -b [-c] -a|<filesystem>...
[...]

Comment 1 Petr Pisar 2011-03-08 10:51:52 UTC
This bug report has been reported badly. Current state is:

# rpm -q quota
quota-3.13-4.el5

edquota(8) manual:
       edquota [ -p protoname ] [ -u | -g ] [ -r ] [ -x ] [ -F format-name ] [
       -f filesystem ] username...

       edquota [ -u | -g ] [ -x ] [ -F format-name ] [ -f filesystem ] -t

       edquota [ -u | -g ] [ -x ] [ -F format-name ]  [  -f  filesystem  ]  -T
       username | groupname...

# edquota 
edquota: Usage:
  edquota [-r] [-u] [-x] [-F formatname] [-p username] [-f filesystem] username ...
  edquota [-r] -g [-x] [-F formatname] [-p groupname] [-f filesystem] groupname ...
  edquota [-r] [-u|g] [-x] [-F formatname] [-f filesystem] -t
  edquota [-r] [-u|g] [-x] [-F formatname] [-f filesystem] -T username|groupname ...
Bugs to: mvw.net, jack


setquota(8) manual:
       setquota  [ -r ] [ -u | -g ] [ -x ] [ -F quotaformat ] name block-soft-
       limit block-hardlimit inode-softlimit  inode-hardlimit  -a  |  filesys-
       tem...

       setquota  [ -r ] [ -u | -g ] [ -x ] [ -F quotaformat ] [ -p protoname ]
       name -a | filesystem...

       setquota -b [ -r ] [ -u | -g ] [ -x ] [ -F quotaformat ] -a |  filesys-
       tem...

       setquota  -t  [  -u | -g ] [ -x ] [ -F quotaformat ] block-grace inode-
       grace -a | filesystem...

       setquota -T [ -u | -g ] [ -x ] [  -F  quotaformat  ]  name  block-grace
       inode-grace -a | filesystem...

# setquota 
setquota: Bad number of arguments.
setquota: Usage:
  setquota [-u|-g] [-x] [-r] [-F quotaformat] <user|group>
        <block-softlimit> <block-hardlimit> <inode-softlimit> <inode-hardlimit> -a|<filesystem>...
  setquota [-u|-g] [-x] [-r] [-F quotaformat] <-p protouser|protogroup> <user|group> -a|<filesystem>...
  setquota [-u|-g] [-x] [-r] [-F quotaformat] -b -a|<filesystem>...
  setquota [-u|-g] [-x] [-F quotaformat] -t <blockgrace> <inodegrace> -a|<filesystem>...
  setquota [-u|-g] [-x] [-F quotaformat] <user|group> -T <blockgrace> <inodegrace> -a|<filesystem>...
Bugs to: mvw.net, jack


So the only problem is edquota(8) synopsis in manual does not show `-r' option at -t and -T variants.

Actually setting periods remotely is not work in RHEL-5 nor in latest development version.

Comment 2 Petr Pisar 2011-03-09 17:08:02 UTC
It turned out the bug is not only misleading manual or usage output.

The problem is setting grace time over RPC is not supported by quota RPC protocol and setting grace period over RPC is not reliable (because of poor RPC protocol).

Upstream removed `-r' and `-m' options from setquota/edquota usage and manual at `-t' and `-T' invocations and disallowed those tools to set the grace values over RPC completely. Commits:

8d4c4a761c27a81d96ae8c49e1b8d32d66b6751e
  (Fix synopsis and properly report errors during remote grace period setting)
418a9f20ee870953790b4331327ccb24ca8f1e47
 (Forbid grace time setting over RPC)

Small bug has been introduced which can be solved by on-liner:

--- a/setquota.c
+++ b/setquota.c
@@ -379,7 +379,7 @@ static int setgraces(struct quota_handle **handles)
        int i, ret = 0;
 
        for (i = 0; handles[i]; i++) {
-               if (handles[i]->qh_ops->write_info) {
+               if (!handles[i]->qh_ops->write_info) {
                        errstr(_("Setting grace period on %s is not supported.\n
                        ret = -1;
                        continue;

Because setting grace period/times remotely has never worked, I'm going to back-port these patches.

Comment 3 Petr Pisar 2011-03-10 09:39:27 UTC
Created attachment 483399 [details]
Fix

This makes documentation clear by removing support for setting grace period and time remotely. This has never worked, does not work and will never work with current quota RPC protocol.

setquota/edquota usage output, their manual pages and exit codes have been aligned.

The patch is back-ported from upstream git tree.

Comment 6 Jaromir Hradilek 2011-03-11 12:06:39 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The setquota and edquota utilities provide the "-r" command line option, which allows users to set quotas over the remote procedure call (RPC) protocol. Prior to this update, the usage information for edquota incorrectly stated that this option can be used along with the "-t" and "-T" command line options to set a grace period and grace time. With this update, the usage information has been corrected, and the setquota and edquota utilities have been adapted to report an error when this combination of options is used.

Comment 10 errata-xmlrpc 2011-04-06 09:34:46 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0416.html