summaryrefslogtreecommitdiff
path: root/rquota_svc.c
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2001-05-02 09:32:22 +0000
committerjkar8572 <jkar8572>2001-05-02 09:32:22 +0000
commit84ec12aa207cb8d5323b63847bfd8115881f2886 (patch)
tree9533951fedda68167081028741a9ec3fd8ad547b /rquota_svc.c
parent9c4a512419c660c0513db48e038169167e3e7d25 (diff)
Added mntopt.h to dependencies in Makefile.in.
Fixed MNTTYPE_REISER to proper string. sprintf->snprintf Merged Marco's patch with errstr(), configurable BSD behaviour Fixed bug in quota detection IO code now opens file only RO if possible. IO code now doesn't open file if not required. Fixed bug in quotaon. Updated all manpages.
Diffstat (limited to 'rquota_svc.c')
-rw-r--r--rquota_svc.c44
1 files changed, 32 insertions, 12 deletions
diff --git a/rquota_svc.c b/rquota_svc.c
index 368d212..6baf0a3 100644
--- a/rquota_svc.c
+++ b/rquota_svc.c
@@ -1,8 +1,23 @@
/*
- * Please do not edit this file.
- * It was generated using rpcgen.
+ * QUOTA An implementation of the diskquota system for the LINUX operating
+ * system. QUOTA is implemented using the BSD systemcall interface
+ * as the means of communication with the user level. Should work for
+ * all filesystems because of integration into the VFS layer of the
+ * operating system. This is based on the Melbourne quota system wich
+ * uses both user and group quota files.
+ *
+ * Rquota service handlers.
+ *
+ * Author: Marco van Wieringen <mvw@planets.elm.net>
+ *
+ * Version: $Id: rquota_svc.c,v 1.2 2001/05/02 09:32:22 jkar8572 Exp $
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
*/
-
+
#include <rpc/rpc.h>
#include <sys/socket.h>
#include <netinet/in.h>
@@ -18,9 +33,12 @@
#endif
#include "pot.h"
+#include "common.h"
#include "rquota.h"
#include "quotasys.h"
+char *progname;
+
/*
* Global authentication credentials.
*/
@@ -100,7 +118,7 @@ static void rquotaprog_1(struct svc_req *rqstp, register SVCXPRT * transp)
svcerr_systemerr(transp);
}
if (!svc_freeargs(transp, xdr_argument, (caddr_t) & argument)) {
- fprintf(stderr, _("unable to free arguments"));
+ errstr(_("unable to free arguments"));
exit(1);
}
return;
@@ -178,7 +196,7 @@ static void rquotaprog_2(struct svc_req *rqstp, register SVCXPRT * transp)
svcerr_systemerr(transp);
}
if (!svc_freeargs(transp, xdr_argument, (caddr_t) & argument)) {
- fprintf(stderr, _("unable to free arguments"));
+ errstr(_("unable to free arguments"));
exit(1);
}
return;
@@ -192,6 +210,8 @@ int main(int argc, char **argv)
argvargs = argv;
gettexton();
+ progname = basename(argv[0]);
+
warn_new_kernel(-1);
(void)pmap_unset(RQUOTAPROG, RQUOTAVERS);
@@ -199,35 +219,35 @@ int main(int argc, char **argv)
transp = svcudp_create(RPC_ANYSOCK);
if (transp == NULL) {
- fprintf(stderr, _("cannot create udp service."));
+ errstr(_("cannot create udp service."));
exit(1);
}
if (!svc_register(transp, RQUOTAPROG, RQUOTAVERS, rquotaprog_1, IPPROTO_UDP)) {
- fprintf(stderr, _("unable to register (RQUOTAPROG, RQUOTAVERS, udp)."));
+ errstr(_("unable to register (RQUOTAPROG, RQUOTAVERS, udp)."));
exit(1);
}
if (!svc_register(transp, RQUOTAPROG, EXT_RQUOTAVERS, rquotaprog_2, IPPROTO_UDP)) {
- fprintf(stderr, _("unable to register (RQUOTAPROG, EXT_RQUOTAVERS, udp)."));
+ errstr(_("unable to register (RQUOTAPROG, EXT_RQUOTAVERS, udp)."));
exit(1);
}
transp = svctcp_create(RPC_ANYSOCK, 0, 0);
if (transp == NULL) {
- fprintf(stderr, _("cannot create tcp service."));
+ errstr(_("cannot create tcp service."));
exit(1);
}
if (!svc_register(transp, RQUOTAPROG, RQUOTAVERS, rquotaprog_1, IPPROTO_TCP)) {
- fprintf(stderr, _("unable to register (RQUOTAPROG, RQUOTAVERS, tcp)."));
+ errstr(_("unable to register (RQUOTAPROG, RQUOTAVERS, tcp)."));
exit(1);
}
if (!svc_register(transp, RQUOTAPROG, EXT_RQUOTAVERS, rquotaprog_2, IPPROTO_TCP)) {
- fprintf(stderr, _("unable to register (RQUOTAPROG, EXT_RQUOTAVERS, tcp)."));
+ errstr(_("unable to register (RQUOTAPROG, EXT_RQUOTAVERS, tcp)."));
exit(1);
}
daemon(1, 1);
svc_run();
- fprintf(stderr, _("svc_run returned"));
+ errstr(_("svc_run returned"));
exit(1);
/* NOTREACHED */
}