summaryrefslogtreecommitdiffstats
path: root/contrib/amd/amq
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-01-13 19:23:16 +0000
committerobrien <obrien@FreeBSD.org>1999-01-13 19:23:16 +0000
commitc9384f1d982e4695904ef82271714a049cd32827 (patch)
tree61bf33c6051ae2a19db07aea7c3c0ed78913fe61 /contrib/amd/amq
parentc6e3533e1e31cbf25e04688d244a8fc2af2e1972 (diff)
downloadFreeBSD-src-c9384f1d982e4695904ef82271714a049cd32827.zip
FreeBSD-src-c9384f1d982e4695904ef82271714a049cd32827.tar.gz
Virgin import of AMD (am-utils) v6.0
Diffstat (limited to 'contrib/amd/amq')
-rw-r--r--contrib/amd/amq/amq.82
-rw-r--r--contrib/amd/amq/amq.c73
-rw-r--r--contrib/amd/amq/amq.h4
-rw-r--r--contrib/amd/amq/amq_clnt.c4
-rw-r--r--contrib/amd/amq/amq_xdr.c4
-rw-r--r--contrib/amd/amq/pawd.12
-rw-r--r--contrib/amd/amq/pawd.c10
7 files changed, 58 insertions, 41 deletions
diff --git a/contrib/amd/amq/amq.8 b/contrib/amd/amq/amq.8
index 4084cdb..4c7c2fa 100644
--- a/contrib/amd/amq/amq.8
+++ b/contrib/amd/amq/amq.8
@@ -38,7 +38,7 @@
.\"
.\" %W% (Berkeley) %G%
.\"
-.\" $Id: amq.8,v 5.2.2.1 1992/02/09 15:11:15 jsp beta $
+.\" $Id: amq.8,v 1.1.1.1 1998/11/05 02:04:52 ezk Exp $
.\"
.TH AMQ 8 "25 April 1989"
.SH NAME
diff --git a/contrib/amd/amq/amq.c b/contrib/amd/amq/amq.c
index 7fba9b1..b400446 100644
--- a/contrib/amd/amq/amq.c
+++ b/contrib/amd/amq/amq.c
@@ -17,7 +17,7 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
+ * must display the following acknowledgment:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amq.c,v 5.2.2.1 1992/02/09 15:09:16 jsp beta $
+ * $Id: amq.c,v 1.2 1998/12/27 06:24:50 ezk Exp $
*
*/
@@ -54,7 +54,7 @@ char copyright[] = "\
@(#)Copyright (c) 1990 The Regents of the University of California.\n\
@(#)All rights reserved.\n";
#if __GNUC__ < 2
-static char rcsid[] = "$Id: amq.c,v 6.0 1997-1998/01/01 15:09:16 ezk $";
+static char rcsid[] = "$Id: amq.c,v 1.2 1998/12/27 06:24:50 ezk Exp $";
static char sccsid[] = "%W% (Berkeley) %G%";
#endif /* __GNUC__ < 2 */
#endif /* not lint */
@@ -66,7 +66,9 @@ static char sccsid[] = "%W% (Berkeley) %G%";
#include <amq.h>
/* locals */
+#if 0
char *progname;
+#endif
static int flush_flag;
static int minfo_flag;
static int getpid_flag;
@@ -86,7 +88,7 @@ static char *def_server = localhost;
extern int optind;
extern char *optarg;
-/* forward decalrations */
+/* forward declarations */
#ifdef HAVE_TRANSPORT_TYPE_TLI
static CLIENT *get_secure_amd_client(char *host, struct timeval *tv, int *sock);
static int amq_bind_resv_port(int td, u_short *pp);
@@ -95,10 +97,13 @@ static int privsock(int ty);
#endif /* not HAVE_TRANSPORT_TYPE_TLI */
/* dummy variables */
+#if 0
char hostname[MAXHOSTNAMELEN];
-int orig_umask, foreground, debug_flags;
pid_t mypid;
serv_state amd_state;
+int foreground, orig_umask;
+int debug_flags;
+#endif
/* structures */
enum show_opt {
@@ -309,6 +314,7 @@ main(int argc, char *argv[])
struct hostent *hp;
int nodefault = 0;
struct timeval tv;
+ char *progname = NULL;
#ifndef HAVE_TRANSPORT_TYPE_TLI
enum clnt_stat cs;
#endif /* not HAVE_TRANSPORT_TYPE_TLI */
@@ -326,11 +332,12 @@ main(int argc, char *argv[])
}
if (!progname)
progname = "amq";
+ am_set_progname(progname);
/*
* Parse arguments
*/
- while ((opt_ch = getopt(argc, argv, "fh:l:msuvx:D:M:pP:TU")) != EOF)
+ while ((opt_ch = getopt(argc, argv, "fh:l:msuvx:D:M:pP:TU")) != -1)
switch (opt_ch) {
case 'f':
flush_flag = 1;
@@ -412,7 +419,7 @@ main(int argc, char *argv[])
fprintf(stderr, "\
Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
\t[-l logfile|\"syslog\"] [-x log_flags] [-D dbg_opts] [-M mapent]\n\
-\t[-P prognum] [-T] [-U]\n", progname);
+\t[-P prognum] [-T] [-U]\n", am_get_progname());
exit(1);
}
@@ -434,7 +441,8 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
* Get address of server
*/
if ((hp = gethostbyname(server)) == 0 && !STREQ(server, localhost)) {
- fprintf(stderr, "%s: Can't get address of %s\n", progname, server);
+ fprintf(stderr, "%s: Can't get address of %s\n",
+ am_get_progname(), server);
exit(1);
}
memset(&server_addr, 0, sizeof server_addr);
@@ -469,7 +477,7 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
cs = pmap_ping(&server_addr);
if (cs == RPC_TIMEDOUT) {
fprintf(stderr, "%s: failed to contact portmapper on host \"%s\". %s\n",
- progname, server, clnt_sperrno(cs));
+ am_get_progname(), server, clnt_sperrno(cs));
exit(1);
}
@@ -487,7 +495,7 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
}
#endif /* not HAVE_TRANSPORT_TYPE_TLI */
if (!clnt) {
- fprintf(stderr, "%s: ", progname);
+ fprintf(stderr, "%s: ", am_get_progname());
clnt_pcreateerror(server);
exit(1);
}
@@ -502,10 +510,12 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
opt.as_str = debug_opts;
rc = amqproc_setopt_1(&opt, clnt);
if (rc && *rc < 0) {
- fprintf(stderr, "%s: daemon not compiled for debug\n", progname);
+ fprintf(stderr, "%s: daemon not compiled for debug\n",
+ am_get_progname());
errs = 1;
} else if (!rc || *rc > 0) {
- fprintf(stderr, "%s: debug setting for \"%s\" failed\n", progname, debug_opts);
+ fprintf(stderr, "%s: debug setting for \"%s\" failed\n",
+ am_get_progname(), debug_opts);
errs = 1;
}
}
@@ -520,7 +530,8 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
opt.as_str = xlog_optstr;
rc = amqproc_setopt_1(&opt, clnt);
if (!rc || *rc) {
- fprintf(stderr, "%s: setting log level to \"%s\" failed\n", progname, xlog_optstr);
+ fprintf(stderr, "%s: setting log level to \"%s\" failed\n",
+ am_get_progname(), xlog_optstr);
errs = 1;
}
}
@@ -535,7 +546,8 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
opt.as_str = amq_logfile;
rc = amqproc_setopt_1(&opt, clnt);
if (!rc || *rc) {
- fprintf(stderr, "%s: setting logfile to \"%s\" failed\n", progname, amq_logfile);
+ fprintf(stderr, "%s: setting logfile to \"%s\" failed\n",
+ am_get_progname(), amq_logfile);
errs = 1;
}
}
@@ -550,7 +562,8 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
opt.as_str = "";
rc = amqproc_setopt_1(&opt, clnt);
if (!rc || *rc) {
- fprintf(stderr, "%s: amd on %s cannot flush the map cache\n", progname, server);
+ fprintf(stderr, "%s: amd on %s cannot flush the map cache\n",
+ am_get_progname(), server);
errs = 1;
}
}
@@ -570,7 +583,8 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
show_mi(ml, Full, &mwid, &dwid, &twid);
} else {
- fprintf(stderr, "%s: amd on %s cannot provide mount info\n", progname, server);
+ fprintf(stderr, "%s: amd on %s cannot provide mount info\n",
+ am_get_progname(), server);
}
}
@@ -587,8 +601,8 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
errno = *rc;
else
errno = ETIMEDOUT;
- fprintf(stderr, "%s: could not start new ", progname);
- perror("autmount point");
+ fprintf(stderr, "%s: could not start new ", am_get_progname());
+ perror("automount point");
}
}
@@ -601,7 +615,8 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
fputs(*spp, stdout);
XFREE(*spp);
} else {
- fprintf(stderr, "%s: failed to get version information\n", progname);
+ fprintf(stderr, "%s: failed to get version information\n",
+ am_get_progname());
errs = 1;
}
}
@@ -614,7 +629,7 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
if (ip && *ip) {
printf("%d\n", *ip);
} else {
- fprintf(stderr, "%s: failed to get PID of amd\n", progname);
+ fprintf(stderr, "%s: failed to get PID of amd\n", am_get_progname());
errs = 1;
}
}
@@ -646,11 +661,11 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
dwid, dwid, "What");
show_mt(mt, Stats, &mwid, &dwid, &twid);
} else {
- fprintf(stderr, "%s: %s not automounted\n", progname, fs);
+ fprintf(stderr, "%s: %s not automounted\n", am_get_progname(), fs);
}
xdr_pri_free((XDRPROC_T_TYPE) xdr_amq_mount_tree_p, (caddr_t) mtp);
} else {
- fprintf(stderr, "%s: ", progname);
+ fprintf(stderr, "%s: ", am_get_progname());
clnt_perror(clnt, server);
errs = 1;
}
@@ -665,7 +680,7 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
if (ms) {
show_ms(ms);
} else {
- fprintf(stderr, "%s: ", progname);
+ fprintf(stderr, "%s: ", am_get_progname());
clnt_perror(clnt, server);
errs = 1;
}
@@ -690,13 +705,13 @@ Usage: %s [-h host] [[-f] [-m] [-p] [-v] [-s]] | [[-u] directory ...]]\n\
}
} else {
- fprintf(stderr, "%s: ", progname);
+ fprintf(stderr, "%s: ", am_get_progname());
clnt_perror(clnt, server);
errs = 1;
}
}
exit(errs);
- return errs; /* should never reache here */
+ return errs; /* should never reach here */
}
@@ -793,7 +808,7 @@ get_secure_amd_client(char *host, struct timeval *tv, int *sock)
NULL);
if (cs == RPC_TIMEDOUT) {
fprintf(stderr, "%s: failed to contact portmapper on host \"%s\". %s\n",
- progname, host, clnt_sperrno(cs));
+ am_get_progname(), host, clnt_sperrno(cs));
exit(1);
}
}
@@ -811,12 +826,12 @@ get_secure_amd_client(char *host, struct timeval *tv, int *sock)
if (!rpcb_getaddr(amd_program_number, AMQ_VERSION, nc, &nb, host)) {
/*
- * don't pring error messages here, since amd might legitimately
+ * don't print error messages here, since amd might legitimately
* serve udp only
*/
goto tryudp;
}
- /* Create priviledged TCP socket */
+ /* Create privileged TCP socket */
*sock = t_open(nc->nc_device, O_RDWR, 0);
if (*sock < 0) {
@@ -852,7 +867,7 @@ tryudp:
clnt_spcreateerror("couldn't get amd address on udp"));
return NULL;
}
- /* create priviledged UDP socket */
+ /* create privileged UDP socket */
*sock = t_open(nc->nc_device, O_RDWR, 0);
if (*sock < 0) {
diff --git a/contrib/amd/amq/amq.h b/contrib/amd/amq/amq.h
index 98f7383..15ee2aa 100644
--- a/contrib/amd/amq/amq.h
+++ b/contrib/amd/amq/amq.h
@@ -17,7 +17,7 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
+ * must display the following acknowledgment:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amq.h,v 1.1 1996/01/13 23:23:39 ezk Exp ezk $
+ * $Id: amq.h,v 1.1.1.1 1998/11/05 02:04:52 ezk Exp $
*
*/
diff --git a/contrib/amd/amq/amq_clnt.c b/contrib/amd/amq/amq_clnt.c
index 7220cec..606377b 100644
--- a/contrib/amd/amq/amq_clnt.c
+++ b/contrib/amd/amq/amq_clnt.c
@@ -17,7 +17,7 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
+ * must display the following acknowledgment:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amq_clnt.c,v 5.2.2.1 1992/02/09 15:09:24 jsp beta $
+ * $Id: amq_clnt.c,v 1.1.1.1 1998/11/05 02:04:52 ezk Exp $
*
*/
diff --git a/contrib/amd/amq/amq_xdr.c b/contrib/amd/amq/amq_xdr.c
index 79a7294..33093b5 100644
--- a/contrib/amd/amq/amq_xdr.c
+++ b/contrib/amd/amq/amq_xdr.c
@@ -17,7 +17,7 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
+ * must display the following acknowledgment:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: amq_xdr.c,v 5.2.2.1 1992/02/09 15:09:23 jsp beta $
+ * $Id: amq_xdr.c,v 1.1.1.1 1998/11/05 02:04:52 ezk Exp $
*
*/
diff --git a/contrib/amd/amq/pawd.1 b/contrib/amd/amq/pawd.1
index d047372..aa20159 100644
--- a/contrib/amd/amq/pawd.1
+++ b/contrib/amd/amq/pawd.1
@@ -38,7 +38,7 @@
.\"
.\" %W% (Berkeley) %G%
.\"
-.\" $Id: pawd.1,v 5.2.2.1 1992/02/09 15:11:15 jsp beta $
+.\" $Id: pawd.1,v 1.1.1.1 1998/11/05 02:04:52 ezk Exp $
.\"
.TH PAWD 1 "6 Jan 1998"
.SH NAME
diff --git a/contrib/amd/amq/pawd.c b/contrib/amd/amq/pawd.c
index 86ed55f..3479929 100644
--- a/contrib/amd/amq/pawd.c
+++ b/contrib/amd/amq/pawd.c
@@ -17,7 +17,7 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
+ * must display the following acknowledgment:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
@@ -38,7 +38,7 @@
*
* %W% (Berkeley) %G%
*
- * $Id: pawd.c,v 5.2.2.1 1992/02/09 15:09:16 jsp beta $
+ * $Id: pawd.c,v 1.2 1998/12/27 06:24:50 ezk Exp $
*
*/
@@ -59,11 +59,14 @@
#include <amq.h>
/* dummy variables */
+#if 0
char *progname;
char hostname[MAXHOSTNAMELEN];
-int orig_umask, foreground, debug_flags;
pid_t mypid;
serv_state amd_state;
+int foreground, orig_umask;
+int debug_flags;
+#endif
/* statics */
static char *localhost="localhost";
@@ -293,4 +296,3 @@ main(int argc, char *argv[])
}
exit(0);
}
-
OpenPOWER on IntegriCloud