CVS commit: src/external/bsd/am-utils/dist/amd

2015-08-28 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Aug 28 11:38:57 UTC 2015

Modified Files:
src/external/bsd/am-utils/dist/amd: info_ldap.c

Log Message:
Fix check for non-positive timestamps.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/am-utils/dist/amd/info_ldap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/am-utils/dist/amd/info_ldap.c
diff -u src/external/bsd/am-utils/dist/amd/info_ldap.c:1.1.1.3 src/external/bsd/am-utils/dist/amd/info_ldap.c:1.2
--- src/external/bsd/am-utils/dist/amd/info_ldap.c:1.1.1.3	Sat Jan 17 16:34:15 2015
+++ src/external/bsd/am-utils/dist/amd/info_ldap.c	Fri Aug 28 11:38:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: info_ldap.c,v 1.1.1.3 2015/01/17 16:34:15 christos Exp $	*/
+/*	$NetBSD: info_ldap.c,v 1.2 2015/08/28 11:38:57 joerg Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -448,7 +448,7 @@ get_ldap_timestamp(ALD *a, char *map, ti
 	   vals[0], map);
   err = ENOENT;
 }
-if (!*ts  0) {
+if (*ts = 0) {
   plog(XLOG_USER, Nonpositive timestamp %ld for map %s\n,
 	   (u_long) *ts, map);
   err = ENOENT;



CVS commit: src/external/bsd/am-utils/dist/amd

2015-01-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Jan 21 21:48:23 UTC 2015

Modified Files:
src/external/bsd/am-utils/dist/amd: map.c

Log Message:
Checking flags with binary ops is likely to create better results.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/am-utils/dist/amd/map.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/am-utils/dist/amd/map.c
diff -u src/external/bsd/am-utils/dist/amd/map.c:1.1.1.3 src/external/bsd/am-utils/dist/amd/map.c:1.2
--- src/external/bsd/am-utils/dist/amd/map.c:1.1.1.3	Sat Jan 17 16:34:15 2015
+++ src/external/bsd/am-utils/dist/amd/map.c	Wed Jan 21 21:48:23 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: map.c,v 1.1.1.3 2015/01/17 16:34:15 christos Exp $	*/
+/*	$NetBSD: map.c,v 1.2 2015/01/21 21:48:23 joerg Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -754,7 +754,7 @@ umount_exported(void)
 	} else {
 	  am_unmounted(mp);
 	}
-	if (!(mf-mf_flags  (MFF_UNMOUNTING|MFF_MOUNTED)))
+	if (!(mf-mf_flags  (MFF_UNMOUNTING|MFF_MOUNTED)))
 	  exported_ap[i] = NULL;
   } else {
 	/*



CVS commit: src/external/bsd/am-utils/dist/amd

2015-01-21 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Jan 21 21:47:44 UTC 2015

Modified Files:
src/external/bsd/am-utils/dist/amd: nfs_subr.c

Log Message:
Don't use uninitialised variables.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/am-utils/dist/amd/nfs_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/am-utils/dist/amd/nfs_subr.c
diff -u src/external/bsd/am-utils/dist/amd/nfs_subr.c:1.2 src/external/bsd/am-utils/dist/amd/nfs_subr.c:1.3
--- src/external/bsd/am-utils/dist/amd/nfs_subr.c:1.2	Sun Jan 18 15:54:38 2015
+++ src/external/bsd/am-utils/dist/amd/nfs_subr.c	Wed Jan 21 21:47:44 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_subr.c,v 1.2 2015/01/18 15:54:38 christos Exp $	*/
+/*	$NetBSD: nfs_subr.c,v 1.3 2015/01/21 21:47:44 joerg Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -1713,6 +1713,9 @@ am_nfs3_fsstat_3_svc(am_FSSTAT3args *arg
 if ((gopt.flags  CFM_SHOW_STATFS_ENTRIES) 
 	mp-am_al-al_mnt  mp-am_al-al_mnt-mf_mopts) {
   mnt.mnt_opts = mp-am_al-al_mnt-mf_mopts;
+  blocks = 0;
+  bfree = 0;
+  bavail = 0;
   if (amu_hasmntopt(mnt, browsable)) {
 	count_map_entries(mp, blocks, bfree, bavail);
   }



CVS commit: src/external/bsd/am-utils/dist/amd

2015-01-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 18 15:54:38 UTC 2015

Modified Files:
src/external/bsd/am-utils/dist/amd: nfs_subr.c

Log Message:
fix printf format


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/am-utils/dist/amd/nfs_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/am-utils/dist/amd/nfs_subr.c
diff -u src/external/bsd/am-utils/dist/amd/nfs_subr.c:1.1.1.3 src/external/bsd/am-utils/dist/amd/nfs_subr.c:1.2
--- src/external/bsd/am-utils/dist/amd/nfs_subr.c:1.1.1.3	Sat Jan 17 11:34:15 2015
+++ src/external/bsd/am-utils/dist/amd/nfs_subr.c	Sun Jan 18 10:54:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_subr.c,v 1.1.1.3 2015/01/17 16:34:15 christos Exp $	*/
+/*	$NetBSD: nfs_subr.c,v 1.2 2015/01/18 15:54:38 christos Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -1106,9 +1106,9 @@ am_nfs3_getattr_3_svc(am_GETATTR3args *a
   result.status = AM_NFS3_OK;
 
   if (amuDebug(D_TRACE))
-plog(XLOG_DEBUG, \tstat(%s), size = %lu, mtime=%d.%d,
+plog(XLOG_DEBUG, \tstat(%s), size = %llu, mtime=%d.%d,
 	 mp-am_path,
-	 (am_size3) fattr3-size,
+	 (unsigned long long) fattr3-size,
 	 (u_int) fattr3-mtime.seconds,
 	 (u_int) fattr3-mtime.nseconds);
 



CVS commit: src/external/bsd/am-utils/dist/amd

2015-01-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 18 16:27:36 UTC 2015

Modified Files:
src/external/bsd/am-utils/dist/amd: amq_subr.c

Log Message:
fix 32 bit compilation.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/am-utils/dist/amd/amq_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/am-utils/dist/amd/amq_subr.c
diff -u src/external/bsd/am-utils/dist/amd/amq_subr.c:1.2 src/external/bsd/am-utils/dist/amd/amq_subr.c:1.3
--- src/external/bsd/am-utils/dist/amd/amq_subr.c:1.2	Sat Jan 17 14:36:39 2015
+++ src/external/bsd/am-utils/dist/amd/amq_subr.c	Sun Jan 18 11:27:36 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: amq_subr.c,v 1.2 2015/01/17 19:36:39 christos Exp $	*/
+/*	$NetBSD: amq_subr.c,v 1.3 2015/01/18 16:27:36 christos Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -555,7 +555,7 @@ xdr_amq_map_info_qelem(XDR *xdrs, qelem 
   return (FALSE);
 }
 
-modify = m-modify;
+modify = (long)m-modify;
 if (!xdr_long(xdrs, modify)) {
   return (FALSE);
 }



CVS commit: src/external/bsd/am-utils/dist/amd

2015-01-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 18 16:37:06 UTC 2015

Modified Files:
src/external/bsd/am-utils/dist/amd: readdir.c

Log Message:
fix 32 bit build.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/am-utils/dist/amd/readdir.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/am-utils/dist/amd/readdir.c
diff -u src/external/bsd/am-utils/dist/amd/readdir.c:1.3 src/external/bsd/am-utils/dist/amd/readdir.c:1.4
--- src/external/bsd/am-utils/dist/amd/readdir.c:1.3	Sat Jan 17 12:46:31 2015
+++ src/external/bsd/am-utils/dist/amd/readdir.c	Sun Jan 18 11:37:05 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: readdir.c,v 1.3 2015/01/17 17:46:31 christos Exp $	*/
+/*	$NetBSD: readdir.c,v 1.4 2015/01/18 16:37:05 christos Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -636,7 +636,7 @@ static size_t needroom3(void)
 
 /* This one is called only if map is browsable */
 static int
-amfs_readdir3_browsable(am_node *mp, am_cookie3 cookie,
+amfs_readdir3_browsable(am_node *mp, voidp cookie,
 			am_dirlist3 *dp, am_entry3 *ep, u_int count,
 			int fully_browsable)
 {
@@ -648,7 +648,8 @@ amfs_readdir3_browsable(am_node *mp, am_
   dp-eof = FALSE;		/* assume readdir not done */
 
   if (amuDebug(D_READDIR))
-plog(XLOG_DEBUG, amfs_readdir3_browsable gen=%lu, count=%d, gen, count);
+plog(XLOG_DEBUG, %s: gen=%llu, count=%d, __func__,
+	(unsigned long long)gen, count);
 
   if (gen == 0) {
 size_t needed = needroom3();
@@ -733,8 +734,9 @@ amfs_readdir3_browsable(am_node *mp, am_
   for (j = 0, ne = te; ne; ne = ne-ne_nextentry)
 	plog(XLOG_DEBUG, gen2 key %4d \%s\, j++, ne-name);
   for (j = 0, ne = ep; ne; ne = ne-ne_nextentry) {
-	plog(XLOG_DEBUG, gen2+ key %4d \%s\ fi=%lu ck=%lu,
-	 j++, ne-name, ne-fileid, ne-cookie);
+	plog(XLOG_DEBUG, gen2+ key %4d \%s\ fi=%llu ck=%llu,
+	 j++, ne-name, (unsigned long long)ne-fileid,
+	 (unsigned long long)ne-cookie);
   }
   plog(XLOG_DEBUG, EOF is %d, dp-eof);
 }
@@ -794,14 +796,15 @@ amfs_readdir3_browsable(am_node *mp, am_
 }
 
 static int
-amfs_readdir3(am_node *mp, am_cookie3 cookie,
+amfs_readdir3(am_node *mp, voidp cookie,
 	  am_dirlist3 *dp, am_entry3 *ep, u_int count)
 {
   uint64 gen = *(uint64 *) cookie;
   am_node *xp;
 
   if (amuDebug(D_READDIR))
-plog(XLOG_DEBUG, amfs_readdir3 gen=%lu, count=%d, gen, count);
+plog(XLOG_DEBUG, %s: gen=%llu, count=%d, __func__,
+	(unsigned long long)gen, count);
 
   dp-eof = FALSE;		/* assume readdir not done */
 
@@ -848,8 +851,9 @@ amfs_readdir3(am_node *mp, am_cookie3 co
   am_entry3 *ne;
   int j;
   for (j = 0, ne = ep; ne; ne = ne-nextentry) {
-	plog(XLOG_DEBUG, gen1 key %4d \%s\ fi=%lu ck=%lu,
-	 j++, ne-name, ne-fileid, ne-cookie);
+	plog(XLOG_DEBUG, gen1 key %4d \%s\ fi=%llu ck=%llu,
+	 j++, ne-name, (unsigned long long)ne-fileid,
+	 (unsigned long long)ne-cookie);
   }
 }
 return 0;
@@ -908,8 +912,9 @@ amfs_readdir3(am_node *mp, am_cookie3 co
   am_entry3 *ne;
   int j;
   for (j = 0, ne = ep; ne; ne = ne-nextentry) {
-	plog(XLOG_DEBUG, gen2 key %4d \%s\ fi=%lu ck=%lu,
-	 j++, ne-name, ne-fileid, ne-cookie);
+	plog(XLOG_DEBUG, gen2 key %4d \%s\ fi=%llu ck=%llu,
+	 j++, ne-name, (unsigned long long)ne-fileid,
+	 (unsigned long long)ne-cookie);
   }
 }
 return 0;
@@ -945,8 +950,8 @@ amfs_generic_readdir(am_node *mp, voidp 
   return amfs_readdir(mp, cookie, dp, ep, count);
   } else {
 if (browsable)
-  return amfs_readdir3_browsable(mp, (am_cookie3) cookie, dp, ep, count, full);
+  return amfs_readdir3_browsable(mp, cookie, dp, ep, count, full);
 else
-  return amfs_readdir3(mp, (am_cookie3) cookie, dp, ep, count);
+  return amfs_readdir3(mp, cookie, dp, ep, count);
   }
 }



CVS commit: src/external/bsd/am-utils/dist/amd

2015-01-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan 17 19:36:40 UTC 2015

Modified Files:
src/external/bsd/am-utils/dist/amd: amq_subr.c

Log Message:
don't use time_t in xdr_long


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 src/external/bsd/am-utils/dist/amd/amq_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/am-utils/dist/amd/amq_subr.c
diff -u src/external/bsd/am-utils/dist/amd/amq_subr.c:1.1.1.3 src/external/bsd/am-utils/dist/amd/amq_subr.c:1.2
--- src/external/bsd/am-utils/dist/amd/amq_subr.c:1.1.1.3	Sat Jan 17 11:34:15 2015
+++ src/external/bsd/am-utils/dist/amd/amq_subr.c	Sat Jan 17 14:36:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: amq_subr.c,v 1.1.1.3 2015/01/17 16:34:15 christos Exp $	*/
+/*	$NetBSD: amq_subr.c,v 1.2 2015/01/17 19:36:39 christos Exp $	*/
 
 /*
  * Copyright (c) 1997-2014 Erez Zadok
@@ -530,6 +530,7 @@ xdr_amq_map_info_qelem(XDR *xdrs, qelem 
   u_int len = 0;
   int x;
   char *n;
+  long modify;
 
   /*
* Compute length of list
@@ -554,7 +555,8 @@ xdr_amq_map_info_qelem(XDR *xdrs, qelem 
   return (FALSE);
 }
 
-if (!xdr_long(xdrs, m-modify)) {
+modify = m-modify;
+if (!xdr_long(xdrs, modify)) {
   return (FALSE);
 }
 



CVS commit: src/external/bsd/am-utils/dist/amd

2011-08-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 17 08:22:50 UTC 2011

Modified Files:
src/external/bsd/am-utils/dist/amd: readdir.c

Log Message:
fix type-punned warnings using memcpy


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/am-utils/dist/amd/readdir.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/am-utils/dist/amd/readdir.c
diff -u src/external/bsd/am-utils/dist/amd/readdir.c:1.1.1.2 src/external/bsd/am-utils/dist/amd/readdir.c:1.2
--- src/external/bsd/am-utils/dist/amd/readdir.c:1.1.1.2	Fri Mar 20 16:26:50 2009
+++ src/external/bsd/am-utils/dist/amd/readdir.c	Wed Aug 17 04:22:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: readdir.c,v 1.1.1.2 2009/03/20 20:26:50 christos Exp $	*/
+/*	$NetBSD: readdir.c,v 1.2 2011/08/17 08:22:50 christos Exp $	*/
 
 /*
  * Copyright (c) 1997-2009 Erez Zadok
@@ -57,6 +57,7 @@
 #define DOT_DOT_COOKIE	(u_int) 1
 #define MAX_CHAIN	2048
 
+static const u_int zero = 0, dot_dot_cookie = DOT_DOT_COOKIE;
 
 /
  *** FORWARD DEFINITIONS  ***
@@ -181,7 +182,7 @@
   /* we have space.  put entry in next cell */
   ++last_cookie;
   chain[num_entries].ne_fileid = (u_int) last_cookie;
-  *(u_int *) chain[num_entries].ne_cookie = (u_int) last_cookie;
+  memcpy(chain[num_entries].ne_cookie, last_cookie, sizeof(last_cookie));
   chain[num_entries].ne_name = key;
   if (num_entries  max_entries - 1) {	/* link to next one */
 	chain[num_entries].ne_nextentry = chain[num_entries + 1];
@@ -255,7 +256,7 @@
 ep[0].ne_fileid = mp-am_gen;
 ep[0].ne_name = .;
 ep[0].ne_nextentry = ep[1];
-*(u_int *) ep[0].ne_cookie = 0;
+memcpy(ep[0].ne_cookie, zero, sizeof(zero));
 
 /* construct .. */
 if (mp-am_parent)
@@ -265,7 +266,7 @@
 
 ep[1].ne_name = ..;
 ep[1].ne_nextentry = NULL;
-*(u_int *) ep[1].ne_cookie = DOT_DOT_COOKIE;
+memcpy(ep[1].ne_cookie, dot_dot_cookie, sizeof(dot_dot_cookie));
 
 /*
  * If map is browsable, call a function make_entry_chain() to construct
@@ -302,9 +303,12 @@
   nfsentry *ne;
   for (j = 0, ne = te; ne; ne = ne-ne_nextentry)
 	plog(XLOG_DEBUG, gen2 key %4d \%s\, j++, ne-ne_name);
-  for (j = 0, ne = ep; ne; ne = ne-ne_nextentry)
-	plog(XLOG_DEBUG, gen2+ key %4d \%s\ fi=%d ck=%d,
-	 j++, ne-ne_name, ne-ne_fileid, *(u_int *)ne-ne_cookie);
+  for (j = 0, ne = ep; ne; ne = ne-ne_nextentry) {
+u_int cookie;
+	memcpy(cookie, ne-ne_cookie, sizeof(cookie));
+	plog(XLOG_DEBUG, gen2+ key %4d \%s\ fi=%d ck=%u,
+	 j++, ne-ne_name, ne-ne_fileid, cookie);
+  }
   plog(XLOG_DEBUG, EOF is %d, dp-dl_eof);
 }
 return 0;
@@ -414,7 +418,7 @@
 ep[0].ne_fileid = mp-am_gen;
 ep[0].ne_name = .;
 ep[0].ne_nextentry = ep[1];
-*(u_int *) ep[0].ne_cookie = 0;
+memcpy(ep[0].ne_cookie, zero, sizeof(zero));
 
 /* construct .. */
 if (mp-am_parent)
@@ -423,7 +427,8 @@
   ep[1].ne_fileid = mp-am_gen;
 ep[1].ne_name = ..;
 ep[1].ne_nextentry = NULL;
-*(u_int *) ep[1].ne_cookie = (xp ? xp-am_gen : DOT_DOT_COOKIE);
+memcpy(ep[1].ne_cookie, (xp ? xp-am_gen : dot_dot_cookie),
+	sizeof(dot_dot_cookie));
 
 if (!xp)
   dp-dl_eof = TRUE;	/* by default assume readdir done */
@@ -431,9 +436,12 @@
 if (amuDebug(D_READDIR)) {
   nfsentry *ne;
   int j;
-  for (j = 0, ne = ep; ne; ne = ne-ne_nextentry)
-	plog(XLOG_DEBUG, gen1 key %4d \%s\ fi=%d ck=%d,
-	 j++, ne-ne_name, ne-ne_fileid, *(u_int *)ne-ne_cookie);
+  for (j = 0, ne = ep; ne; ne = ne-ne_nextentry) {
+	u_int cookie;
+	memcpy(cookie, ne-ne_cookie, sizeof(cookie));
+	plog(XLOG_DEBUG, gen1 key %4d \%s\ fi=%d ck=%u,
+	 j++, ne-ne_name, ne-ne_fileid, cookie);
+  }
 }
 return 0;
   }
@@ -462,9 +470,9 @@
   am_node *xp_next = next_nonerror_node(xp-am_osib);
 
   if (xp_next) {
-	*(u_int *) ep-ne_cookie = xp_next-am_gen;
+	memcpy(ep-ne_cookie, xp_next-am_gen, sizeof(xp_next-am_gen));
   } else {
-	*(u_int *) ep-ne_cookie = DOT_DOT_COOKIE;
+	memcpy(ep-ne_cookie, dot_dot_cookie, sizeof(dot_dot_cookie));
 	dp-dl_eof = TRUE;
   }
 
@@ -490,9 +498,12 @@
 if (amuDebug(D_READDIR)) {
   nfsentry *ne;
   int j;
-  for (j=0,ne=ep; ne; ne=ne-ne_nextentry)
-	plog(XLOG_DEBUG, gen2 key %4d \%s\ fi=%d ck=%d,
-	 j++, ne-ne_name, ne-ne_fileid, *(u_int *)ne-ne_cookie);
+  for (j=0,ne=ep; ne; ne=ne-ne_nextentry) {
+u_int cookie;
+	memcpy(cookie, ne-ne_cookie, sizeof(cookie));
+	plog(XLOG_DEBUG, gen2 key %4d \%s\ fi=%d ck=%u,
+	 j++, ne-ne_name, ne-ne_fileid, cookie);
+  }
 }
 return 0;
   }