Staticize some stuff in mountd(8); no functional changes.
MFC after: 1 month Sponsored by: The FreeBSD Foundation
This commit is contained in:
+119
-117
@@ -165,97 +165,98 @@ struct fhreturn {
|
|||||||
#define GETPORT_MAXTRY 20 /* Max tries to get a port # */
|
#define GETPORT_MAXTRY 20 /* Max tries to get a port # */
|
||||||
|
|
||||||
/* Global defs */
|
/* Global defs */
|
||||||
char *add_expdir(struct dirlist **, char *, int);
|
static char *add_expdir(struct dirlist **, char *, int);
|
||||||
void add_dlist(struct dirlist **, struct dirlist *,
|
static void add_dlist(struct dirlist **, struct dirlist *,
|
||||||
struct grouplist *, int, struct exportlist *);
|
struct grouplist *, int, struct exportlist *);
|
||||||
void add_mlist(char *, char *);
|
static void add_mlist(char *, char *);
|
||||||
int check_dirpath(char *);
|
static int check_dirpath(char *);
|
||||||
int check_options(struct dirlist *);
|
static int check_options(struct dirlist *);
|
||||||
int checkmask(struct sockaddr *sa);
|
static int checkmask(struct sockaddr *sa);
|
||||||
int chk_host(struct dirlist *, struct sockaddr *, int *, int *, int *,
|
static int chk_host(struct dirlist *, struct sockaddr *, int *, int *,
|
||||||
int **);
|
int *, int **);
|
||||||
static int create_service(struct netconfig *nconf);
|
static int create_service(struct netconfig *nconf);
|
||||||
static void complete_service(struct netconfig *nconf, char *port_str);
|
static void complete_service(struct netconfig *nconf, char *port_str);
|
||||||
static void clearout_service(void);
|
static void clearout_service(void);
|
||||||
void del_mlist(char *hostp, char *dirp);
|
static void del_mlist(char *hostp, char *dirp);
|
||||||
struct dirlist *dirp_search(struct dirlist *, char *);
|
static struct dirlist *dirp_search(struct dirlist *, char *);
|
||||||
int do_mount(struct exportlist *, struct grouplist *, int,
|
static int do_mount(struct exportlist *, struct grouplist *, int,
|
||||||
struct xucred *, char *, int, struct statfs *);
|
struct xucred *, char *, int, struct statfs *);
|
||||||
int do_opt(char **, char **, struct exportlist *, struct grouplist *,
|
static int do_opt(char **, char **, struct exportlist *,
|
||||||
int *, int *, struct xucred *);
|
struct grouplist *, int *, int *, struct xucred *);
|
||||||
struct exportlist *ex_search(fsid_t *);
|
static struct exportlist *ex_search(fsid_t *);
|
||||||
struct exportlist *get_exp(void);
|
static struct exportlist *get_exp(void);
|
||||||
void free_dir(struct dirlist *);
|
static void free_dir(struct dirlist *);
|
||||||
void free_exp(struct exportlist *);
|
static void free_exp(struct exportlist *);
|
||||||
void free_grp(struct grouplist *);
|
static void free_grp(struct grouplist *);
|
||||||
void free_host(struct hostlist *);
|
static void free_host(struct hostlist *);
|
||||||
void get_exportlist(void);
|
static void get_exportlist(void);
|
||||||
int get_host(char *, struct grouplist *, struct grouplist *);
|
static int get_host(char *, struct grouplist *, struct grouplist *);
|
||||||
struct hostlist *get_ht(void);
|
static struct hostlist *get_ht(void);
|
||||||
int get_line(void);
|
static int get_line(void);
|
||||||
void get_mountlist(void);
|
static void get_mountlist(void);
|
||||||
int get_net(char *, struct netmsk *, int);
|
static int get_net(char *, struct netmsk *, int);
|
||||||
void getexp_err(struct exportlist *, struct grouplist *);
|
static void getexp_err(struct exportlist *, struct grouplist *);
|
||||||
struct grouplist *get_grp(void);
|
static struct grouplist *get_grp(void);
|
||||||
void hang_dirp(struct dirlist *, struct grouplist *,
|
static void hang_dirp(struct dirlist *, struct grouplist *,
|
||||||
struct exportlist *, int);
|
struct exportlist *, int);
|
||||||
void huphandler(int sig);
|
static void huphandler(int sig);
|
||||||
int makemask(struct sockaddr_storage *ssp, int bitlen);
|
static int makemask(struct sockaddr_storage *ssp, int bitlen);
|
||||||
void mntsrv(struct svc_req *, SVCXPRT *);
|
static void mntsrv(struct svc_req *, SVCXPRT *);
|
||||||
void nextfield(char **, char **);
|
static void nextfield(char **, char **);
|
||||||
void out_of_mem(void);
|
static void out_of_mem(void);
|
||||||
void parsecred(char *, struct xucred *);
|
static void parsecred(char *, struct xucred *);
|
||||||
int parsesec(char *, struct exportlist *);
|
static int parsesec(char *, struct exportlist *);
|
||||||
int put_exlist(struct dirlist *, XDR *, struct dirlist *, int *, int);
|
static int put_exlist(struct dirlist *, XDR *, struct dirlist *,
|
||||||
void *sa_rawaddr(struct sockaddr *sa, int *nbytes);
|
int *, int);
|
||||||
int sacmp(struct sockaddr *sa1, struct sockaddr *sa2,
|
static void *sa_rawaddr(struct sockaddr *sa, int *nbytes);
|
||||||
|
static int sacmp(struct sockaddr *sa1, struct sockaddr *sa2,
|
||||||
struct sockaddr *samask);
|
struct sockaddr *samask);
|
||||||
int scan_tree(struct dirlist *, struct sockaddr *);
|
static int scan_tree(struct dirlist *, struct sockaddr *);
|
||||||
static void usage(void);
|
static void usage(void);
|
||||||
int xdr_dir(XDR *, char *);
|
static int xdr_dir(XDR *, char *);
|
||||||
int xdr_explist(XDR *, caddr_t);
|
static int xdr_explist(XDR *, caddr_t);
|
||||||
int xdr_explist_brief(XDR *, caddr_t);
|
static int xdr_explist_brief(XDR *, caddr_t);
|
||||||
int xdr_explist_common(XDR *, caddr_t, int);
|
static int xdr_explist_common(XDR *, caddr_t, int);
|
||||||
int xdr_fhs(XDR *, caddr_t);
|
static int xdr_fhs(XDR *, caddr_t);
|
||||||
int xdr_mlist(XDR *, caddr_t);
|
static int xdr_mlist(XDR *, caddr_t);
|
||||||
void terminate(int);
|
static void terminate(int);
|
||||||
|
|
||||||
struct exportlist *exphead;
|
static struct exportlist *exphead;
|
||||||
struct mountlist *mlhead;
|
static struct mountlist *mlhead;
|
||||||
struct grouplist *grphead;
|
static struct grouplist *grphead;
|
||||||
char *exnames_default[2] = { _PATH_EXPORTS, NULL };
|
static char *exnames_default[2] = { _PATH_EXPORTS, NULL };
|
||||||
char **exnames;
|
static char **exnames;
|
||||||
char **hosts = NULL;
|
static char **hosts = NULL;
|
||||||
struct xucred def_anon = {
|
static struct xucred def_anon = {
|
||||||
XUCRED_VERSION,
|
XUCRED_VERSION,
|
||||||
(uid_t)-2,
|
(uid_t)-2,
|
||||||
1,
|
1,
|
||||||
{ (gid_t)-2 },
|
{ (gid_t)-2 },
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
int force_v2 = 0;
|
static int force_v2 = 0;
|
||||||
int resvport_only = 1;
|
static int resvport_only = 1;
|
||||||
int nhosts = 0;
|
static int nhosts = 0;
|
||||||
int dir_only = 1;
|
static int dir_only = 1;
|
||||||
int dolog = 0;
|
static int dolog = 0;
|
||||||
int got_sighup = 0;
|
static int got_sighup = 0;
|
||||||
int xcreated = 0;
|
static int xcreated = 0;
|
||||||
|
|
||||||
char *svcport_str = NULL;
|
static char *svcport_str = NULL;
|
||||||
static int mallocd_svcport = 0;
|
static int mallocd_svcport = 0;
|
||||||
static int *sock_fd;
|
static int *sock_fd;
|
||||||
static int sock_fdcnt;
|
static int sock_fdcnt;
|
||||||
static int sock_fdpos;
|
static int sock_fdpos;
|
||||||
static int suspend_nfsd = 0;
|
static int suspend_nfsd = 0;
|
||||||
|
|
||||||
int opt_flags;
|
static int opt_flags;
|
||||||
static int have_v6 = 1;
|
static int have_v6 = 1;
|
||||||
|
|
||||||
int v4root_phase = 0;
|
static int v4root_phase = 0;
|
||||||
char v4root_dirpath[PATH_MAX + 1];
|
static char v4root_dirpath[PATH_MAX + 1];
|
||||||
int has_publicfh = 0;
|
static int has_publicfh = 0;
|
||||||
|
|
||||||
struct pidfh *pfh = NULL;
|
static struct pidfh *pfh = NULL;
|
||||||
/* Bits for opt_flags above */
|
/* Bits for opt_flags above */
|
||||||
#define OP_MAPROOT 0x01
|
#define OP_MAPROOT 0x01
|
||||||
#define OP_MAPALL 0x02
|
#define OP_MAPALL 0x02
|
||||||
@@ -269,11 +270,11 @@ struct pidfh *pfh = NULL;
|
|||||||
#define OP_SEC 0x400
|
#define OP_SEC 0x400
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
int debug = 1;
|
static int debug = 1;
|
||||||
void SYSLOG(int, const char *, ...) __printflike(2, 3);
|
static void SYSLOG(int, const char *, ...) __printflike(2, 3);
|
||||||
#define syslog SYSLOG
|
#define syslog SYSLOG
|
||||||
#else
|
#else
|
||||||
int debug = 0;
|
static int debug = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1131,7 +1132,7 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp)
|
|||||||
/*
|
/*
|
||||||
* Xdr conversion for a dirpath string
|
* Xdr conversion for a dirpath string
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
xdr_dir(XDR *xdrsp, char *dirp)
|
xdr_dir(XDR *xdrsp, char *dirp)
|
||||||
{
|
{
|
||||||
return (xdr_string(xdrsp, &dirp, MNTPATHLEN));
|
return (xdr_string(xdrsp, &dirp, MNTPATHLEN));
|
||||||
@@ -1140,7 +1141,7 @@ xdr_dir(XDR *xdrsp, char *dirp)
|
|||||||
/*
|
/*
|
||||||
* Xdr routine to generate file handle reply
|
* Xdr routine to generate file handle reply
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
xdr_fhs(XDR *xdrsp, caddr_t cp)
|
xdr_fhs(XDR *xdrsp, caddr_t cp)
|
||||||
{
|
{
|
||||||
struct fhreturn *fhrp = (struct fhreturn *)cp;
|
struct fhreturn *fhrp = (struct fhreturn *)cp;
|
||||||
@@ -1176,7 +1177,7 @@ xdr_fhs(XDR *xdrsp, caddr_t cp)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
xdr_mlist(XDR *xdrsp, caddr_t cp __unused)
|
xdr_mlist(XDR *xdrsp, caddr_t cp __unused)
|
||||||
{
|
{
|
||||||
struct mountlist *mlp;
|
struct mountlist *mlp;
|
||||||
@@ -1204,7 +1205,7 @@ xdr_mlist(XDR *xdrsp, caddr_t cp __unused)
|
|||||||
/*
|
/*
|
||||||
* Xdr conversion for export list
|
* Xdr conversion for export list
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
xdr_explist_common(XDR *xdrsp, caddr_t cp __unused, int brief)
|
xdr_explist_common(XDR *xdrsp, caddr_t cp __unused, int brief)
|
||||||
{
|
{
|
||||||
struct exportlist *ep;
|
struct exportlist *ep;
|
||||||
@@ -1240,7 +1241,7 @@ xdr_explist_common(XDR *xdrsp, caddr_t cp __unused, int brief)
|
|||||||
* Called from xdr_explist() to traverse the tree and export the
|
* Called from xdr_explist() to traverse the tree and export the
|
||||||
* directory paths.
|
* directory paths.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
put_exlist(struct dirlist *dp, XDR *xdrsp, struct dirlist *adp, int *putdefp,
|
put_exlist(struct dirlist *dp, XDR *xdrsp, struct dirlist *adp, int *putdefp,
|
||||||
int brief)
|
int brief)
|
||||||
{
|
{
|
||||||
@@ -1304,23 +1305,23 @@ put_exlist(struct dirlist *dp, XDR *xdrsp, struct dirlist *adp, int *putdefp,
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
xdr_explist(XDR *xdrsp, caddr_t cp)
|
xdr_explist(XDR *xdrsp, caddr_t cp)
|
||||||
{
|
{
|
||||||
|
|
||||||
return xdr_explist_common(xdrsp, cp, 0);
|
return xdr_explist_common(xdrsp, cp, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
xdr_explist_brief(XDR *xdrsp, caddr_t cp)
|
xdr_explist_brief(XDR *xdrsp, caddr_t cp)
|
||||||
{
|
{
|
||||||
|
|
||||||
return xdr_explist_common(xdrsp, cp, 1);
|
return xdr_explist_common(xdrsp, cp, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *line;
|
static char *line;
|
||||||
int linesize;
|
static size_t linesize;
|
||||||
FILE *exp_file;
|
static FILE *exp_file;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get the export list from one, currently open file
|
* Get the export list from one, currently open file
|
||||||
@@ -1638,7 +1639,7 @@ get_exportlist_one(void)
|
|||||||
/*
|
/*
|
||||||
* Get the export list from all specified files
|
* Get the export list from all specified files
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
get_exportlist(void)
|
get_exportlist(void)
|
||||||
{
|
{
|
||||||
struct exportlist *ep, *ep2;
|
struct exportlist *ep, *ep2;
|
||||||
@@ -1801,7 +1802,7 @@ get_exportlist(void)
|
|||||||
/*
|
/*
|
||||||
* Allocate an export list element
|
* Allocate an export list element
|
||||||
*/
|
*/
|
||||||
struct exportlist *
|
static struct exportlist *
|
||||||
get_exp(void)
|
get_exp(void)
|
||||||
{
|
{
|
||||||
struct exportlist *ep;
|
struct exportlist *ep;
|
||||||
@@ -1815,7 +1816,7 @@ get_exp(void)
|
|||||||
/*
|
/*
|
||||||
* Allocate a group list element
|
* Allocate a group list element
|
||||||
*/
|
*/
|
||||||
struct grouplist *
|
static struct grouplist *
|
||||||
get_grp(void)
|
get_grp(void)
|
||||||
{
|
{
|
||||||
struct grouplist *gp;
|
struct grouplist *gp;
|
||||||
@@ -1829,7 +1830,7 @@ get_grp(void)
|
|||||||
/*
|
/*
|
||||||
* Clean up upon an error in get_exportlist().
|
* Clean up upon an error in get_exportlist().
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
getexp_err(struct exportlist *ep, struct grouplist *grp)
|
getexp_err(struct exportlist *ep, struct grouplist *grp)
|
||||||
{
|
{
|
||||||
struct grouplist *tgrp;
|
struct grouplist *tgrp;
|
||||||
@@ -1848,7 +1849,7 @@ getexp_err(struct exportlist *ep, struct grouplist *grp)
|
|||||||
/*
|
/*
|
||||||
* Search the export list for a matching fs.
|
* Search the export list for a matching fs.
|
||||||
*/
|
*/
|
||||||
struct exportlist *
|
static struct exportlist *
|
||||||
ex_search(fsid_t *fsid)
|
ex_search(fsid_t *fsid)
|
||||||
{
|
{
|
||||||
struct exportlist *ep;
|
struct exportlist *ep;
|
||||||
@@ -1866,7 +1867,7 @@ ex_search(fsid_t *fsid)
|
|||||||
/*
|
/*
|
||||||
* Add a directory path to the list.
|
* Add a directory path to the list.
|
||||||
*/
|
*/
|
||||||
char *
|
static char *
|
||||||
add_expdir(struct dirlist **dpp, char *cp, int len)
|
add_expdir(struct dirlist **dpp, char *cp, int len)
|
||||||
{
|
{
|
||||||
struct dirlist *dp;
|
struct dirlist *dp;
|
||||||
@@ -1887,7 +1888,7 @@ add_expdir(struct dirlist **dpp, char *cp, int len)
|
|||||||
* Hang the dir list element off the dirpath binary tree as required
|
* Hang the dir list element off the dirpath binary tree as required
|
||||||
* and update the entry for host.
|
* and update the entry for host.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
hang_dirp(struct dirlist *dp, struct grouplist *grp, struct exportlist *ep,
|
hang_dirp(struct dirlist *dp, struct grouplist *grp, struct exportlist *ep,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
@@ -1935,7 +1936,7 @@ hang_dirp(struct dirlist *dp, struct grouplist *grp, struct exportlist *ep,
|
|||||||
* Traverse the binary tree either updating a node that is already there
|
* Traverse the binary tree either updating a node that is already there
|
||||||
* for the new directory or adding the new node.
|
* for the new directory or adding the new node.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
add_dlist(struct dirlist **dpp, struct dirlist *newdp, struct grouplist *grp,
|
add_dlist(struct dirlist **dpp, struct dirlist *newdp, struct grouplist *grp,
|
||||||
int flags, struct exportlist *ep)
|
int flags, struct exportlist *ep)
|
||||||
{
|
{
|
||||||
@@ -1989,7 +1990,7 @@ add_dlist(struct dirlist **dpp, struct dirlist *newdp, struct grouplist *grp,
|
|||||||
/*
|
/*
|
||||||
* Search for a dirpath on the export point.
|
* Search for a dirpath on the export point.
|
||||||
*/
|
*/
|
||||||
struct dirlist *
|
static struct dirlist *
|
||||||
dirp_search(struct dirlist *dp, char *dirp)
|
dirp_search(struct dirlist *dp, char *dirp)
|
||||||
{
|
{
|
||||||
int cmp;
|
int cmp;
|
||||||
@@ -2009,7 +2010,7 @@ dirp_search(struct dirlist *dp, char *dirp)
|
|||||||
/*
|
/*
|
||||||
* Scan for a host match in a directory tree.
|
* Scan for a host match in a directory tree.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
chk_host(struct dirlist *dp, struct sockaddr *saddr, int *defsetp,
|
chk_host(struct dirlist *dp, struct sockaddr *saddr, int *defsetp,
|
||||||
int *hostsetp, int *numsecflavors, int **secflavorsp)
|
int *hostsetp, int *numsecflavors, int **secflavorsp)
|
||||||
{
|
{
|
||||||
@@ -2065,7 +2066,7 @@ chk_host(struct dirlist *dp, struct sockaddr *saddr, int *defsetp,
|
|||||||
/*
|
/*
|
||||||
* Scan tree for a host that matches the address.
|
* Scan tree for a host that matches the address.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
scan_tree(struct dirlist *dp, struct sockaddr *saddr)
|
scan_tree(struct dirlist *dp, struct sockaddr *saddr)
|
||||||
{
|
{
|
||||||
int defset, hostset;
|
int defset, hostset;
|
||||||
@@ -2084,7 +2085,7 @@ scan_tree(struct dirlist *dp, struct sockaddr *saddr)
|
|||||||
/*
|
/*
|
||||||
* Traverse the dirlist tree and free it up.
|
* Traverse the dirlist tree and free it up.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
free_dir(struct dirlist *dp)
|
free_dir(struct dirlist *dp)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -2099,7 +2100,7 @@ free_dir(struct dirlist *dp)
|
|||||||
/*
|
/*
|
||||||
* Parse a colon separated list of security flavors
|
* Parse a colon separated list of security flavors
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
parsesec(char *seclist, struct exportlist *ep)
|
parsesec(char *seclist, struct exportlist *ep)
|
||||||
{
|
{
|
||||||
char *cp, savedc;
|
char *cp, savedc;
|
||||||
@@ -2150,7 +2151,7 @@ parsesec(char *seclist, struct exportlist *ep)
|
|||||||
* Option arguments may either be -<option>=<value> or
|
* Option arguments may either be -<option>=<value> or
|
||||||
* -<option> <value>
|
* -<option> <value>
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
do_opt(char **cpp, char **endcpp, struct exportlist *ep, struct grouplist *grp,
|
do_opt(char **cpp, char **endcpp, struct exportlist *ep, struct grouplist *grp,
|
||||||
int *has_hostp, int *exflagsp, struct xucred *cr)
|
int *has_hostp, int *exflagsp, struct xucred *cr)
|
||||||
{
|
{
|
||||||
@@ -2263,7 +2264,7 @@ do_opt(char **cpp, char **endcpp, struct exportlist *ep, struct grouplist *grp,
|
|||||||
* Translate a character string to the corresponding list of network
|
* Translate a character string to the corresponding list of network
|
||||||
* addresses for a hostname.
|
* addresses for a hostname.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
get_host(char *cp, struct grouplist *grp, struct grouplist *tgrp)
|
get_host(char *cp, struct grouplist *grp, struct grouplist *tgrp)
|
||||||
{
|
{
|
||||||
struct grouplist *checkgrp;
|
struct grouplist *checkgrp;
|
||||||
@@ -2323,7 +2324,7 @@ get_host(char *cp, struct grouplist *grp, struct grouplist *tgrp)
|
|||||||
/*
|
/*
|
||||||
* Free up an exports list component
|
* Free up an exports list component
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
free_exp(struct exportlist *ep)
|
free_exp(struct exportlist *ep)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -2342,7 +2343,7 @@ free_exp(struct exportlist *ep)
|
|||||||
/*
|
/*
|
||||||
* Free hosts.
|
* Free hosts.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
free_host(struct hostlist *hp)
|
free_host(struct hostlist *hp)
|
||||||
{
|
{
|
||||||
struct hostlist *hp2;
|
struct hostlist *hp2;
|
||||||
@@ -2354,7 +2355,7 @@ free_host(struct hostlist *hp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct hostlist *
|
static struct hostlist *
|
||||||
get_ht(void)
|
get_ht(void)
|
||||||
{
|
{
|
||||||
struct hostlist *hp;
|
struct hostlist *hp;
|
||||||
@@ -2370,7 +2371,7 @@ get_ht(void)
|
|||||||
/*
|
/*
|
||||||
* Out of memory, fatal
|
* Out of memory, fatal
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
out_of_mem(void)
|
out_of_mem(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -2382,7 +2383,7 @@ out_of_mem(void)
|
|||||||
* Do the nmount() syscall with the update flag to push the export info into
|
* Do the nmount() syscall with the update flag to push the export info into
|
||||||
* the kernel.
|
* the kernel.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
do_mount(struct exportlist *ep, struct grouplist *grp, int exflags,
|
do_mount(struct exportlist *ep, struct grouplist *grp, int exflags,
|
||||||
struct xucred *anoncrp, char *dirp, int dirplen, struct statfs *fsb)
|
struct xucred *anoncrp, char *dirp, int dirplen, struct statfs *fsb)
|
||||||
{
|
{
|
||||||
@@ -2613,7 +2614,7 @@ do_mount(struct exportlist *ep, struct grouplist *grp, int exflags,
|
|||||||
*
|
*
|
||||||
* If `maskflg' is nonzero, then `cp' is a netmask, not a network address.
|
* If `maskflg' is nonzero, then `cp' is a netmask, not a network address.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
get_net(char *cp, struct netmsk *net, int maskflg)
|
get_net(char *cp, struct netmsk *net, int maskflg)
|
||||||
{
|
{
|
||||||
struct netent *np = NULL;
|
struct netent *np = NULL;
|
||||||
@@ -2743,7 +2744,7 @@ get_net(char *cp, struct netmsk *net, int maskflg)
|
|||||||
/*
|
/*
|
||||||
* Parse out the next white space separated field
|
* Parse out the next white space separated field
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
nextfield(char **cp, char **endcp)
|
nextfield(char **cp, char **endcp)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
@@ -2765,7 +2766,7 @@ nextfield(char **cp, char **endcp)
|
|||||||
* Get an exports file line. Skip over blank lines and handle line
|
* Get an exports file line. Skip over blank lines and handle line
|
||||||
* continuations.
|
* continuations.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
get_line(void)
|
get_line(void)
|
||||||
{
|
{
|
||||||
char *p, *cp;
|
char *p, *cp;
|
||||||
@@ -2809,7 +2810,7 @@ get_line(void)
|
|||||||
/*
|
/*
|
||||||
* Parse a description of a credential.
|
* Parse a description of a credential.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
parsecred(char *namelist, struct xucred *cr)
|
parsecred(char *namelist, struct xucred *cr)
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
@@ -2890,7 +2891,7 @@ parsecred(char *namelist, struct xucred *cr)
|
|||||||
/*
|
/*
|
||||||
* Routines that maintain the remote mounttab
|
* Routines that maintain the remote mounttab
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
get_mountlist(void)
|
get_mountlist(void)
|
||||||
{
|
{
|
||||||
struct mountlist *mlp, **mlpp;
|
struct mountlist *mlp, **mlpp;
|
||||||
@@ -2927,7 +2928,7 @@ get_mountlist(void)
|
|||||||
fclose(mlfile);
|
fclose(mlfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
del_mlist(char *hostp, char *dirp)
|
del_mlist(char *hostp, char *dirp)
|
||||||
{
|
{
|
||||||
struct mountlist *mlp, **mlpp;
|
struct mountlist *mlp, **mlpp;
|
||||||
@@ -2963,7 +2964,7 @@ del_mlist(char *hostp, char *dirp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
add_mlist(char *hostp, char *dirp)
|
add_mlist(char *hostp, char *dirp)
|
||||||
{
|
{
|
||||||
struct mountlist *mlp, **mlpp;
|
struct mountlist *mlp, **mlpp;
|
||||||
@@ -2997,7 +2998,7 @@ add_mlist(char *hostp, char *dirp)
|
|||||||
/*
|
/*
|
||||||
* Free up a group list.
|
* Free up a group list.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
free_grp(struct grouplist *grp)
|
free_grp(struct grouplist *grp)
|
||||||
{
|
{
|
||||||
if (grp->gr_type == GT_HOST) {
|
if (grp->gr_type == GT_HOST) {
|
||||||
@@ -3011,7 +3012,7 @@ free_grp(struct grouplist *grp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
void
|
static void
|
||||||
SYSLOG(int pri, const char *fmt, ...)
|
SYSLOG(int pri, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
@@ -3025,7 +3026,7 @@ SYSLOG(int pri, const char *fmt, ...)
|
|||||||
/*
|
/*
|
||||||
* Check options for consistency.
|
* Check options for consistency.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
check_options(struct dirlist *dp)
|
check_options(struct dirlist *dp)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -3063,7 +3064,7 @@ check_options(struct dirlist *dp)
|
|||||||
/*
|
/*
|
||||||
* Check an absolute directory path for any symbolic links. Return true
|
* Check an absolute directory path for any symbolic links. Return true
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
check_dirpath(char *dirp)
|
check_dirpath(char *dirp)
|
||||||
{
|
{
|
||||||
char *cp;
|
char *cp;
|
||||||
@@ -3089,7 +3090,7 @@ check_dirpath(char *dirp)
|
|||||||
* Make a netmask according to the specified prefix length. The ss_family
|
* Make a netmask according to the specified prefix length. The ss_family
|
||||||
* and other non-address fields must be initialised before calling this.
|
* and other non-address fields must be initialised before calling this.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
makemask(struct sockaddr_storage *ssp, int bitlen)
|
makemask(struct sockaddr_storage *ssp, int bitlen)
|
||||||
{
|
{
|
||||||
u_char *p;
|
u_char *p;
|
||||||
@@ -3112,7 +3113,7 @@ makemask(struct sockaddr_storage *ssp, int bitlen)
|
|||||||
* Check that the sockaddr is a valid netmask. Returns 0 if the mask
|
* Check that the sockaddr is a valid netmask. Returns 0 if the mask
|
||||||
* is acceptable (i.e. of the form 1...10....0).
|
* is acceptable (i.e. of the form 1...10....0).
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
checkmask(struct sockaddr *sa)
|
checkmask(struct sockaddr *sa)
|
||||||
{
|
{
|
||||||
u_char *mask;
|
u_char *mask;
|
||||||
@@ -3140,7 +3141,7 @@ checkmask(struct sockaddr *sa)
|
|||||||
* `sa1' matches `sa2' when filtered by the netmask in `samask'.
|
* `sa1' matches `sa2' when filtered by the netmask in `samask'.
|
||||||
* If samask is NULL, perform a full comparison.
|
* If samask is NULL, perform a full comparison.
|
||||||
*/
|
*/
|
||||||
int
|
static int
|
||||||
sacmp(struct sockaddr *sa1, struct sockaddr *sa2, struct sockaddr *samask)
|
sacmp(struct sockaddr *sa1, struct sockaddr *sa2, struct sockaddr *samask)
|
||||||
{
|
{
|
||||||
unsigned char *p1, *p2, *mask;
|
unsigned char *p1, *p2, *mask;
|
||||||
@@ -3179,7 +3180,7 @@ sacmp(struct sockaddr *sa1, struct sockaddr *sa2, struct sockaddr *samask)
|
|||||||
* raw address, and set *nbytes to its length in bytes. Returns
|
* raw address, and set *nbytes to its length in bytes. Returns
|
||||||
* NULL if the address family is unknown.
|
* NULL if the address family is unknown.
|
||||||
*/
|
*/
|
||||||
void *
|
static void *
|
||||||
sa_rawaddr(struct sockaddr *sa, int *nbytes) {
|
sa_rawaddr(struct sockaddr *sa, int *nbytes) {
|
||||||
void *p;
|
void *p;
|
||||||
int len;
|
int len;
|
||||||
@@ -3203,17 +3204,18 @@ sa_rawaddr(struct sockaddr *sa, int *nbytes) {
|
|||||||
return (p);
|
return (p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
huphandler(int sig __unused)
|
huphandler(int sig __unused)
|
||||||
{
|
{
|
||||||
|
|
||||||
got_sighup = 1;
|
got_sighup = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void terminate(int sig __unused)
|
static void
|
||||||
|
terminate(int sig __unused)
|
||||||
{
|
{
|
||||||
pidfile_remove(pfh);
|
pidfile_remove(pfh);
|
||||||
rpcb_unset(MOUNTPROG, MOUNTVERS, NULL);
|
rpcb_unset(MOUNTPROG, MOUNTVERS, NULL);
|
||||||
rpcb_unset(MOUNTPROG, MOUNTVERS3, NULL);
|
rpcb_unset(MOUNTPROG, MOUNTVERS3, NULL);
|
||||||
exit (0);
|
exit (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user