Source-Changes-HG archive

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

[src/trunk]: src/dist/am-utils resolve conflicts



details:   https://anonhg.NetBSD.org/src/rev/5b019a91ba47
branches:  trunk
changeset: 588028:5b019a91ba47
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Feb 05 16:28:55 2006 +0000

description:
resolve conflicts

diffstat:

 dist/am-utils/amd/am_ops.c                       |   92 +++++-----
 dist/am-utils/amd/amd.c                          |    9 +-
 dist/am-utils/amd/amd.h                          |   22 +-
 dist/am-utils/amd/amfs_auto.c                    |    6 +-
 dist/am-utils/amd/amfs_generic.c                 |    2 +-
 dist/am-utils/amd/amfs_host.c                    |   18 +-
 dist/am-utils/amd/amfs_toplvl.c                  |   74 ++++----
 dist/am-utils/amd/amq_subr.c                     |   39 ++++-
 dist/am-utils/amd/amq_svc.c                      |    2 +-
 dist/am-utils/amd/autil.c                        |   86 +---------
 dist/am-utils/amd/get_args.c                     |   15 +-
 dist/am-utils/amd/info_exec.c                    |    2 +-
 dist/am-utils/amd/info_hesiod.c                  |    4 +-
 dist/am-utils/amd/info_ldap.c                    |    6 +-
 dist/am-utils/amd/info_ndbm.c                    |   10 +-
 dist/am-utils/amd/info_nisplus.c                 |    2 +-
 dist/am-utils/amd/info_passwd.c                  |   12 +-
 dist/am-utils/amd/info_union.c                   |   22 +-
 dist/am-utils/amd/map.c                          |    4 +-
 dist/am-utils/amd/mapc.c                         |   70 ++++---
 dist/am-utils/amd/nfs_prot_svc.c                 |    2 +-
 dist/am-utils/amd/nfs_start.c                    |    8 +-
 dist/am-utils/amd/nfs_subr.c                     |    6 +-
 dist/am-utils/amd/ops_cachefs.c                  |   13 +-
 dist/am-utils/amd/ops_nfs.c                      |   25 +-
 dist/am-utils/amd/opts.c                         |   31 +-
 dist/am-utils/amd/rpc_fwd.c                      |    2 +-
 dist/am-utils/amq/amq.c                          |   10 +-
 dist/am-utils/amq/amq.h                          |    2 +-
 dist/am-utils/amq/amq_clnt.c                     |    2 +-
 dist/am-utils/amq/pawd.c                         |   72 ++------
 dist/am-utils/conf/autofs/autofs_linux.c         |    2 +-
 dist/am-utils/conf/autofs/autofs_solaris_v1.c    |    2 +-
 dist/am-utils/conf/autofs/autofs_solaris_v1.h    |    2 +-
 dist/am-utils/conf/autofs/autofs_solaris_v2_v3.c |    2 +-
 dist/am-utils/conf/mount/mount_linux.c           |    2 +-
 dist/am-utils/conf/mtab/mtab_file.c              |    2 +-
 dist/am-utils/conf/mtab/mtab_linux.c             |    2 +-
 dist/am-utils/conf/mtab/mtab_mach3.c             |    2 +-
 dist/am-utils/conf/mtab/mtab_osf.c               |    2 +-
 dist/am-utils/conf/mtab/mtab_svr4.c              |    2 +-
 dist/am-utils/conf/nfs_prot/nfs_prot_netbsd1_4.h |    2 +-
 dist/am-utils/conf/transp/transp_sockets.c       |    4 +-
 dist/am-utils/conf/transp/transp_tli.c           |    2 +-
 dist/am-utils/fixmount/fixmount.c                |    6 +-
 dist/am-utils/fsinfo/fsi_analyze.c               |   19 +-
 dist/am-utils/fsinfo/fsi_util.c                  |   12 +-
 dist/am-utils/fsinfo/fsinfo.c                    |    5 +-
 dist/am-utils/fsinfo/fsinfo.h                    |    4 +-
 dist/am-utils/fsinfo/wr_atab.c                   |   11 +-
 dist/am-utils/hlfsd/hlfsd.c                      |   46 +++--
 dist/am-utils/hlfsd/hlfsd.h                      |    5 +-
 dist/am-utils/hlfsd/homedir.c                    |   20 +-
 dist/am-utils/hlfsd/stubs.c                      |    2 +-
 dist/am-utils/include/am_compat.h                |    7 +-
 dist/am-utils/include/am_defs.h                  |    9 +-
 dist/am-utils/include/am_utils.h                 |   33 +++-
 dist/am-utils/include/amq_defs.h                 |    5 +-
 dist/am-utils/libamu/hasmntopt.c                 |    8 +-
 dist/am-utils/libamu/mount_fs.c                  |   40 ++--
 dist/am-utils/libamu/strcasecmp.c                |    2 +-
 dist/am-utils/libamu/strerror.c                  |    4 +-
 dist/am-utils/libamu/strutil.c                   |    2 +-
 dist/am-utils/libamu/util.c                      |  191 -----------------------
 dist/am-utils/libamu/wire.c                      |   58 +++---
 dist/am-utils/libamu/xutil.c                     |  150 +++++++++++++----
 dist/am-utils/mk-amd-map/mk-amd-map.c            |   27 +-
 67 files changed, 634 insertions(+), 730 deletions(-)

diffs (truncated from 3053 to 300 lines):

diff -r 0a8c8db87a52 -r 5b019a91ba47 dist/am-utils/amd/am_ops.c
--- a/dist/am-utils/amd/am_ops.c        Sun Feb 05 16:12:04 2006 +0000
+++ b/dist/am-utils/amd/am_ops.c        Sun Feb 05 16:28:55 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: am_ops.c,v 1.6 2005/09/20 17:57:44 rpaulo Exp $        */
+/*     $NetBSD: am_ops.c,v 1.7 2006/02/05 16:28:55 christos Exp $      */
 
 /*
  * Copyright (c) 1997-2005 Erez Zadok
@@ -147,111 +147,111 @@
 
 
 void
-ops_showamfstypes(char *buf)
+ops_showamfstypes(char *buf, size_t l)
 {
   struct am_ops **ap;
-  int l = 0;
+  int linesize = 0;
 
   buf[0] = '\0';
   for (ap = vops; *ap; ap++) {
-    strcat(buf, (*ap)->fs_type);
+    xstrlcat(buf, (*ap)->fs_type, l);
     if (ap[1])
-      strcat(buf, ", ");
-    l += strlen((*ap)->fs_type) + 2;
-    if (l > 62) {
-      l = 0;
-      strcat(buf, "\n      ");
+      xstrlcat(buf, ", ", l);
+    linesize += strlen((*ap)->fs_type) + 2;
+    if (linesize > 62) {
+      linesize = 0;
+      xstrlcat(buf, "\n      ", l);
     }
   }
 }
 
 
 static void
-ops_show1(char *buf, int *lp, const char *name)
+ops_show1(char *buf, size_t l, int *linesizep, const char *name)
 {
-  strcat(buf, name);
-  strcat(buf, ", ");
-  *lp += strlen(name) + 2;
-  if (*lp > 60) {
-    strcat(buf, "\t\n");
-    *lp = 0;
+  xstrlcat(buf, name, l);
+  xstrlcat(buf, ", ", l);
+  *linesizep += strlen(name) + 2;
+  if (*linesizep > 60) {
+    xstrlcat(buf, "\t\n", l);
+    *linesizep = 0;
   }
 }
 
 
 void
-ops_showfstypes(char *buf)
+ops_showfstypes(char *buf, size_t l)
 {
-  int l = 0;
+  int linesize = 0;
 
   buf[0] = '\0';
 
 #ifdef MNTTAB_TYPE_AUTOFS
-  ops_show1(buf, &l, MNTTAB_TYPE_AUTOFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_AUTOFS);
 #endif /* MNTTAB_TYPE_AUTOFS */
 
 #ifdef MNTTAB_TYPE_CACHEFS
-  ops_show1(buf, &l, MNTTAB_TYPE_CACHEFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_CACHEFS);
 #endif /* MNTTAB_TYPE_CACHEFS */
 
 #ifdef MNTTAB_TYPE_CDFS
-  ops_show1(buf, &l, MNTTAB_TYPE_CDFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_CDFS);
 #endif /* MNTTAB_TYPE_CDFS */
 
 #ifdef MNTTAB_TYPE_CFS
-  ops_show1(buf, &l, MNTTAB_TYPE_CFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_CFS);
 #endif /* MNTTAB_TYPE_CFS */
 
 #ifdef MNTTAB_TYPE_LOFS
-  ops_show1(buf, &l, MNTTAB_TYPE_LOFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_LOFS);
 #endif /* MNTTAB_TYPE_LOFS */
 
 #ifdef MNTTAB_TYPE_EFS
-  ops_show1(buf, &l, MNTTAB_TYPE_EFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_EFS);
 #endif /* MNTTAB_TYPE_EFS */
 
 #ifdef MNTTAB_TYPE_MFS
-  ops_show1(buf, &l, MNTTAB_TYPE_MFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_MFS);
 #endif /* MNTTAB_TYPE_MFS */
 
 #ifdef MNTTAB_TYPE_NFS
-  ops_show1(buf, &l, MNTTAB_TYPE_NFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_NFS);
 #endif /* MNTTAB_TYPE_NFS */
 
 #ifdef MNTTAB_TYPE_NFS3
-  ops_show1(buf, &l, "nfs3");  /* always hard-code as nfs3 */
+  ops_show1(buf, l, &linesize, "nfs3"); /* always hard-code as nfs3 */
 #endif /* MNTTAB_TYPE_NFS3 */
 
 #ifdef MNTTAB_TYPE_NULLFS
-  ops_show1(buf, &l, MNTTAB_TYPE_NULLFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_NULLFS);
 #endif /* MNTTAB_TYPE_NULLFS */
 
 #ifdef MNTTAB_TYPE_PCFS
-  ops_show1(buf, &l, MNTTAB_TYPE_PCFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_PCFS);
 #endif /* MNTTAB_TYPE_PCFS */
 
 #ifdef MNTTAB_TYPE_TFS
-  ops_show1(buf, &l, MNTTAB_TYPE_TFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_TFS);
 #endif /* MNTTAB_TYPE_TFS */
 
 #ifdef MNTTAB_TYPE_TMPFS
-  ops_show1(buf, &l, MNTTAB_TYPE_TMPFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_TMPFS);
 #endif /* MNTTAB_TYPE_TMPFS */
 
 #ifdef MNTTAB_TYPE_UFS
-  ops_show1(buf, &l, MNTTAB_TYPE_UFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_UFS);
 #endif /* MNTTAB_TYPE_UFS */
 
 #ifdef MNTTAB_TYPE_UMAPFS
-  ops_show1(buf, &l, MNTTAB_TYPE_UMAPFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_UMAPFS);
 #endif /* MNTTAB_TYPE_UMAPFS */
 
 #ifdef MNTTAB_TYPE_UNIONFS
-  ops_show1(buf, &l, MNTTAB_TYPE_UNIONFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_UNIONFS);
 #endif /* MNTTAB_TYPE_UNIONFS */
 
 #ifdef MNTTAB_TYPE_XFS
-  ops_show1(buf, &l, MNTTAB_TYPE_XFS);
+  ops_show1(buf, l, &linesize, MNTTAB_TYPE_XFS);
 #endif /* MNTTAB_TYPE_XFS */
 
   /* terminate with a period, newline, and NULL */
@@ -259,7 +259,7 @@
     buf[strlen(buf) - 4] = '\0';
   else
     buf[strlen(buf) - 2] = '\0';
-  strcat(buf, ".\n");
+  xstrlcat(buf, ".\n", l);
 }
 
 
@@ -291,11 +291,11 @@
 
   /* check if string starts with 'no' and chop it */
   if (NSTREQ(opt, "no", 2)) {
-    strlcpy(buf, &opt[2], sizeof(buf));
+    xstrlcpy(buf, &opt[2], sizeof(buf));
   } else {
     /* finally return a string prepended with 'no' */
-    strlcpy(buf, "no", sizeof(buf));
-    strlcat(buf, opt, sizeof(buf));
+    xstrlcpy(buf, "no", sizeof(buf));
+    xstrlcat(buf, opt, sizeof(buf));
   }
   return buf;
 }
@@ -317,7 +317,7 @@
   char *eq;                    /* pointer to whatever follows '=' within temp */
   char oneopt[80];             /* one option w/o value if any */
   char *revoneopt;             /* reverse of oneopt */
-  int len = strlen(opts1) + strlen(opts2) + 2; /* space for "," and NULL */
+  size_t len = strlen(opts1) + strlen(opts2) + 2; /* space for "," and NULL */
   char *s1 = strdup(opts1);    /* copy of opts1 to munge */
 
   /* initialization */
@@ -340,19 +340,19 @@
       continue;
     /* add option to returned string */
     if (newstr && newstr[0]) {
-      strlcat(newstr, ",", len);
-      strlcat(newstr, tmpstr, len);
+      xstrlcat(newstr, ",", len);
+      xstrlcat(newstr, tmpstr, len);
     } else {
-      strlcpy(newstr, tmpstr, len);
+      xstrlcpy(newstr, tmpstr, len);
     }
   }
 
   /* finally, append opts2 itself */
   if (newstr && newstr[0]) {
-    strlcat(newstr, ",", len);
-    strlcat(newstr, opts2, len);
+    xstrlcat(newstr, ",", len);
+    xstrlcat(newstr, opts2, len);
   } else {
-    strlcpy(newstr, opts2, len);
+    xstrlcpy(newstr, opts2, len);
   }
 
   XFREE(s1);
diff -r 0a8c8db87a52 -r 5b019a91ba47 dist/am-utils/amd/amd.c
--- a/dist/am-utils/amd/amd.c   Sun Feb 05 16:12:04 2006 +0000
+++ b/dist/am-utils/amd/amd.c   Sun Feb 05 16:28:55 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amd.c,v 1.9 2005/09/20 17:57:44 rpaulo Exp $   */
+/*     $NetBSD: amd.c,v 1.10 2006/02/05 16:28:55 christos Exp $        */
 
 /*
  * Copyright (c) 1997-2005 Erez Zadok
@@ -55,9 +55,10 @@
 
 struct amu_global_options gopt;        /* where global options are stored */
 
-char pid_fsname[16 + MAXHOSTNAMELEN];  /* "kiska.southseas.nz:(pid%d)" */
+char pid_fsname[SIZEOF_PID_FSNAME]; /* "kiska.southseas.nz:(pid%d)" */
 char *hostdomain = "unknown.domain";
-char hostd[2 * MAXHOSTNAMELEN + 1]; /* Host+domain */
+#define SIZEOF_HOSTD (2 * MAXHOSTNAMELEN + 1)  /* Host+domain */
+char hostd[SIZEOF_HOSTD];      /* Host+domain */
 char *endian = ARCH_ENDIAN;    /* Big or Little endian */
 char *cpu = HOST_CPU;          /* CPU type */
 char *PrimNetName;             /* name of primary network */
@@ -457,7 +458,7 @@
     *domdot++ = '\0';
     hostdomain = domdot;
   }
-  strlcpy(hostd, hostname, sizeof(hostd));
+  xstrlcpy(hostd, hostname, sizeof(hostd));
   am_set_hostname(hostname);
 
   /*
diff -r 0a8c8db87a52 -r 5b019a91ba47 dist/am-utils/amd/amd.h
--- a/dist/am-utils/amd/amd.h   Sun Feb 05 16:12:04 2006 +0000
+++ b/dist/am-utils/amd/amd.h   Sun Feb 05 16:28:55 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amd.h,v 1.4 2005/09/20 17:57:44 rpaulo Exp $   */
+/*     $NetBSD: amd.h,v 1.5 2006/02/05 16:28:55 christos Exp $ */
 
 /*
  * Copyright (c) 1997-2005 Erez Zadok
@@ -513,6 +513,7 @@
 extern amq_mount_tree_list *amqproc_export_1_svc(voidp argp, struct svc_req *rqstp);
 extern amq_mount_tree_p *amqproc_mnttree_1_svc(voidp argp, struct svc_req *rqstp);
 extern amq_string *amqproc_getvers_1_svc(voidp argp, struct svc_req *rqstp);
+extern amq_string *amqproc_pawd_1_svc(voidp argp, struct svc_req *rqstp);
 extern int *amqproc_getpid_1_svc(voidp argp, struct svc_req *rqstp);
 extern int *amqproc_mount_1_svc(voidp argp, struct svc_req *rqstp);
 extern int *amqproc_setopt_1_svc(voidp argp, struct svc_req *rqstp);
@@ -591,7 +592,7 @@
 extern int  mapc_keyiter(mnt_map *, key_fun, opaque_t);
 extern void mapc_reload(void);
 extern int  mapc_search(mnt_map *, char *, char **);
-extern void mapc_showtypes(char *buf, size_t buflen);
+extern void mapc_showtypes(char *buf, size_t l);
 extern int  mapc_type_exists(const char *type);
 extern void mk_fattr(nfsfattr *, nfsftype);
 extern int  mount_auto_node(char *, opaque_t);
@@ -601,8 +602,8 @@
 extern void new_ttl(am_node *);
 extern void nfs_quick_reply(am_node *mp, int error);
 extern void normalize_slash(char *);
-extern void ops_showamfstypes(char *buf);
-extern void ops_showfstypes(char *outbuf);
+extern void ops_showamfstypes(char *buf, size_t l);
+extern void ops_showfstypes(char *outbuf, size_t l);
 extern void rem_que(qelem *);
 extern void reschedule_timeout_mp(void);
 extern void restart(void);
@@ -620,6 +621,11 @@
 extern void wakeup(wchan_t);
 extern void wakeup_srvr(fserver *);
 extern void wakeup_task(int, int, wchan_t);
+#define SIZEOF_PID_FSNAME      (16 + MAXHOSTNAMELEN)
+extern char pid_fsname[SIZEOF_PID_FSNAME]; /* "kiska.southseas.nz:(pid%d)" */
+#define SIZEOF_HOSTD (2 * MAXHOSTNAMELEN + 1)
+extern char hostd[SIZEOF_HOSTD]; /* Host+domain */
+#define SIZEOF_OPTS 256                /* used for char opts[] and preopts[] */
 
 /*
  * Global variables.
@@ -627,8 +633,10 @@
 extern FILE *yyin;
 extern SVCXPRT *current_transp; /* For nfs_quick_reply() */
 extern char *conf_tag;
-extern char *opt_gid;
-extern char *opt_uid;



Home | Main Index | Thread Index | Old Index