Fix conflicts.
This commit is contained in:
parent
d2d5185099
commit
b8f96520e5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=42633
@ -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: amd.c,v 1.2 1998/08/23 22:52:08 obrien Exp $
|
||||
* $Id: amd.c,v 1.3 1998/11/14 03:13:19 obrien Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -55,23 +55,29 @@
|
||||
struct amu_global_options gopt; /* where global options are stored */
|
||||
|
||||
char pid_fsname[16 + MAXHOSTNAMELEN]; /* "kiska.southseas.nz:(pid%d)" */
|
||||
#if 0
|
||||
char *progname; /* "amd" */
|
||||
#endif
|
||||
char *hostdomain = "unknown.domain";
|
||||
#if 0
|
||||
char hostname[MAXHOSTNAMELEN + 1] = "localhost"; /* Hostname */
|
||||
#endif
|
||||
char hostd[2 * MAXHOSTNAMELEN + 1]; /* Host+domain */
|
||||
char *endian = ARCH_ENDIAN; /* Big or Little endian */
|
||||
char *cpu = HOST_CPU; /* CPU type */
|
||||
char *PrimNetName; /* name of primary network */
|
||||
char *PrimNetNum; /* number of primary network */
|
||||
|
||||
int foreground = 1; /* This is the top-level server */
|
||||
int immediate_abort; /* Should close-down unmounts be retried */
|
||||
int orig_umask;
|
||||
int orig_umask = 022;
|
||||
int select_intr_valid;
|
||||
|
||||
jmp_buf select_intr;
|
||||
#if 0
|
||||
pid_t mypid; /* Current process id */
|
||||
serv_state amd_state;
|
||||
int foreground = 1; /* This is the top-level server */
|
||||
#endif
|
||||
struct amd_stats amd_stats; /* Server statistics */
|
||||
struct in_addr myipaddr; /* (An) IP address of this host */
|
||||
time_t do_mapc_reload = 0; /* mapc_reload() call required? */
|
||||
@ -168,7 +174,7 @@ daemon_mode(void)
|
||||
*/
|
||||
for (;;)
|
||||
pause();
|
||||
/* should never reache here */
|
||||
/* should never reach here */
|
||||
}
|
||||
#ifdef HAVE_SIGACTION
|
||||
sigaction(SIGQUIT, &osa, NULL);
|
||||
@ -181,7 +187,7 @@ daemon_mode(void)
|
||||
*/
|
||||
if (gopt.flags & CFM_PRINT_PID) {
|
||||
if (STREQ(gopt.pid_file, "/dev/stdout")) {
|
||||
printf("%ld\n", (long) mypid);
|
||||
printf("%ld\n", (long) am_mypid);
|
||||
fflush(stdout);
|
||||
/* do not fclose stdout */
|
||||
} else {
|
||||
@ -190,7 +196,7 @@ daemon_mode(void)
|
||||
|
||||
f = fopen(gopt.pid_file, "w");
|
||||
if (f) {
|
||||
fprintf(f, "%ld\n", (long) mypid);
|
||||
fprintf(f, "%ld\n", (long) am_mypid);
|
||||
(void) fclose(f);
|
||||
} else {
|
||||
fprintf(stderr, "cannot open %s (errno=%d)\n", gopt.pid_file, errno);
|
||||
@ -307,6 +313,8 @@ main(int argc, char *argv[])
|
||||
char *domdot, *verstr;
|
||||
int ppid = 0;
|
||||
int error;
|
||||
char *progname = NULL; /* "amd" */
|
||||
char hostname[MAXHOSTNAMELEN + 1] = "localhost"; /* Hostname */
|
||||
#ifdef HAVE_SIGACTION
|
||||
struct sigaction sa;
|
||||
#endif /* HAVE_SIGACTION */
|
||||
@ -334,13 +342,14 @@ main(int argc, char *argv[])
|
||||
}
|
||||
if (!progname)
|
||||
progname = "amd";
|
||||
am_set_progname(progname);
|
||||
|
||||
/*
|
||||
* Initialise process id. This is kept
|
||||
* Initialize process id. This is kept
|
||||
* cached since it is used for generating
|
||||
* and using file handles.
|
||||
*/
|
||||
mypid = getpid();
|
||||
am_set_mypid();
|
||||
|
||||
/*
|
||||
* Get local machine name
|
||||
@ -359,13 +368,18 @@ main(int argc, char *argv[])
|
||||
going_down(1);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/* initialize debugging flags (Register AMQ, Enter daemon mode) */
|
||||
debug_flags = D_AMQ | D_DAEMON;
|
||||
#endif /* DEBUG */
|
||||
|
||||
/*
|
||||
* Initialize global options structure.
|
||||
*/
|
||||
init_global_options();
|
||||
|
||||
/*
|
||||
* Partially initialise hostd[]. This
|
||||
* Partially initialize hostd[]. This
|
||||
* is completed in get_args().
|
||||
*/
|
||||
if ((domdot = strchr(hostname, '.'))) {
|
||||
@ -378,6 +392,7 @@ main(int argc, char *argv[])
|
||||
hostdomain = domdot;
|
||||
}
|
||||
strcpy(hostd, hostname);
|
||||
am_set_hostname(hostname);
|
||||
|
||||
/*
|
||||
* Trap interrupts for shutdowns.
|
||||
@ -519,7 +534,7 @@ main(int argc, char *argv[])
|
||||
#endif /* DEBUG */
|
||||
ppid = daemon_mode();
|
||||
|
||||
sprintf(pid_fsname, "%s:(pid%ld)", hostname, (long) mypid);
|
||||
sprintf(pid_fsname, "%s:(pid%ld)", am_get_hostname(), (long) am_mypid);
|
||||
|
||||
do_mapc_reload = clocktime() + ONE_HOUR;
|
||||
|
||||
@ -528,7 +543,7 @@ main(int argc, char *argv[])
|
||||
*/
|
||||
error = mount_automounter(ppid);
|
||||
if (error && ppid)
|
||||
kill(SIGALRM, ppid);
|
||||
kill(ppid, SIGALRM);
|
||||
going_down(error);
|
||||
|
||||
abort();
|
||||
|
@ -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,11 +38,11 @@
|
||||
*
|
||||
* %W% (Berkeley) %G%
|
||||
*
|
||||
* $Id: amq_subr.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
|
||||
* $Id: amq_subr.c,v 1.2 1998/09/04 04:42:28 obrien Exp $
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* Auxilliary routines for amq tool
|
||||
* Auxiliary routines for amq tool
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
@ -139,7 +139,7 @@ amqproc_setopt_1_svc(voidp argp, struct svc_req *rqstp)
|
||||
case AMOPT_LOGFILE:
|
||||
if (gopt.logfile && opt->as_str
|
||||
&& STREQ(gopt.logfile, opt->as_str)) {
|
||||
if (switch_to_logfile(opt->as_str))
|
||||
if (switch_to_logfile(opt->as_str, orig_umask))
|
||||
rc = EINVAL;
|
||||
} else {
|
||||
rc = EACCES;
|
||||
|
@ -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: get_args.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
|
||||
* $Id: get_args.c,v 1.2 1998/09/05 06:06:00 obrien Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -60,11 +60,12 @@ char *conf_tag = NULL; /* default conf file tags to use */
|
||||
int usage = 0;
|
||||
int use_conf_file = 0; /* default don't use amd.conf file */
|
||||
char *mnttab_file_name = NULL; /* symbol must be available always */
|
||||
#if 0
|
||||
#ifdef DEBUG
|
||||
int debug_flags = D_AMQ /* Register AMQ */
|
||||
| D_DAEMON; /* Enter daemon mode */
|
||||
#endif /* DEBUG */
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Return the version string (dynamic buffer)
|
||||
@ -137,7 +138,7 @@ get_args(int argc, char *argv[])
|
||||
case 'a':
|
||||
if (*optarg != '/') {
|
||||
fprintf(stderr, "%s: -a option must begin with a '/'\n",
|
||||
progname);
|
||||
am_get_progname());
|
||||
exit(1);
|
||||
}
|
||||
gopt.auto_dir = optarg;
|
||||
@ -224,7 +225,8 @@ get_args(int argc, char *argv[])
|
||||
#ifdef DEBUG
|
||||
usage += debug_option(optarg);
|
||||
#else /* not DEBUG */
|
||||
fprintf(stderr, "%s: not compiled with DEBUG option -- sorry.\n", progname);
|
||||
fprintf(stderr, "%s: not compiled with DEBUG option -- sorry.\n",
|
||||
am_get_progname());
|
||||
#endif /* not DEBUG */
|
||||
break;
|
||||
|
||||
@ -334,7 +336,7 @@ get_args(int argc, char *argv[])
|
||||
# endif /* DEBUG */
|
||||
#endif /* not MOUNT_TABLE_ON_FILE */
|
||||
|
||||
if (switch_to_logfile(gopt.logfile) != 0)
|
||||
if (switch_to_logfile(gopt.logfile, orig_umask) != 0)
|
||||
plog(XLOG_USER, "Cannot switch logfile");
|
||||
|
||||
/*
|
||||
@ -362,7 +364,7 @@ get_args(int argc, char *argv[])
|
||||
\t[-k kernel_arch] [-l logfile%s\n\
|
||||
\t[-t timeout.retrans] [-w wait_timeout] [-C cluster_name]\n\
|
||||
\t[-o op_sys_ver] [-O op_sys_name]\n\
|
||||
\t[-F conf_file] [-T conf_tag]", progname,
|
||||
\t[-F conf_file] [-T conf_tag]", am_get_progname(),
|
||||
#ifdef HAVE_SYSLOG
|
||||
# ifdef LOG_DAEMON
|
||||
"|\"syslog[:facility]\"]"
|
||||
|
@ -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: srvr_nfs.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
|
||||
* $Id: srvr_nfs.c,v 1.2 1998/09/14 08:20:37 obrien Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -489,7 +489,7 @@ nfs_keepalive(voidp v)
|
||||
nfs_pinged);
|
||||
|
||||
/*
|
||||
* See if a hard error occured
|
||||
* See if a hard error occurred
|
||||
*/
|
||||
switch (error) {
|
||||
case ENETDOWN:
|
||||
@ -571,7 +571,7 @@ nfs_srvr_port(fserver *fs, u_short * port, voidp wchan)
|
||||
if (error < 0 && wchan && !(fs->fs_flags & FSF_WANT)) {
|
||||
/*
|
||||
* If a wait channel is supplied, and no
|
||||
* error has yet occured, then arrange
|
||||
* error has yet occurred, then arrange
|
||||
* that a wakeup is done on the wait channel,
|
||||
* whenever a wakeup is done on this fs node.
|
||||
* Wakeup's are done on the fs node whenever
|
||||
@ -663,18 +663,14 @@ find_nfs_srvr(mntfs *mf)
|
||||
}
|
||||
#endif /* MNTTAB_OPT_PROTO */
|
||||
|
||||
/* XXX: do we want to do this unconditionally of #define's? */
|
||||
/* #if defined(MNTTAB_OPT_VERS ) && defined( MNTTAB_OPT_PROTO ) */
|
||||
{
|
||||
char *nfsv2_opt = hasmntopt(&mnt, "nfsv2");
|
||||
if (nfsv2_opt) {
|
||||
nfs_version = (unsigned long)2; /* nullify any ``vers=X'' statements */
|
||||
nfs_proto = "udp"; /* nullify any ``proto=tcp'' stmts */
|
||||
plog(XLOG_WARNING, "found compatiblity option \"nfsv2\": set options"
|
||||
" vers=2, proto=udp for host %s", host);
|
||||
}
|
||||
#ifdef HAVE_NFS_NFSV2_H
|
||||
/* allow overriding if nfsv2 option is specified in mount options */
|
||||
if (hasmntopt(&mnt, "nfsv2")) {
|
||||
nfs_version = (u_long) 2; /* nullify any ``vers=X'' statements */
|
||||
nfs_proto = "udp"; /* nullify any ``proto=tcp'' stmts */
|
||||
plog(XLOG_WARNING, "found compatiblity option \"nfsv2\": set options vers=2, proto=udp for host %s", host);
|
||||
}
|
||||
/*#endif*/ /* MNTTAB_OPT_VERS && MNTTAB_OPT_PROTO */
|
||||
#endif /* HAVE_NFS_NFSV2_H */
|
||||
|
||||
/*
|
||||
* lookup host address and canonical name
|
||||
@ -763,7 +759,7 @@ find_nfs_srvr(mntfs *mf)
|
||||
nfs_version, nfs_proto, host);
|
||||
|
||||
/*
|
||||
* Try to find an existing fs server stucture for this host.
|
||||
* Try to find an existing fs server structure for this host.
|
||||
* Note that differing versions or protocols have their own structures.
|
||||
* XXX: Need to fix the ping mechanism to actually use the NFS protocol
|
||||
* chosen here (right now it always uses datagram sockets).
|
||||
|
@ -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 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
|
||||
* $Id: amq.c,v 1.2 1998/08/23 22:52:08 obrien 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 1.1.1.1 1998/08/23 22:07:20 obrien Exp $";
|
||||
static char rcsid[] = "$Id: amq.c,v 1.2 1998/08/23 22:52:08 obrien 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,6 +332,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
if (!progname)
|
||||
progname = "amq";
|
||||
am_set_progname(progname);
|
||||
|
||||
/*
|
||||
* Parse arguments
|
||||
@ -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 @@ get_secure_amd_client(char *host, struct timeval *tv, int *sock)
|
||||
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) {
|
||||
|
@ -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: nfs_prot_freebsd2.h,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
|
||||
* $Id: nfs_prot_freebsd2.h,v 1.2 1998/08/27 07:33:23 obrien Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -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: nfs_prot_freebsd3.h,v 1.3 1998/09/09 16:11:01 obrien Exp $
|
||||
* $Id: nfs_prot_freebsd3.h,v 1.4 1998/11/14 03:13:31 obrien Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -153,66 +153,29 @@ typedef writeargs nfswriteargs;
|
||||
|
||||
/*
|
||||
*
|
||||
* FreeBSD 3.0 pre-release has NFS V3, but you need to regenrate the rpcsc
|
||||
* header files as follows:
|
||||
* cd /usr/local/rpcsvc
|
||||
* rpcgen -DWANT_NFS3 mount.x
|
||||
* rpcgen -DWANT_NFS3 nfs_prot.x
|
||||
* But that's not expected of everyone, plus there are additional things
|
||||
* needed so I define everything that's needed for NFS V3 here.
|
||||
* The problem is fixed in FreeBSD-3.0-RELEASE hence this code is off.
|
||||
* FreeBSD-3.0-RELEASE has NFS V3. Older versions had it only defined
|
||||
* in the rpcgen source file. If you are on an older system, and you
|
||||
* want NFSv3 support, you need to regenerate the rpcsvc header files as
|
||||
* follows:
|
||||
* cd /usr/include/rpcsvc
|
||||
* rpcgen -h -C -DWANT_NFS3 mount.x
|
||||
* rpcgen -h -C -DWANT_NFS3 nfs_prot.x
|
||||
* If you don't want NFSv3, then you will have to turn off the NFSMNT_NFSV3
|
||||
* macro below. If the code doesn't compile, upgrade to the latest 3.0
|
||||
* version...
|
||||
*/
|
||||
#ifdef NFSMNT_NFSV3
|
||||
|
||||
# define MOUNT_NFS3 MOUNT_NFS
|
||||
# define MNTOPT_NFS3 "nfs"
|
||||
|
||||
#ifdef COMMENT_OUT
|
||||
#define FHSIZE3 64 /* size in bytes of a file handle (v3) */
|
||||
#define NFS3_FHSIZE 64
|
||||
#define MOUNTVERS3 ((unsigned long)(3))
|
||||
#define NFS_V3 ((unsigned long)(3))
|
||||
#endif /* COMMENT_OUT */
|
||||
|
||||
#ifdef COMMENT_OUT
|
||||
typedef struct {
|
||||
u_int fhandle3_len;
|
||||
char *fhandle3_val;
|
||||
} fhandle3;
|
||||
|
||||
enum mountstat3 {
|
||||
MNT3_OK = 0,
|
||||
MNT3ERR_PERM = 1,
|
||||
MNT3ERR_NOENT = 2,
|
||||
MNT3ERR_IO = 5,
|
||||
MNT3ERR_ACCES = 13,
|
||||
MNT3ERR_NOTDIR = 20,
|
||||
MNT3ERR_INVAL = 22,
|
||||
MNT3ERR_NAMETOOLONG = 63,
|
||||
MNT3ERR_NOTSUPP = 10004,
|
||||
MNT3ERR_SERVERFAULT = 10006
|
||||
};
|
||||
typedef enum mountstat3 mountstat3;
|
||||
|
||||
struct mountres3_ok {
|
||||
fhandle3 fhandle;
|
||||
struct {
|
||||
u_int auth_flavors_len;
|
||||
int *auth_flavors_val;
|
||||
} auth_flavors;
|
||||
};
|
||||
typedef struct mountres3_ok mountres3_ok;
|
||||
|
||||
struct mountres3 {
|
||||
mountstat3 fhs_status;
|
||||
union {
|
||||
mountres3_ok mountinfo;
|
||||
} mountres3_u;
|
||||
};
|
||||
typedef struct mountres3 mountres3;
|
||||
#endif /* COMMENT_OUT */
|
||||
|
||||
struct nfs_fh3 {
|
||||
/*
|
||||
* as of 3.0-RELEASE the nfs_fh3 that is defined in the system headers
|
||||
* (or the one generated by rpcgen) lacks the proper full definition,
|
||||
* listed below. A special macro (aux/macros/struct_nfs_fh3.m4) searches
|
||||
* for this special name before other names.
|
||||
*/
|
||||
struct nfs_fh3_freebsd3 {
|
||||
u_int fh3_length;
|
||||
union nfs_fh3_u {
|
||||
struct nfs_fh3_i {
|
||||
@ -221,7 +184,7 @@ struct nfs_fh3 {
|
||||
char data[NFS3_FHSIZE];
|
||||
} fh3_u;
|
||||
};
|
||||
typedef struct nfs_fh3 nfs_fh3;
|
||||
typedef struct nfs_fh3_freebsd3 nfs_fh3_freebsd3;
|
||||
|
||||
#endif /* NFSMNT_NFSV3 */
|
||||
|
||||
|
@ -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: fixmount.c,v 1.2 1998/08/23 22:52:08 obrien Exp $
|
||||
* $Id: fixmount.c,v 1.3 1998/11/14 03:13:31 obrien Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -87,11 +87,14 @@ void print_dump(mountlist);
|
||||
void usage(void);
|
||||
|
||||
/* 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
|
||||
|
||||
void
|
||||
usage(void)
|
||||
|
@ -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: fsinfo.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
|
||||
* $Id: fsinfo.c,v 1.2 1998/08/23 22:52:08 obrien Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -58,8 +58,8 @@
|
||||
char **g_argv;
|
||||
char *autodir = "/a";
|
||||
char *progname;
|
||||
char *username;
|
||||
char hostname[MAXHOSTNAMELEN + 1];
|
||||
char *username;
|
||||
char idvbuf[1024];
|
||||
dict *dict_of_hosts;
|
||||
dict *dict_of_volnames;
|
||||
@ -80,9 +80,12 @@ char *fstab_pref;
|
||||
char *mount_pref;
|
||||
|
||||
/* dummy variables */
|
||||
int orig_umask, foreground, debug_flags;
|
||||
#if 0
|
||||
pid_t mypid;
|
||||
serv_state amd_state;
|
||||
int foreground, orig_umask;
|
||||
int debug_flags;
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
@ -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: hlfsd.c,v 1.2 1998/08/23 22:52:08 obrien Exp $
|
||||
* $Id: hlfsd.c,v 1.3 1998/11/14 03:13:31 obrien Exp $
|
||||
*
|
||||
* HLFSD was written at Columbia University Computer Science Department, by
|
||||
* Erez Zadok <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@cs.columbia.edu>
|
||||
@ -83,18 +83,22 @@ char *alt_spooldir = ALT_SPOOLDIR;
|
||||
char *home_subdir = HOME_SUBDIR;
|
||||
char *logfile = DEFAULT_LOGFILE;
|
||||
char *passwdfile = NULL; /* alternate passwd file to use */
|
||||
#if 0
|
||||
char *progname;
|
||||
int foreground = 1; /* This is the top-level server */
|
||||
#endif
|
||||
char *slinkname = 0;
|
||||
char hostname[MAXHOSTNAMELEN + 1] = "localhost";
|
||||
int cache_interval = DEFAULT_CACHE_INTERVAL;
|
||||
int foreground = 1; /* This is the top-level server */
|
||||
gid_t hlfs_gid = (gid_t) INVALIDID;
|
||||
int masterpid = 0;
|
||||
int noverify = 0;
|
||||
int orig_umask;
|
||||
int orig_umask = 022;
|
||||
int serverpid = 0;
|
||||
nfstime startup;
|
||||
#if 0
|
||||
pid_t mypid; /* Current process id */
|
||||
#endif
|
||||
serv_state amd_state;
|
||||
u_short nfs_port;
|
||||
|
||||
@ -105,9 +109,11 @@ char *mnttab_file_name = MNTTAB_FILE_NAME;
|
||||
char *mnttab_file_name = NULL;
|
||||
#endif /* not MOUNT_TABLE_ON_FILE */
|
||||
|
||||
#if 0
|
||||
#ifdef DEBUG
|
||||
int debug_flags = 0;
|
||||
#endif /* DEBUG */
|
||||
#endif
|
||||
|
||||
/* forward declarations */
|
||||
void hlfsd_going_down(int rc);
|
||||
@ -118,7 +124,7 @@ usage(void)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Usage: %s [-Cfhnpv] [-a altdir] [-c cache-interval] [-g group]\n",
|
||||
progname);
|
||||
am_get_progname());
|
||||
fprintf(stderr, "\t[-i interval] [-l logfile] [-o mntopts] [-P passwdfile]\n");
|
||||
show_opts('x', xlog_opt);
|
||||
#ifdef DEBUG
|
||||
@ -137,6 +143,7 @@ main(int argc, char *argv[])
|
||||
char hostpid_fs[MAXHOSTNAMELEN + 1 + 16]; /* room for ":(pid###)" */
|
||||
char progpid_fs[PROGNAMESZ + 1 + 11]; /* room for ":pid" */
|
||||
char preopts[128];
|
||||
char *progname;
|
||||
int forcecache = 0;
|
||||
int forcefast = 0;
|
||||
int genflags = 0;
|
||||
@ -171,14 +178,15 @@ main(int argc, char *argv[])
|
||||
progname = argv[0];
|
||||
if ((int) strlen(progname) > PROGNAMESZ) /* truncate to reasonable size */
|
||||
progname[PROGNAMESZ] = '\0';
|
||||
am_set_progname(progname);
|
||||
|
||||
while ((opt = getopt(argc, argv, "a:c:CD:fg:hi:l:no:pP:x:v")) != EOF)
|
||||
while ((opt = getopt(argc, argv, "a:c:CD:fg:hi:l:no:pP:x:v")) != -1)
|
||||
switch (opt) {
|
||||
|
||||
case 'a':
|
||||
if (!optarg || optarg[0] != '/') {
|
||||
printf("%s: invalid directory for -a: %s\n",
|
||||
progname, optarg);
|
||||
am_get_progname(), optarg);
|
||||
exit(3);
|
||||
}
|
||||
alt_spooldir = optarg;
|
||||
@ -187,7 +195,7 @@ main(int argc, char *argv[])
|
||||
case 'c':
|
||||
if (!atoi(optarg)) {
|
||||
printf("%s: invalid interval for -c: %s\n",
|
||||
progname, optarg);
|
||||
am_get_progname(), optarg);
|
||||
exit(3);
|
||||
}
|
||||
cache_interval = atoi(optarg);
|
||||
@ -208,7 +216,7 @@ main(int argc, char *argv[])
|
||||
case 'i':
|
||||
if (!atoi(optarg)) {
|
||||
printf("%s: invalid interval for -i: %s\n",
|
||||
progname, optarg);
|
||||
am_get_progname(), optarg);
|
||||
exit(3);
|
||||
}
|
||||
reloadinterval.it_interval.tv_sec = atoi(optarg);
|
||||
@ -247,7 +255,7 @@ main(int argc, char *argv[])
|
||||
#ifdef DEBUG
|
||||
opterrs += debug_option(optarg);
|
||||
#else /* not DEBUG */
|
||||
fprintf(stderr, "%s: not compiled with DEBUG -- sorry.\n", progname);
|
||||
fprintf(stderr, "%s: not compiled with DEBUG -- sorry.\n", am_get_progname());
|
||||
#endif /* not DEBUG */
|
||||
break;
|
||||
|
||||
@ -260,7 +268,7 @@ main(int argc, char *argv[])
|
||||
if (xlog_level_init == ~0)
|
||||
switch_option("");
|
||||
/* need my pid before any dlog/plog */
|
||||
mypid = getpid();
|
||||
am_set_mypid();
|
||||
#ifdef DEBUG
|
||||
switch_option("debug");
|
||||
#endif /* DEBUG */
|
||||
@ -271,7 +279,7 @@ main(int argc, char *argv[])
|
||||
*/
|
||||
#if !defined(MNT2_NFS_OPT_ACREGMIN) && !defined(MNT2_NFS_OPT_NOAC) && !defined(HAVE_FIELD_NFS_ARGS_T_ACREGMIN)
|
||||
if (!forcecache) {
|
||||
fprintf(stderr, "%s: will not be able to turn off attribute caches.\n", progname);
|
||||
fprintf(stderr, "%s: will not be able to turn off attribute caches.\n", am_get_progname());
|
||||
exit(1);
|
||||
}
|
||||
#endif /* !defined(MNT2_NFS_OPT_ACREGMIN) && !defined(MNT2_NFS_OPT_NOAC) && !defined(HAVE_FIELD_NFS_ARGS_T_ACREGMIN) */
|
||||
@ -302,7 +310,7 @@ main(int argc, char *argv[])
|
||||
/* find gid for hlfs_group */
|
||||
if ((grp = getgrnam(hlfs_group)) == (struct group *) NULL) {
|
||||
fprintf(stderr, "%s: cannot get gid for group \"%s\".\n",
|
||||
progname, hlfs_group);
|
||||
am_get_progname(), hlfs_group);
|
||||
} else {
|
||||
hlfs_gid = grp->gr_gid;
|
||||
}
|
||||
@ -312,9 +320,9 @@ main(int argc, char *argv[])
|
||||
hostname[sizeof(hostname) - 1] = '\0';
|
||||
if ((dot = strchr(hostname, '.')) != NULL)
|
||||
*dot = '\0';
|
||||
if (logfile)
|
||||
switch_to_logfile(logfile);
|
||||
orig_umask = umask(0);
|
||||
if (logfile)
|
||||
switch_to_logfile(logfile, orig_umask);
|
||||
|
||||
#if defined(DEBUG) && !defined(MOUNT_TABLE_ON_FILE)
|
||||
if (debug_flags & D_MTAB)
|
||||
@ -339,7 +347,7 @@ main(int argc, char *argv[])
|
||||
if (slinkname)
|
||||
*--slinkname = '/';
|
||||
printf("%s: invalid mount directory/link %s\n",
|
||||
progname, dir_name);
|
||||
am_get_progname(), dir_name);
|
||||
exit(3);
|
||||
}
|
||||
|
||||
@ -354,7 +362,7 @@ main(int argc, char *argv[])
|
||||
|
||||
if ((stmodes.st_mode & 0555) != 0555) {
|
||||
fprintf(stderr, "%s: directory %s not read/executable\n",
|
||||
progname, dir_name);
|
||||
am_get_progname(), dir_name);
|
||||
plog(XLOG_WARNING, "directory %s not read/executable",
|
||||
dir_name);
|
||||
}
|
||||
@ -372,7 +380,7 @@ main(int argc, char *argv[])
|
||||
|
||||
if (direntry != NULL) {
|
||||
fprintf(stderr, "%s: %s/%s will be hidden by mount\n",
|
||||
progname, dir_name, direntry->d_name);
|
||||
am_get_progname(), dir_name, direntry->d_name);
|
||||
plog(XLOG_WARNING, "%s/%s will be hidden by mount\n",
|
||||
dir_name, direntry->d_name);
|
||||
}
|
||||
@ -381,7 +389,7 @@ main(int argc, char *argv[])
|
||||
/* make sure alternate spool dir exists */
|
||||
if ((errno = mkdirs(alt_spooldir, OPEN_SPOOLMODE))) {
|
||||
fprintf(stderr, "%s: cannot create alternate dir ",
|
||||
progname);
|
||||
am_get_progname());
|
||||
perror(alt_spooldir);
|
||||
plog(XLOG_ERROR, "cannot create alternate dir %s: %m",
|
||||
alt_spooldir);
|
||||
@ -393,7 +401,7 @@ main(int argc, char *argv[])
|
||||
if (lstat(dir_name, &stmodes) == 0 &&
|
||||
(stmodes.st_mode & S_IFMT) != S_IFLNK) {
|
||||
fprintf(stderr, "%s: failsafe %s not a symlink\n",
|
||||
progname, dir_name);
|
||||
am_get_progname(), dir_name);
|
||||
plog(XLOG_WARNING, "failsafe %s not a symlink\n",
|
||||
dir_name);
|
||||
} else {
|
||||
@ -402,7 +410,7 @@ main(int argc, char *argv[])
|
||||
if (symlink(alt_spooldir, dir_name) < 0) {
|
||||
fprintf(stderr,
|
||||
"%s: cannot create failsafe symlink %s -> ",
|
||||
progname, dir_name);
|
||||
am_get_progname(), dir_name);
|
||||
perror(alt_spooldir);
|
||||
plog(XLOG_WARNING,
|
||||
"cannot create failsafe symlink %s -> %s: %m",
|
||||
@ -517,7 +525,7 @@ main(int argc, char *argv[])
|
||||
* Update hostname field.
|
||||
* Make some name prog:pid (i.e., hlfsd:174) for hostname
|
||||
*/
|
||||
sprintf(progpid_fs, "%s:%d", progname, masterpid);
|
||||
sprintf(progpid_fs, "%s:%d", am_get_progname(), masterpid);
|
||||
|
||||
/* Most kernels have a name length restriction. */
|
||||
if ((int) strlen(progpid_fs) >= (int) MAXHOSTNAMELEN)
|
||||
@ -593,7 +601,7 @@ main(int argc, char *argv[])
|
||||
fatal("nfsmount: %m");
|
||||
} else { /* asked for -D nodaemon */
|
||||
if (fork() == 0) { /* child runs mount */
|
||||
mypid = getpid();
|
||||
am_set_mypid();
|
||||
foreground = 0;
|
||||
plog(XLOG_INFO, "child NFS mounting hlfsd service points");
|
||||
if (mount_fs(&mnt, genflags, (caddr_t) &nfs_args, retry, type, 0, NULL, mnttab_file_name) < 0) {
|
||||
@ -670,7 +678,7 @@ hlfsd_init(void)
|
||||
|
||||
if (child != 0) { /* parent process - save child pid */
|
||||
masterpid = child;
|
||||
mypid = getpid(); /* for logging routines */
|
||||
am_set_mypid(); /* for logging routines */
|
||||
return;
|
||||
}
|
||||
|
||||
@ -683,7 +691,7 @@ hlfsd_init(void)
|
||||
plt_init(); /* initialize database */
|
||||
plog(XLOG_INFO, "home directory database initialized");
|
||||
|
||||
masterpid = serverpid = mypid = getpid(); /* for logging routines */
|
||||
masterpid = serverpid = am_set_mypid(); /* for logging routines */
|
||||
|
||||
/*
|
||||
* SIGALRM/SIGHUP: reload password database if timer expired
|
||||
@ -716,7 +724,7 @@ hlfsd_init(void)
|
||||
#endif /* not HAVE_SIGACTION */
|
||||
|
||||
/*
|
||||
* SIGCHLD: interlock sycronization and testing
|
||||
* SIGCHLD: interlock synchronization and testing
|
||||
*/
|
||||
#ifdef HAVE_SIGACTION
|
||||
sa.sa_handler = interlock;
|
||||
@ -807,7 +815,7 @@ reload(int signum)
|
||||
* can be rotated)
|
||||
*/
|
||||
if (signum == SIGHUP && logfile)
|
||||
switch_to_logfile(logfile);
|
||||
switch_to_logfile(logfile, orig_umask);
|
||||
|
||||
/*
|
||||
* parent performs the reload, while the child continues to serve
|
||||
@ -815,7 +823,7 @@ reload(int signum)
|
||||
*/
|
||||
if ((child = fork()) > 0) {
|
||||
serverpid = child; /* parent runs here */
|
||||
mypid = getpid();
|
||||
am_set_mypid();
|
||||
|
||||
plt_init();
|
||||
|
||||
@ -839,7 +847,7 @@ reload(int signum)
|
||||
} else {
|
||||
/* let child handle requests while we reload */
|
||||
serverpid = getpid();
|
||||
mypid = getpid();
|
||||
am_set_mypid();
|
||||
}
|
||||
}
|
||||
|
||||
@ -863,10 +871,10 @@ cleanup(int signum)
|
||||
#endif /* DEBUG */
|
||||
if (fork() != 0) {
|
||||
masterpid = 0;
|
||||
mypid = getpid();
|
||||
am_set_mypid();
|
||||
return;
|
||||
}
|
||||
mypid = getpid();
|
||||
am_set_mypid();
|
||||
|
||||
for (;;) {
|
||||
while ((umount_result = UMOUNT_FS(dir_name, mnttab_file_name)) == EBUSY) {
|
||||
@ -878,7 +886,7 @@ cleanup(int signum)
|
||||
if (stat(dir_name, &stbuf) == 0 && stbuf.st_ino == ROOTID) {
|
||||
plog(XLOG_ERROR, "unable to unmount %s", dir_name);
|
||||
plog(XLOG_ERROR, "suspending, unmount before terminating");
|
||||
kill(mypid, SIGSTOP);
|
||||
kill(am_mypid, SIGSTOP);
|
||||
continue; /* retry unmount */
|
||||
}
|
||||
break;
|
||||
@ -914,7 +922,7 @@ reaper(int signum)
|
||||
void
|
||||
hlfsd_going_down(int rc)
|
||||
{
|
||||
int mypid = getpid();
|
||||
int mypid = getpid(); /* XXX: should this be the global am_mypid */
|
||||
|
||||
if (mypid == masterpid)
|
||||
cleanup(0);
|
||||
@ -935,17 +943,17 @@ fatal(char *mess)
|
||||
messlen = strlen(mess);
|
||||
|
||||
if (!STREQ(&mess[messlen + 1 - sizeof(ERRM)], ERRM))
|
||||
fprintf(stderr, "%s: %s\n", progname, mess);
|
||||
fprintf(stderr, "%s: %s\n", am_get_progname(), mess);
|
||||
else {
|
||||
strcpy(lessmess, mess);
|
||||
lessmess[messlen - 4] = '\0';
|
||||
|
||||
if (errno < sys_nerr)
|
||||
fprintf(stderr, "%s: %s: %s\n", progname,
|
||||
fprintf(stderr, "%s: %s: %s\n", am_get_progname(),
|
||||
lessmess, sys_errlist[errno]);
|
||||
else
|
||||
fprintf(stderr, "%s: %s: Error %d\n",
|
||||
progname, lessmess, errno);
|
||||
am_get_progname(), lessmess, errno);
|
||||
}
|
||||
}
|
||||
plog(XLOG_FATAL, mess);
|
||||
|
@ -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: homedir.c,v 1.1.1.1 1998/08/23 22:07:20 obrien Exp $
|
||||
* $Id: homedir.c,v 1.2 1998/08/23 22:52:09 obrien Exp $
|
||||
*
|
||||
* HLFSD was written at Columbia University Computer Science Department, by
|
||||
* Erez Zadok <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@cs.columbia.edu>
|
||||
@ -182,7 +182,7 @@ homedir(int userid)
|
||||
* to the parent upon SIGCHLD in interlock().
|
||||
*
|
||||
*/
|
||||
mypid = getpid(); /* for logging routines */
|
||||
am_set_mypid(); /* for logging routines */
|
||||
if (seteuid(userid) < 0) {
|
||||
plog(XLOG_WARNING, "could not seteuid to %d: %m", userid);
|
||||
return linkval;
|
||||
|
@ -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: am_defs.h,v 1.2 1998/08/27 07:33:23 obrien Exp $
|
||||
* $Id: am_defs.h,v 1.3 1998/11/14 03:13:32 obrien Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -401,6 +401,10 @@ extern int errno;
|
||||
* Actions to take if <rpcsvc/yp_prot.h> exists.
|
||||
*/
|
||||
#ifdef HAVE_RPCSVC_YP_PROT_H
|
||||
# ifdef HAVE_BAD_HEADERS
|
||||
/* avoid circular dependency in aix 4.3 with <rpcsvc/ypclnt.h> */
|
||||
struct ypall_callback;
|
||||
# endif /* HAVE_BAD_HEADERS */
|
||||
# include <rpcsvc/yp_prot.h>
|
||||
#endif /* HAVE_RPCSVC_YP_PROT_H */
|
||||
|
||||
@ -642,6 +646,10 @@ extern int errno;
|
||||
* Actions to take if <arpa/inet.h> exists.
|
||||
*/
|
||||
#ifdef HAVE_ARPA_INET_H
|
||||
# ifdef HAVE_BAD_HEADERS
|
||||
/* aix 4.3: avoid including <net/if_dl.h> */
|
||||
struct sockaddr_dl;
|
||||
# endif /* HAVE_BAD_HEADERS */
|
||||
# include <arpa/inet.h>
|
||||
#endif /* HAVE_ARPA_INET_H */
|
||||
|
||||
@ -997,7 +1005,7 @@ extern char *nc_sperror(void);
|
||||
*/
|
||||
#ifdef HAVE_TIUSER_H
|
||||
/*
|
||||
* Some systems like AIX have multiple definitions for T_NULL and othersd
|
||||
* Some systems like AIX have multiple definitions for T_NULL and others
|
||||
* that are defined first in <arpa/nameser.h>.
|
||||
*/
|
||||
# ifdef HAVE_ARPA_NAMESER_H
|
||||
@ -1058,7 +1066,7 @@ extern char *nc_sperror(void);
|
||||
#ifndef STAT_MACROS_BROKEN_notused
|
||||
/*
|
||||
* RedHat Linux 4.2 (alpha) has a problem in the headers that causes
|
||||
* dupicate definitions, and also some other nasty bugs. Upgrade to Redhat
|
||||
* duplicate definitions, and also some other nasty bugs. Upgrade to Redhat
|
||||
* 5.0!
|
||||
*/
|
||||
# ifdef HAVE_SYS_STAT_H
|
||||
@ -1242,6 +1250,10 @@ extern int getdtablesize(void);
|
||||
extern int gethostname(char *name, int namelen);
|
||||
#endif /* defined(HAVE_GETHOSTNAME) && !defined(HAVE_EXTERN_GETHOSTNAME) */
|
||||
|
||||
#ifndef HAVE_EXTERN_GETLOGIN
|
||||
extern char *getlogin(void);
|
||||
#endif /* not HAVE_EXTERN_GETLOGIN */
|
||||
|
||||
#if defined(HAVE_GETPAGESIZE) && !defined(HAVE_EXTERN_GETPAGESIZE)
|
||||
extern int getpagesize(void);
|
||||
#endif /* defined(HAVE_GETPAGESIZE) && !defined(HAVE_EXTERN_GETPAGESIZE) */
|
||||
@ -1262,6 +1274,10 @@ extern int mkstemp(char *);
|
||||
extern caddr_t sbrk(int incr);
|
||||
#endif /* not HAVE_EXTERN_SBRK */
|
||||
|
||||
#if defined(HAVE_SETEUID) && !defined(HAVE_EXTERN_SETEUID)
|
||||
extern int seteuid(uid_t euid);
|
||||
#endif /* not defined(HAVE_SETEUID) && !defined(HAVE_EXTERN_SETEUID) */
|
||||
|
||||
#ifndef HAVE_EXTERN_STRCASECMP
|
||||
/*
|
||||
* define this extern even if function does not exist, for it will
|
||||
@ -1295,12 +1311,9 @@ extern int wait3(int *statusp, int options, struct rusage *rusage);
|
||||
#endif /* defined(HAVE_WAIT3) && !defined(HAVE_EXTERN_WAIT3) */
|
||||
|
||||
#ifndef HAVE_EXTERN_XDR_OPAQUE_AUTH
|
||||
extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *);
|
||||
extern bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *auth);
|
||||
#endif /* not HAVE_EXTERN_XDR_OPAQUE_AUTH */
|
||||
|
||||
#ifndef HAVE_EXTERN_GETLOGIN
|
||||
extern char *getlogin(void);
|
||||
#endif /* not HAVE_EXTERN_GETLOGIN */
|
||||
|
||||
/****************************************************************************/
|
||||
/*
|
||||
@ -1312,13 +1325,13 @@ extern char *getlogin(void);
|
||||
#include <am_utils.h>
|
||||
#include <amq_defs.h>
|
||||
#include <aux_conf.h>
|
||||
/* compatibilty with old amd, while autoconfistating it */
|
||||
/* compatibility with old amd, while autoconfiscating it */
|
||||
#include <am_compat.h>
|
||||
|
||||
|
||||
/****************************************************************************/
|
||||
/*
|
||||
* External defintions that depend on other macros available (or not)
|
||||
* External definitions that depend on other macros available (or not)
|
||||
* and those are probably declared in any of the above headers.
|
||||
*/
|
||||
|
||||
|
@ -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: mk-amd-map.c,v 1.4 1998/08/27 07:25:25 obrien Exp $
|
||||
* $Id: mk-amd-map.c,v 1.5 1998/11/14 03:13:32 obrien Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -51,10 +51,14 @@
|
||||
#include <am_defs.h>
|
||||
|
||||
/* dummy variables */
|
||||
char hostname[MAXHOSTNAMELEN];
|
||||
int orig_umask, foreground, debug_flags;
|
||||
#if 0
|
||||
char *progname;
|
||||
pid_t mypid;
|
||||
serv_state amd_state;
|
||||
int foreground, orig_umask;
|
||||
int debug_flags;
|
||||
#endif
|
||||
char hostname[MAXHOSTNAMELEN];
|
||||
|
||||
/* (libdb version 2) uses .db extensions but an old dbm API */
|
||||
/* check for libgdbm to distinguish it from linux systems */
|
||||
|
@ -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: wire-test.c,v 1.2 1998/08/23 22:52:09 obrien Exp $
|
||||
* $Id: wire-test.c,v 1.3 1998/11/14 03:13:33 obrien Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@ -50,10 +50,16 @@
|
||||
#define STRMAX 100
|
||||
|
||||
/* dummy variables */
|
||||
char *progname, hostname[MAXHOSTNAMELEN + 1];
|
||||
int orig_umask, foreground, debug_flags;
|
||||
#if 0
|
||||
char *progname;
|
||||
pid_t mypid;
|
||||
serv_state amd_state;
|
||||
int foreground, orig_umask;
|
||||
int debug_flags;
|
||||
#endif
|
||||
|
||||
char hostname[MAXHOSTNAMELEN + 1];
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
@ -65,9 +71,11 @@ main(int argc, char **argv)
|
||||
struct sockaddr_in *ip;
|
||||
struct hostent *hp = 0;
|
||||
|
||||
progname = argv[0];
|
||||
am_set_progname(argv[0]);
|
||||
#if 0
|
||||
mypid = getpid();
|
||||
orig_umask = umask(0);
|
||||
#endif
|
||||
|
||||
if (gethostname(hostname, sizeof(hostname)) < 0) {
|
||||
perror(argv[0]);
|
||||
|
Loading…
Reference in New Issue
Block a user