rpms/tar/F-8 tar-1.17-xattrs.patch,1.2,1.3 tar.spec,1.66,1.67

Radek Brich (rbrich) fedora-extras-commits at redhat.com
Tue Feb 12 13:54:15 UTC 2008


Author: rbrich

Update of /cvs/extras/rpms/tar/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6312

Modified Files:
	tar-1.17-xattrs.patch tar.spec 
Log Message:
Resolves: 431879

tar-1.17-xattrs.patch:

Index: tar-1.17-xattrs.patch
===================================================================
RCS file: /cvs/extras/rpms/tar/F-8/tar-1.17-xattrs.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- tar-1.17-xattrs.patch	12 Dec 2007 14:12:32 -0000	1.2
+++ tar-1.17-xattrs.patch	12 Feb 2008 13:54:11 -0000	1.3
@@ -304,6 +304,7 @@
 +{ /* "system.posix_acl_access" */
 +#ifdef HAVE_LIBACL
 +  char *val = NULL;
++  size_t len;
 +  acl_t acl;
 +
 +  if (fd != -1)
@@ -322,8 +323,7 @@
 +    return;
 +  }
 +  
-+  
-+  val = acl_to_text(acl, NULL);
++  val = acl_to_text(acl, &len);
 +  acl_free (acl);
 +  
 +  if (val == NULL)
@@ -332,8 +332,8 @@
 +    return;
 +  }
 +  
-+  *ret_ptr = xstrdup (val);
-+  *ret_len = strlen (val);
++  *ret_ptr = xstrndup (val, len);
++  *ret_len = len;
 +  
 +  acl_free (val);
 +#endif
@@ -345,6 +345,7 @@
 +{ /* "system.posix_acl_default" */
 +#ifdef HAVE_LIBACL
 +  char *val = NULL;
++  size_t len;
 +  acl_t acl;
 +  
 +  if ((acl = acl_get_file (file_name, ACL_TYPE_DEFAULT)) == (acl_t)NULL)
@@ -354,7 +355,7 @@
 +    return;
 +  }
 +  
-+  val = acl_to_text(acl, NULL);
++  val = acl_to_text(acl, &len);
 +  acl_free (acl);
 +  
 +  if (val == NULL)
@@ -363,8 +364,8 @@
 +    return;
 +  }
 +  
-+  *ret_ptr = xstrdup (val);
-+  *ret_len = strlen (val);
++  *ret_ptr = xstrndup (val, len);
++  *ret_len = len;
 +  
 +  acl_free (val);
 +#endif
@@ -401,10 +402,10 @@
 +#else
 +    if (fd == -1)
 +    {
-+      if (lgetfilecon (file_name, &st->cntx_name) == -1)
++      if ((lgetfilecon (file_name, &st->cntx_name) == -1) && (errno != ENOTSUP) && (errno != ENODATA))
 +        call_arg_warn ("lgetfilecon", file_name);
 +    }
-+    else if (fgetfilecon (fd, &st->cntx_name) == -1)
++    else if ((fgetfilecon (fd, &st->cntx_name) == -1) && (errno != ENOTSUP) && (errno != ENODATA))
 +      call_arg_warn ("fgetfilecon", file_name);
 +#endif
 +  }
@@ -664,9 +665,8 @@
 +          ret = lsetfilecon (file_name, st->cntx_name);
 +        }
 +
-+      if ((ret == -1) && (errno == EPERM))
-+        call_arg_warn(sysname, file_name);
-+      else if ((ret == -1) && (errno != EOPNOTSUPP))
++      /* do not print warnings when SELinux is disabled */
++      if ((ret == -1) && (errno != EPERM) && (errno != ENOTSUP))
 +        call_arg_error(sysname, file_name);
 +#endif
 +    }


Index: tar.spec
===================================================================
RCS file: /cvs/extras/rpms/tar/F-8/tar.spec,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- tar.spec	21 Jan 2008 12:13:59 -0000	1.66
+++ tar.spec	12 Feb 2008 13:54:11 -0000	1.67
@@ -2,7 +2,7 @@
 Name: tar
 Epoch: 2
 Version: 1.17
-Release: 6%{?dist}
+Release: 7%{?dist}
 License: GPLv2+
 Group: Applications/Archiving
 URL: http://www.gnu.org/software/tar/
@@ -95,6 +95,10 @@
 %{_infodir}/tar.info*
 
 %changelog
+* Tue Feb 12 2008 Radek Brich <rbrich at redhat.com> 2:1.17-7
+- do not print getfilecon/setfilecon warnings when SELinux is disabled
+  or SELinux data are not available (bz#431879)
+
 * Mon Jan 21 2008 Radek Brich <rbrich at redhat.com> 2:1.17-6
 - fix errors in man page
   * fix definition of --occurrence (bz#416661, patch by Jonathan Wakely)




More information about the fedora-extras-commits mailing list