svn commit: r337502 - head/usr.sbin/pnfsdscopymr

Rick Macklem rmacklem at FreeBSD.org
Wed Aug 8 20:30:13 UTC 2018


Author: rmacklem
Date: Wed Aug  8 20:30:12 2018
New Revision: 337502
URL: https://svnweb.freebsd.org/changeset/base/337502

Log:
  Fix the err() arguments for a nfssvc(8) failure.
  
  argv has been incremented during argument handling, so elements of the
  array are no longer valid. Change the err() arguments so only the
  first string pointer in argv is used.
  Found during code inspection.

Modified:
  head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c

Modified: head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c
==============================================================================
--- head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c	Wed Aug  8 20:21:45 2018	(r337501)
+++ head/usr.sbin/pnfsdscopymr/pnfsdscopymr.c	Wed Aug  8 20:30:12 2018	(r337502)
@@ -295,7 +295,7 @@ main(int argc, char *argv[])
 	pnfsdarg.mdspath = *argv;
 	ret = nfssvc(NFSSVC_PNFSDS, &pnfsdarg);
 	if (ret < 0 && errno != EEXIST)
-		err(1, "Copymr failed args %s, %s", argv[1], argv[2]);
+		err(1, "Copymr failed for file %s", *argv);
 	exit(0);
 }
 


More information about the svn-src-head mailing list