yppasswdd_main.c (90297) | yppasswdd_main.c (90298) |
---|---|
1/* 2 * Copyright (c) 1995, 1996 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#ifndef lint 34static const char rcsid[] = | 1/* 2 * Copyright (c) 1995, 1996 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 */ 32 33#ifndef lint 34static const char rcsid[] = |
35 "$FreeBSD: head/usr.sbin/rpc.yppasswdd/yppasswdd_main.c 90297 2002-02-06 13:30:31Z des $"; | 35 "$FreeBSD: head/usr.sbin/rpc.yppasswdd/yppasswdd_main.c 90298 2002-02-06 15:26:07Z des $"; |
36#endif /* not lint */ 37 38#include "yppasswd.h" 39#include <stdio.h> 40#include <sys/types.h> 41#include <stdlib.h> /* getenv, exit */ 42#include <unistd.h> 43#include <string.h> --- 48 unchanged lines hidden (view full) --- 92int no_chfn = 0; 93int allow_additions = 0; 94int multidomain = 0; 95int verbose = 0; 96int resvport = 1; 97int inplace = 0; 98char *sockname = YP_SOCKNAME; 99 | 36#endif /* not lint */ 37 38#include "yppasswd.h" 39#include <stdio.h> 40#include <sys/types.h> 41#include <stdlib.h> /* getenv, exit */ 42#include <unistd.h> 43#include <string.h> --- 48 unchanged lines hidden (view full) --- 92int no_chfn = 0; 93int allow_additions = 0; 94int multidomain = 0; 95int verbose = 0; 96int resvport = 1; 97int inplace = 0; 98char *sockname = YP_SOCKNAME; 99 |
100static void terminate(sig) 101 int sig; | 100static void 101terminate(int sig) |
102{ 103 rpcb_unset(YPPASSWDPROG, YPPASSWDVERS, NULL); 104 rpcb_unset(MASTER_YPPASSWDPROG, MASTER_YPPASSWDVERS, NULL); 105 unlink(sockname); 106 exit(0); 107} 108 | 102{ 103 rpcb_unset(YPPASSWDPROG, YPPASSWDVERS, NULL); 104 rpcb_unset(MASTER_YPPASSWDPROG, MASTER_YPPASSWDVERS, NULL); 105 unlink(sockname); 106 exit(0); 107} 108 |
109static void reload(sig) 110 int sig; | 109static void 110reload(int sig) |
111{ 112 load_securenets(); 113} 114 115static void 116closedown(int sig) 117{ 118 if (_rpcsvcstate == _IDLE) { --- 18 unchanged lines hidden (view full) --- 137 } 138 if (_rpcsvcstate == _SERVED) 139 _rpcsvcstate = _IDLE; 140 141 (void) signal(SIGALRM, (SIG_PF) closedown); 142 (void) alarm(_RPCSVC_CLOSEDOWN/2); 143} 144 | 111{ 112 load_securenets(); 113} 114 115static void 116closedown(int sig) 117{ 118 if (_rpcsvcstate == _IDLE) { --- 18 unchanged lines hidden (view full) --- 137 } 138 if (_rpcsvcstate == _SERVED) 139 _rpcsvcstate = _IDLE; 140 141 (void) signal(SIGALRM, (SIG_PF) closedown); 142 (void) alarm(_RPCSVC_CLOSEDOWN/2); 143} 144 |
145static void usage() | 145static void 146usage(void) |
146{ 147 fprintf(stderr, "%s\n%s\n", 148"usage: rpc.yppasswdd [-t master.passwd file] [-d domain] [-p path] [-s]", 149" [-f] [-m] [-i] [-a] [-v] [-u] [-h]"); 150 exit(1); 151} 152 153int | 147{ 148 fprintf(stderr, "%s\n%s\n", 149"usage: rpc.yppasswdd [-t master.passwd file] [-d domain] [-p path] [-s]", 150" [-f] [-m] [-i] [-a] [-v] [-u] [-h]"); 151 exit(1); 152} 153 154int |
154main(argc, argv) 155 int argc; 156 char *argv[]; | 155main(int argc, char *argv[]) |
157{ 158 register SVCXPRT *transp = NULL; 159 struct sockaddr_in saddr; 160 int asize = sizeof (saddr); 161 struct netconfig *nconf; 162 void *localhandle; 163 int ch; 164 char *mastername; --- 164 unchanged lines hidden --- | 156{ 157 register SVCXPRT *transp = NULL; 158 struct sockaddr_in saddr; 159 int asize = sizeof (saddr); 160 struct netconfig *nconf; 161 void *localhandle; 162 int ch; 163 char *mastername; --- 164 unchanged lines hidden --- |