mountd.c (23681) | mountd.c (24330) |
---|---|
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.13 1997/02/22 14:33:02 peter Exp $"; | 46 "$Id: mountd.c,v 1.14 1997/03/11 12:43:45 peter 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> 55#include <sys/syslog.h> 56#include <sys/ucred.h> | 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> 55#include <sys/syslog.h> 56#include <sys/ucred.h> |
57#include <sys/sysctl.h> |
|
57 58#include <rpc/rpc.h> 59#include <rpc/pmap_clnt.h> 60#include <rpc/pmap_prot.h> 61#ifdef ISO 62#include <netiso/iso.h> 63#endif 64#include <nfs/rpcv2.h> 65#include <nfs/nfsproto.h> | 58 59#include <rpc/rpc.h> 60#include <rpc/pmap_clnt.h> 61#include <rpc/pmap_prot.h> 62#ifdef ISO 63#include <netiso/iso.h> 64#endif 65#include <nfs/rpcv2.h> 66#include <nfs/nfsproto.h> |
67#include <nfs/nfs.h> |
|
66#include <ufs/ufs/ufsmount.h> 67#include <msdosfs/msdosfsmount.h> 68#include <isofs/cd9660/cd9660_mount.h> /* XXX need isofs in include */ 69 70#include <arpa/inet.h> 71 72#include <ctype.h> 73#include <errno.h> --- 176 unchanged lines hidden (view full) --- 250 int argc; 251 char **argv; 252{ 253 SVCXPRT *udptransp, *tcptransp; 254 int c; 255#ifdef __FreeBSD__ 256 struct vfsconf vfc; 257 int error; | 68#include <ufs/ufs/ufsmount.h> 69#include <msdosfs/msdosfsmount.h> 70#include <isofs/cd9660/cd9660_mount.h> /* XXX need isofs in include */ 71 72#include <arpa/inet.h> 73 74#include <ctype.h> 75#include <errno.h> --- 176 unchanged lines hidden (view full) --- 252 int argc; 253 char **argv; 254{ 255 SVCXPRT *udptransp, *tcptransp; 256 int c; 257#ifdef __FreeBSD__ 258 struct vfsconf vfc; 259 int error; |
260 int mib[3]; |
|
258 259 error = getvfsbyname("nfs", &vfc); 260 if (error && vfsisloadable("nfs")) { 261 if(vfsload("nfs")) 262 err(1, "vfsload(nfs)"); 263 endvfsent(); /* flush cache */ 264 error = getvfsbyname("nfs", &vfc); 265 } --- 43 unchanged lines hidden (view full) --- 309 signal(SIGHUP, (void (*) __P((int))) get_exportlist); 310 signal(SIGTERM, (void (*) __P((int))) send_umntall); 311 { FILE *pidfile = fopen(_PATH_MOUNTDPID, "w"); 312 if (pidfile != NULL) { 313 fprintf(pidfile, "%d\n", getpid()); 314 fclose(pidfile); 315 } 316 } | 261 262 error = getvfsbyname("nfs", &vfc); 263 if (error && vfsisloadable("nfs")) { 264 if(vfsload("nfs")) 265 err(1, "vfsload(nfs)"); 266 endvfsent(); /* flush cache */ 267 error = getvfsbyname("nfs", &vfc); 268 } --- 43 unchanged lines hidden (view full) --- 312 signal(SIGHUP, (void (*) __P((int))) get_exportlist); 313 signal(SIGTERM, (void (*) __P((int))) send_umntall); 314 { FILE *pidfile = fopen(_PATH_MOUNTDPID, "w"); 315 if (pidfile != NULL) { 316 fprintf(pidfile, "%d\n", getpid()); 317 fclose(pidfile); 318 } 319 } |
320 321 mib[0] = CTL_VFS; 322 mib[1] = MOUNT_NFS; 323 mib[2] = NFS_NFSPRIVPORT; 324 if (sysctl(mib, 3, NULL, NULL, 325 &resvport_only, sizeof(resvport_only)) != 0) { 326 syslog(LOG_ERR, "sysctl: %m"); 327 exit(1); 328 } 329 |
|
317 if ((udptransp = svcudp_create(RPC_ANYSOCK)) == NULL || 318 (tcptransp = svctcp_create(RPC_ANYSOCK, 0, 0)) == NULL) { 319 syslog(LOG_ERR, "Can't create socket"); 320 exit(1); 321 } 322 pmap_unset(RPCPROG_MNT, 1); 323 pmap_unset(RPCPROG_MNT, 3); 324 if (!svc_register(udptransp, RPCPROG_MNT, 1, mntsrv, IPPROTO_UDP) || --- 1786 unchanged lines hidden --- | 330 if ((udptransp = svcudp_create(RPC_ANYSOCK)) == NULL || 331 (tcptransp = svctcp_create(RPC_ANYSOCK, 0, 0)) == NULL) { 332 syslog(LOG_ERR, "Can't create socket"); 333 exit(1); 334 } 335 pmap_unset(RPCPROG_MNT, 1); 336 pmap_unset(RPCPROG_MNT, 3); 337 if (!svc_register(udptransp, RPCPROG_MNT, 1, mntsrv, IPPROTO_UDP) || --- 1786 unchanged lines hidden --- |