changeset 4713:58aeb84211ce

6537592 cp/mv has incorrect #ifdef XPG4 6574799 ACL parser can't handle single digit uid/gid 6581638 sharemgr: sa_sharetab_fill_zfs() leaks memory
author marks
date Tue, 24 Jul 2007 06:59:03 -0700
parents dc399af8f2e6
children 0e5ef817bcec
files usr/src/cmd/mv/mv.c usr/src/lib/libsec/common/acl_lex.l usr/src/lib/libshare/common/libshare_zfs.c
diffstat 3 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/mv/mv.c	Tue Jul 24 03:02:52 2007 -0700
+++ b/usr/src/cmd/mv/mv.c	Tue Jul 24 06:59:03 2007 -0700
@@ -1617,6 +1617,7 @@
 		s1save = s1;
 		if (s1acl != NULL) {
 			s1acl_save = acl_dup(s1acl);
+#ifdef XPG4
 			if (s1acl_save == NULL) {
 				(void) fprintf(stderr, gettext("%s: "
 				    "Insufficient memory to save acl"
@@ -1625,14 +1626,6 @@
 					return (1);
 
 			}
-#ifdef XPG4
-			else {
-				(void) fprintf(stderr, gettext("%s: "
-				    "Insufficient memory to save acl"
-				    " entry\n"), cmd);
-				if (pflg)
-					return (1);
-			}
 #endif
 		}
 	}
--- a/usr/src/lib/libsec/common/acl_lex.l	Tue Jul 24 03:02:52 2007 -0700
+++ b/usr/src/lib/libsec/common/acl_lex.l	Tue Jul 24 06:59:03 2007 -0700
@@ -18,7 +18,7 @@
  *
  * CDDL HEADER END
  *
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -70,7 +70,7 @@
  * ES = End state
  */
 
-ID	[1-9][0-9]*
+ID	[0-9]+
 LOGNAME [^:]+:
 PERM_STR [rRwWxpdDaAcCos-]+
 INHERIT_STR [fdinFS-]+
--- a/usr/src/lib/libshare/common/libshare_zfs.c	Tue Jul 24 03:02:52 2007 -0700
+++ b/usr/src/lib/libshare/common/libshare_zfs.c	Tue Jul 24 06:59:03 2007 -0700
@@ -964,10 +964,13 @@
 {
 	char *path;
 
+	/* Make sure path is valid */
+
 	path = sa_get_share_attr(share, "path");
 	if (path != NULL) {
 		(void) memset(sh, 0, sizeof (sh));
 		(void) sa_fillshare(share, proto, sh);
+		sa_free_attr_string(path);
 		return (0);
 	} else
 		return (1);