OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Subject: Re: PAM and quotas
From: James FitzGibbon (jamestargetnet.com)
Date: Fri Feb 25 2000 - 11:06:16 CST


* Fernando Schapachnik (fpschans1.via-net-works.net.ar) [000225 11:01]:

> overhead. But a problem arise: If the user is not on /etc/passwd he
> can't have quotas (or am I wrong here?) and I need them.

You can have quotas without having a user in the password file; at it's
heart, quotas on UFS filesystems operate on uids, not on user names. The
edquota program in the base and setquota (in the ports collection) want a
username so that they can derive the uid from /etc/passwd.

At my last job I wrote a tool to set quotas based on an explicit provided
uid (it used the quotactl syscall) in perl, and this worked for a user base
of more than 100,000 users, none of whom had /etc/passwd entries.

I think the best bet would be to take the source for setquota (see
/usr/ports/sysutils/setquota) and modify it to allow you to specify an
explicit uid. The file quotatool.c contains the code. You could modify it
such that giving a username of '#1000' attempted to set the quota for uid
1000, or perhaps just calling atol() on the username from the command line
if the call to getpwnam() fails.

-- 
j.

James FitzGibbon jamestargetnet.com Targetnet.com Inc. Voice/Fax +1 416 306-0466/0452

To Unsubscribe: send mail to majordomoFreeBSD.org with "unsubscribe freebsd-security" in the body of the message