Quota problems with nummeric Usernames

Cameron Simpson cs at zip.com.au
Fri Apr 27 22:35:56 UTC 2007


On 27Apr2007 09:55, G?tz Reinicke <goetz.reinicke at filmakademie.de> wrote:
| we run several Redhat Linux servers and recently we noticed, that some
| of our users do have a problem with their quota.
| 
| We changed our policy for the students username to be their registration
| number; e.g. 0306025. We create the accounts and set the quota by the
| tool webmin (www.webmin.com), which uses setquota for handling quotas.

I think this is your problem. Numeric user names are generally a bad idea
bad many contexts will accept a login _or_ a uid, and they distinguish by
seeing if it looks numeric.

Better still, your leading zero can confuse some programs into treating the
apparent "uid" as basic 8 (octal) if they're carelss with their choice of
"read this number" function.

Can I recommend that you shift to putting a leading letter on your
logins, eg "s0306025".

[...]
| For users having unlimited space, I can't set the quota from within
| webmin, but doing an edquota, the quota shows 0 blocks used even if
| there is space used and the soft and hard limits are set to the limit I
| set by webmin.
| An other strange thing is, that the edquota command shows a strange uid
| which isn't the same as in the /etc/passwd-file.
[...]

Looking at "man edquota":

  One or more users or groups may be speci- fied on the command line.
  If  a number  is  given  in  the place  of user/group  name  it is
  treated as an UID/GID.

That's going to cause you trouble right there.

|  repquota -a|grep 0306025
| 0306025   --  242144  307200  665600            106     0     0
|  edquota 0306025
| Disk quotas for user 0306025 (uid 101397):
|  Filesystem   blocks       soft       hard     inodes     soft     hard
|  /dev/sda6         0          0          0          0        0        0
| 
| grep 0306025 /etc/passwd
| 0306025:x:787:503:Amelie Kuester:/home/studenten/0306025:/sbin/nologin
| 
| after doing
| setquota -u 0306025 102411 204811 600 610 -a
[...]
| Any ideas?

Does:

  repquota -an | egrep '(306025|787|101397)'

Show anything interesting? 787 is 0306025's uid. 101397 is 306025
interpreted as an octal number (which a leading zero will do for some
conversion functions).

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

When I finally kick the bucket I'll probably crawl out of my grave every few
days just to check my mail..... - Peter Gutmann <pgut1 at cs.aukuni.ac.nz>




More information about the redhat-list mailing list