mountd.c (24759) | mountd.c (25087) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Herb Hasler and Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 29 unchanged lines hidden (view full) --- 38static char copyright[] = 39"@(#) Copyright (c) 1989, 1993\n\ 40 The Regents of the University of California. All rights reserved.\n"; 41#endif /*not lint*/ 42 43#ifndef lint 44/*static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95"; */ 45static const char rcsid[] = | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Herb Hasler and Rick Macklem at The University of Guelph. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 29 unchanged lines hidden (view full) --- 38static char copyright[] = 39"@(#) Copyright (c) 1989, 1993\n\ 40 The Regents of the University of California. All rights reserved.\n"; 41#endif /*not lint*/ 42 43#ifndef lint 44/*static char sccsid[] = "@(#)mountd.c 8.15 (Berkeley) 5/1/95"; */ 45static const char rcsid[] = |
46 "$Id: mountd.c,v 1.17 1997/04/01 14:15:30 bde Exp $"; | 46 "$Id: mountd.c,v 1.18 1997/04/09 20:17:15 guido Exp $"; |
47#endif /*not lint*/ 48 49#include <sys/param.h> 50#include <sys/file.h> 51#include <sys/ioctl.h> 52#include <sys/mount.h> 53#include <sys/socket.h> 54#include <sys/stat.h> --- 160 unchanged lines hidden (view full) --- 215struct grouplist *grphead; 216char exname[MAXPATHLEN]; 217struct ucred def_anon = { 218 1, 219 (uid_t) -2, 220 1, 221 { (gid_t) -2 } 222}; | 47#endif /*not lint*/ 48 49#include <sys/param.h> 50#include <sys/file.h> 51#include <sys/ioctl.h> 52#include <sys/mount.h> 53#include <sys/socket.h> 54#include <sys/stat.h> --- 160 unchanged lines hidden (view full) --- 215struct grouplist *grphead; 216char exname[MAXPATHLEN]; 217struct ucred def_anon = { 218 1, 219 (uid_t) -2, 220 1, 221 { (gid_t) -2 } 222}; |
223int force_v2 = 0; |
|
223int resvport_only = 1; 224int dir_only = 1; 225int opt_flags; 226/* Bits for above */ 227#define OP_MAPROOT 0x01 228#define OP_MAPALL 0x02 229#define OP_KERB 0x04 230#define OP_MASK 0x08 --- 34 unchanged lines hidden (view full) --- 265 err(1, "vfsload(nfs)"); 266 endvfsent(); /* flush cache */ 267 error = getvfsbyname("nfs", &vfc); 268 } 269 if (error) 270 errx(1, "NFS support is not available in the running kernel"); 271#endif /* __FreeBSD__ */ 272 | 224int resvport_only = 1; 225int dir_only = 1; 226int opt_flags; 227/* Bits for above */ 228#define OP_MAPROOT 0x01 229#define OP_MAPALL 0x02 230#define OP_KERB 0x04 231#define OP_MASK 0x08 --- 34 unchanged lines hidden (view full) --- 266 err(1, "vfsload(nfs)"); 267 endvfsent(); /* flush cache */ 268 error = getvfsbyname("nfs", &vfc); 269 } 270 if (error) 271 errx(1, "NFS support is not available in the running kernel"); 272#endif /* __FreeBSD__ */ 273 |
273 while ((c = getopt(argc, argv, "dnr")) != -1) | 274 while ((c = getopt(argc, argv, "2dnr")) != -1) |
274 switch (c) { | 275 switch (c) { |
276 case '2': 277 force_v2 = 1; 278 break; |
|
275 case 'n': 276 resvport_only = 0; 277 break; 278 case 'r': 279 dir_only = 0; 280 break; 281 case 'd': 282 debug = debug ? 0 : 1; --- 48 unchanged lines hidden (view full) --- 331 332 if ((udptransp = svcudp_create(RPC_ANYSOCK)) == NULL || 333 (tcptransp = svctcp_create(RPC_ANYSOCK, 0, 0)) == NULL) { 334 syslog(LOG_ERR, "Can't create socket"); 335 exit(1); 336 } 337 pmap_unset(RPCPROG_MNT, 1); 338 pmap_unset(RPCPROG_MNT, 3); | 279 case 'n': 280 resvport_only = 0; 281 break; 282 case 'r': 283 dir_only = 0; 284 break; 285 case 'd': 286 debug = debug ? 0 : 1; --- 48 unchanged lines hidden (view full) --- 335 336 if ((udptransp = svcudp_create(RPC_ANYSOCK)) == NULL || 337 (tcptransp = svctcp_create(RPC_ANYSOCK, 0, 0)) == NULL) { 338 syslog(LOG_ERR, "Can't create socket"); 339 exit(1); 340 } 341 pmap_unset(RPCPROG_MNT, 1); 342 pmap_unset(RPCPROG_MNT, 3); |
343 if (!force_v2) 344 if (!svc_register(udptransp, RPCPROG_MNT, 3, mntsrv, IPPROTO_UDP) || 345 !svc_register(tcptransp, RPCPROG_MNT, 3, mntsrv, IPPROTO_TCP)) { 346 syslog(LOG_ERR, "Can't register mount"); 347 exit(1); 348 } |
|
339 if (!svc_register(udptransp, RPCPROG_MNT, 1, mntsrv, IPPROTO_UDP) || | 349 if (!svc_register(udptransp, RPCPROG_MNT, 1, mntsrv, IPPROTO_UDP) || |
340 !svc_register(udptransp, RPCPROG_MNT, 3, mntsrv, IPPROTO_UDP) || 341 !svc_register(tcptransp, RPCPROG_MNT, 1, mntsrv, IPPROTO_TCP) || 342 !svc_register(tcptransp, RPCPROG_MNT, 3, mntsrv, IPPROTO_TCP)) { | 350 !svc_register(tcptransp, RPCPROG_MNT, 1, mntsrv, IPPROTO_TCP)) { |
343 syslog(LOG_ERR, "Can't register mount"); 344 exit(1); 345 } 346 svc_run(); 347 syslog(LOG_ERR, "Mountd died"); 348 exit(1); 349} 350 --- 1775 unchanged lines hidden --- | 351 syslog(LOG_ERR, "Can't register mount"); 352 exit(1); 353 } 354 svc_run(); 355 syslog(LOG_ERR, "Mountd died"); 356 exit(1); 357} 358 --- 1775 unchanged lines hidden --- |