Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Feb 2000 12:06:16 -0500
From:      James FitzGibbon <james@targetnet.com>
To:        Fernando Schapachnik <fpscha@via-net-works.net.ar>
Cc:        freebsd-security@freebsd.org
Subject:   Re: PAM and quotas
Message-ID:  <20000225120616.A9161@targetnet.com>
In-Reply-To: <200002251559.MAA24685@ns1.via-net-works.net.ar>
References:  <200002251559.MAA24685@ns1.via-net-works.net.ar>

next in thread | previous in thread | raw e-mail | index | archive | help
* Fernando Schapachnik (fpscha@ns1.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                                           james@targetnet.com
Targetnet.com Inc.                              Voice/Fax +1 416 306-0466/0452


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000225120616.A9161>