Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/mountd Rename debug to mountd_debug to avoid overla...



details:   https://anonhg.NetBSD.org/src/rev/bd04f199a3ec
branches:  trunk
changeset: 971383:bd04f199a3ec
user:      joerg <joerg%NetBSD.org@localhost>
date:      Thu Apr 23 00:22:01 2020 +0000

description:
Rename debug to mountd_debug to avoid overlap in rump tests

diffstat:

 usr.sbin/mountd/get_net.c |   8 +++---
 usr.sbin/mountd/mountd.c  |  50 +++++++++++++++++++++++-----------------------
 usr.sbin/mountd/mountd.h  |   4 +-
 3 files changed, 31 insertions(+), 31 deletions(-)

diffs (252 lines):

diff -r 1b37d643fcff -r bd04f199a3ec usr.sbin/mountd/get_net.c
--- a/usr.sbin/mountd/get_net.c Thu Apr 23 00:17:34 2020 +0000
+++ b/usr.sbin/mountd/get_net.c Thu Apr 23 00:22:01 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: get_net.c,v 1.2 2015/12/24 01:41:19 christos Exp $      */
+/*     $NetBSD: get_net.c,v 1.3 2020/04/23 00:22:01 joerg Exp $         */
 
 /*
  * Copyright (c) 1989, 1993
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: get_net.c,v 1.2 2015/12/24 01:41:19 christos Exp $");
+__RCSID("$NetBSD: get_net.c,v 1.3 2020/04/23 00:22:01 joerg Exp $");
 
 #include <sys/types.h>
 #include <netdb.h>
@@ -52,7 +52,7 @@
 #ifdef TEST
 int      opt_flags;
 const int ninumeric = NI_NUMERICHOST;
-int      debug = 1;
+int      mountd_debug = 1;
 #endif
 
 static int 
@@ -145,7 +145,7 @@
                sin.sin_family = AF_INET;
                sin.sin_len = sizeof sin;
                sin.sin_addr = inet_makeaddr(inet_network(cp), 0);
-               if (debug)
+               if (mountd_debug)
                        fprintf(stderr, "get_net: '%s' v4 addr %x\n",
                            cp, sin.sin_addr.s_addr);
                sa = (struct sockaddr *)&sin;
diff -r 1b37d643fcff -r bd04f199a3ec usr.sbin/mountd/mountd.c
--- a/usr.sbin/mountd/mountd.c  Thu Apr 23 00:17:34 2020 +0000
+++ b/usr.sbin/mountd/mountd.c  Thu Apr 23 00:22:01 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mountd.c,v 1.130 2018/01/09 03:31:13 christos Exp $     */
+/*     $NetBSD: mountd.c,v 1.131 2020/04/23 00:22:01 joerg Exp $        */
 
 /*
  * Copyright (c) 1989, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char     sccsid[] = "@(#)mountd.c  8.15 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: mountd.c,v 1.130 2018/01/09 03:31:13 christos Exp $");
+__RCSID("$NetBSD: mountd.c,v 1.131 2020/04/23 00:22:01 joerg Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -238,7 +238,7 @@
 static int     have_v6 = 1;
 const int ninumeric = NI_NUMERICHOST;
 
-int      debug = DEBUGGING;
+int      mountd_debug = DEBUGGING;
 #if 0
 static void SYSLOG(int, const char *,...);
 #endif
@@ -369,7 +369,7 @@
                        forcedport = atoi(optarg);
                        break;
                case 'd':
-                       debug = 1;
+                       mountd_debug = 1;
                        break;
                case 'N':
                        noprivports = 1;
@@ -414,16 +414,16 @@
        grphead = NULL;
        exphead = NULL;
        mlhead = NULL;
-       openlog("mountd", LOG_PID | (debug ? LOG_PERROR : 0), LOG_DAEMON);
+       openlog("mountd", LOG_PID | (mountd_debug ? LOG_PERROR : 0), LOG_DAEMON);
        (void)signal(SIGSYS, no_nfs);
 
-       if (debug)
+       if (mountd_debug)
                (void)fprintf(stderr, "Getting export list.\n");
        get_exportlist(0);
-       if (debug)
+       if (mountd_debug)
                (void)fprintf(stderr, "Getting mount list.\n");
        get_mountlist();
-       if (debug)
+       if (mountd_debug)
                (void)fprintf(stderr, "Here we go.\n");
        (void)signal(SIGTERM, send_umntall);
 
@@ -547,7 +547,7 @@
                exit(1);
        }
 
-       if (debug == 0) {
+       if (mountd_debug == 0) {
                daemon(0, 0);
                (void)signal(SIGINT, SIG_IGN);
                (void)signal(SIGQUIT, SIG_IGN);
@@ -612,16 +612,16 @@
                        syslog(LOG_ERR, "Can't send reply");
                return;
        case MOUNTPROC_MNT:
-               if (debug)
+               if (mountd_debug)
                        fprintf(stderr,
                            "got mount request from %s\n", numerichost);
                if (!svc_getargs(transp, xdr_dir, rpcpath)) {
-                       if (debug)
+                       if (mountd_debug)
                                fprintf(stderr, "-> garbage args\n");
                        svcerr_decode(transp);
                        return;
                }
-               if (debug)
+               if (mountd_debug)
                        fprintf(stderr,
                            "-> rpcpath: %s\n", rpcpath);
                /*
@@ -638,14 +638,14 @@
                    (!S_ISDIR(stb.st_mode) && !S_ISREG(stb.st_mode)) ||
                    statvfs1(rdirpath, &fsb, ST_WAIT) < 0) {
                        (void)chdir("/"); /* Just in case realpath doesn't */
-                       if (debug)
+                       if (mountd_debug)
                                (void)fprintf(stderr, "-> stat failed on %s\n",
                                    rdirpath);
                        if (!svc_sendreply(transp, (xdrproc_t)xdr_long, (caddr_t) &bad))
                                syslog(LOG_ERR, "Can't send reply");
                        return;
                }
-               if (debug)
+               if (mountd_debug)
                        fprintf(stderr,
                            "-> dirpath: %s\n", rdirpath);
                /* Check in the exports list */
@@ -696,7 +696,7 @@
                                add_mlist(host, rdirpath, hostset);
                        else
                                add_mlist(numerichost, rdirpath, hostset);
-                       if (debug)
+                       if (mountd_debug)
                                (void)fprintf(stderr, "Mount successful.\n");
                } else {
                        if (!svc_sendreply(transp, (xdrproc_t)xdr_long, (caddr_t) &bad))
@@ -992,12 +992,12 @@
                        *ep = get_exp();
                        (*ep)->ex_fs = fsp->f_fsidx;
                        (*ep)->ex_fsdir = estrdup(fsp->f_mntonname);
-                       if (debug)
+                       if (mountd_debug)
                                (void)fprintf(stderr,
                                    "Making new ep fs=0x%x,0x%x\n",
                                    fsp->f_fsidx.__fsid_val[0], fsp->f_fsidx.__fsid_val[1]);
                } else {
-                       if (debug)
+                       if (mountd_debug)
                                (void)fprintf(stderr,
                                    "Found ep fs=0x%x,0x%x\n",
                                    fsp->f_fsidx.__fsid_val[0], fsp->f_fsidx.__fsid_val[1]);
@@ -1078,14 +1078,14 @@
                 * Don't exit here; we can still reload the config
                 * after a SIGHUP.
                 */
-               if (debug)
+               if (mountd_debug)
                        (void)fprintf(stderr, "Can't open %s: %s\n", exname,
                            strerror(errno));
                return;
        }
        dirhead = NULL;
        while ((line = fparseln(exp_file, &len, &lineno, NULL, 0)) != NULL) {
-               if (debug)
+               if (mountd_debug)
                        (void)fprintf(stderr, "Got line %s\n", line);
                cp = line;
                nextfield(&cp, &endcp);
@@ -1130,7 +1130,7 @@
                                            line, (unsigned long)lineno);
                                        goto badline;
                                }
-                               if (debug)
+                               if (mountd_debug)
                                        (void)fprintf(stderr, "doing opt %s\n",
                                            cp);
                                got_nondir = 1;
@@ -1184,7 +1184,7 @@
 
                if (!has_host) {
                        grp->gr_type = GT_HOST;
-                       if (debug)
+                       if (mountd_debug)
                                (void)fprintf(stderr,
                                    "Adding a default entry\n");
                        /* add a default group and make the grp list NULL */
@@ -1482,7 +1482,7 @@
        bytelen = bitlen / 8;
        bitsleft = bitlen % 8;
 
-       if (debug) {
+       if (mountd_debug) {
                printf("comparing:\n");
                for (i = 0; i < (bitsleft ? bytelen + 1 : bytelen); i++)
                        printf("%02x", p1[i]);
@@ -1755,7 +1755,7 @@
                } else if (cpoptarg && (!strcmp(cpopt, "network") ||
                    !strcmp(cpopt, "n"))) {
                        if (strchr(cpoptarg, '/') != NULL) {
-                               if (debug)
+                               if (mountd_debug)
                                        fprintf(stderr, "setting OP_MASKLEN\n");
                                opt_flags |= OP_MASKLEN;
                        }
@@ -1850,7 +1850,7 @@
                        ai->ai_flags |= AI_CANONNAME;
                } else
                        ai->ai_flags &= ~AI_CANONNAME;
-               if (debug)
+               if (mountd_debug)
                        (void)fprintf(stderr, "got host %s\n", ai->ai_canonname);
                ai = ai->ai_next;
        }
@@ -2278,7 +2278,7 @@
 
        va_start(ap, fmt);
 
-       if (debug)
+       if (mountd_debug)
                vfprintf(stderr, fmt, ap);
        else
                vsyslog(pri, fmt, ap);
diff -r 1b37d643fcff -r bd04f199a3ec usr.sbin/mountd/mountd.h
--- a/usr.sbin/mountd/mountd.h  Thu Apr 23 00:17:34 2020 +0000
+++ b/usr.sbin/mountd/mountd.h  Thu Apr 23 00:22:01 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mountd.h,v 1.3 2015/12/29 04:30:43 pgoyette Exp $ */
+/*     $NetBSD: mountd.h,v 1.4 2020/04/23 00:22:01 joerg Exp $ */
 
 /*
  * Copyright (c) 1989, 1993
@@ -43,7 +43,7 @@
 #define        OP_MASKLEN      0x200
 
 extern int opt_flags;
-extern int debug;
+extern int mountd_debug;
 extern const int ninumeric;
 
 struct netmsk {



Home | Main Index | Thread Index | Old Index