merge lite-2 changes.
also RCSid police, and add return types to all of the functions.
This commit is contained in:
parent
6aeb76c1f1
commit
ba2d9f692b
@ -1,5 +1,5 @@
|
||||
# from: @(#)Makefile 8.1 (Berkeley) 6/6/93
|
||||
# $Id: Makefile,v 1.4 1994/12/22 11:34:19 cgd Exp $
|
||||
# $NetBSD: Makefile,v 1.5 1997/03/08 08:01:26 mikel Exp $
|
||||
|
||||
PROG= edquota
|
||||
MAN= edquota.8
|
||||
|
@ -32,10 +32,10 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" from: @(#)edquota.8 8.1 (Berkeley) 6/6/93
|
||||
.\" $Id: edquota.8,v 1.4 1994/06/13 21:55:04 mycroft Exp $
|
||||
.\" from: @(#)edquota.8 8.2 (Berkeley) 4/27/95
|
||||
.\" $NetBSD: edquota.8,v 1.5 1997/03/08 08:01:26 mikel Exp $
|
||||
.\"
|
||||
.Dd June 6, 1993
|
||||
.Dd "April 27, 1995"
|
||||
.Dt EDQUOTA 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -88,14 +88,14 @@ The current usage information in the file is for informational purposes;
|
||||
only the hard and soft limits can be changed.
|
||||
.Pp
|
||||
On leaving the editor,
|
||||
.Nm edquota
|
||||
.Nm
|
||||
reads the temporary file and modifies the binary
|
||||
quota files to reflect the changes made.
|
||||
.Pp
|
||||
If the
|
||||
.Fl p
|
||||
flag is specified,
|
||||
.Nm edquota
|
||||
.Nm
|
||||
will duplicate the quotas of the prototypical user
|
||||
specified for each user specified.
|
||||
This is the normal mechanism used to
|
||||
@ -104,7 +104,7 @@ initialize quotas for groups of users.
|
||||
If the
|
||||
.Fl g
|
||||
flag is specified,
|
||||
.Nm edquota
|
||||
.Nm
|
||||
is invoked to edit the quotas of
|
||||
one or more groups specified on the command line.
|
||||
The
|
||||
|
@ -41,8 +41,8 @@ static char copyright[] =
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "from: @(#)edquota.c 8.1 (Berkeley) 6/6/93";*/
|
||||
static char *rcsid = "$Id: edquota.c,v 1.11 1996/03/30 23:42:33 mark Exp $";
|
||||
/* static char sccsid[] = "from: @(#)edquota.c 8.3 (Berkeley) 4/27/95"; */
|
||||
static char *rcsid = "$NetBSD: edquota.c,v 1.12 1997/03/08 08:01:27 mikel Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -52,6 +52,7 @@ static char *rcsid = "$Id: edquota.c,v 1.11 1996/03/30 23:42:33 mark Exp $";
|
||||
#include <sys/stat.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/queue.h>
|
||||
#include <ufs/ufs/quota.h>
|
||||
#include <errno.h>
|
||||
#include <fstab.h>
|
||||
@ -78,6 +79,7 @@ struct quotause {
|
||||
} *getprivs();
|
||||
#define FOUND 0x01
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
register char **argv;
|
||||
int argc;
|
||||
@ -160,6 +162,7 @@ main(argc, argv)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void
|
||||
usage()
|
||||
{
|
||||
fprintf(stderr, "%s%s%s%s",
|
||||
@ -174,6 +177,7 @@ usage()
|
||||
* an identifier. This routine must agree with the kernel routine
|
||||
* getinoquota as to the interpretation of quota types.
|
||||
*/
|
||||
int
|
||||
getentry(name, quotatype)
|
||||
char *name;
|
||||
int quotatype;
|
||||
@ -291,6 +295,7 @@ getprivs(id, quotatype)
|
||||
/*
|
||||
* Store the requested quota information.
|
||||
*/
|
||||
void
|
||||
putprivs(id, quotatype, quplist)
|
||||
long id;
|
||||
int quotatype;
|
||||
@ -306,7 +311,8 @@ putprivs(id, quotatype, quplist)
|
||||
if ((fd = open(qup->qfname, O_WRONLY)) < 0) {
|
||||
perror(qup->qfname);
|
||||
} else {
|
||||
lseek(fd, (off_t)(id * sizeof (struct dqblk)), 0);
|
||||
lseek(fd,
|
||||
(off_t)(id * (long)sizeof (struct dqblk)), L_SET);
|
||||
if (write(fd, &qup->dqblk, sizeof (struct dqblk)) !=
|
||||
sizeof (struct dqblk)) {
|
||||
fprintf(stderr, "edquota: ");
|
||||
@ -320,6 +326,7 @@ putprivs(id, quotatype, quplist)
|
||||
/*
|
||||
* Take a list of priviledges and get it edited.
|
||||
*/
|
||||
int
|
||||
editit(tmpfile)
|
||||
char *tmpfile;
|
||||
{
|
||||
@ -365,6 +372,7 @@ editit(tmpfile)
|
||||
/*
|
||||
* Convert a quotause list to an ASCII file.
|
||||
*/
|
||||
int
|
||||
writeprivs(quplist, outfd, name, quotatype)
|
||||
struct quotause *quplist;
|
||||
int outfd;
|
||||
@ -399,6 +407,7 @@ writeprivs(quplist, outfd, name, quotatype)
|
||||
/*
|
||||
* Merge changes to an ASCII file into a quotause list.
|
||||
*/
|
||||
int
|
||||
readprivs(quplist, infd)
|
||||
struct quotause *quplist;
|
||||
int infd;
|
||||
@ -508,6 +517,7 @@ readprivs(quplist, infd)
|
||||
/*
|
||||
* Convert a quotause list to an ASCII file of grace times.
|
||||
*/
|
||||
int
|
||||
writetimes(quplist, outfd, quotatype)
|
||||
struct quotause *quplist;
|
||||
int outfd;
|
||||
@ -540,6 +550,7 @@ writetimes(quplist, outfd, quotatype)
|
||||
/*
|
||||
* Merge changes of grace times in an ASCII file into a quotause list.
|
||||
*/
|
||||
int
|
||||
readtimes(quplist, infd)
|
||||
struct quotause *quplist;
|
||||
int infd;
|
||||
@ -634,6 +645,7 @@ cvtstoa(time)
|
||||
/*
|
||||
* Convert ASCII input times to seconds.
|
||||
*/
|
||||
int
|
||||
cvtatos(time, units, seconds)
|
||||
time_t time;
|
||||
char *units;
|
||||
@ -659,6 +671,7 @@ cvtatos(time, units, seconds)
|
||||
/*
|
||||
* Free a list of quotause structures.
|
||||
*/
|
||||
void
|
||||
freeprivs(quplist)
|
||||
struct quotause *quplist;
|
||||
{
|
||||
@ -673,6 +686,7 @@ freeprivs(quplist)
|
||||
/*
|
||||
* Check whether a string is completely composed of digits.
|
||||
*/
|
||||
int
|
||||
alldigits(s)
|
||||
register char *s;
|
||||
{
|
||||
@ -689,6 +703,7 @@ alldigits(s)
|
||||
/*
|
||||
* Check to see if a particular quota is to be enabled.
|
||||
*/
|
||||
int
|
||||
hasquota(fs, type, qfnamep)
|
||||
register struct fstab *fs;
|
||||
int type;
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)pathnames.h 8.1 (Berkeley) 6/6/93
|
||||
* $Id: pathnames.h,v 1.3 1994/06/13 21:55:14 mycroft Exp $
|
||||
* $NetBSD: pathnames.h,v 1.4 1997/03/08 08:01:28 mikel Exp $
|
||||
*/
|
||||
|
||||
#include <paths.h>
|
||||
|
Loading…
Reference in New Issue
Block a user