Fixed setfacl exitcode

This commit is contained in:
Jiří Moskovčák 2007-11-08 14:08:28 +00:00
parent b2af30c5be
commit 789e5ea71b
3 changed files with 64 additions and 3 deletions

27
acl-2.2.39-exitcode.patch Normal file
View File

@ -0,0 +1,27 @@
--- acl-2.2.39/setfacl/setfacl.c.exitcode 2007-11-08 14:45:01.000000000 +0100
+++ acl-2.2.39/setfacl/setfacl.c 2007-11-08 14:39:19.000000000 +0100
@@ -144,7 +144,7 @@ restore(
if (error < 0)
goto fail;
if (error == 0)
- return 0;
+ return status;
if (path_p == NULL) {
if (filename) {
@@ -158,6 +158,7 @@ restore(
"aborting\n"),
progname, backup_line);
}
+ status = 1;
goto getout;
}
@@ -176,6 +177,7 @@ restore(
fprintf(stderr, _("%s: %s: %s in line %d\n"),
progname, xquote(filename), strerror(errno),
line);
+ status = 1;
goto getout;
}

View File

@ -1,5 +1,5 @@
--- acl-2.2.39/getfacl/getfacl.c 2007-11-07 09:49:56.000000000 +0100 --- acl-2.2.39/getfacl/getfacl.c.old 2007-11-08 14:38:56.000000000 +0100
+++ ../devel/acl-2.2.45/getfacl/getfacl.c 2007-11-07 09:53:50.000000000 +0100 +++ acl-2.2.39/getfacl/getfacl.c 2007-11-08 14:39:19.000000000 +0100
@@ -598,17 +598,17 @@ int __do_print(const char *file, const s @@ -598,17 +598,17 @@ int __do_print(const char *file, const s
char *resolve_symlinks(const char *file) char *resolve_symlinks(const char *file)
{ {
@ -27,3 +27,32 @@
return path; return path;
} }
--- acl-2.2.39/setfacl/setfacl.c.old 2006-06-20 08:51:25.000000000 +0200
+++ acl-2.2.39/setfacl/setfacl.c 2007-11-08 14:39:19.000000000 +0100
@@ -314,17 +316,17 @@ int __do_set(const char *file, const str
char *resolve_symlinks(const char *file)
{
static char buffer[4096];
+ struct stat stat;
char *path = NULL;
- ssize_t len;
- len = readlink(file, buffer, sizeof(buffer)-1);
- if (len < 0) {
- if (errno == EINVAL) /* not a symlink, use given path */
- path = (char *)file;
- } else {
- buffer[len+1] = '\0';
- path = buffer;
- }
+ if (lstat(file, &stat) == -1)
+ return path;
+
+ if (S_ISLNK(stat.st_mode) && !opt_walk_physical)
+ path = realpath(file, buffer);
+ else
+ path = (char *)file; /* not a symlink, use given path */
+
return path;
}

View File

@ -1,7 +1,7 @@
Summary: Access control list utilities Summary: Access control list utilities
Name: acl Name: acl
Version: 2.2.39 Version: 2.2.39
Release: 5%{?dist} Release: 6%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libattr-devel >= 2.4.1 BuildRequires: libattr-devel >= 2.4.1
Source: ftp://oss.sgi.com/projects/xfs/cmd_tars/acl_%{version}-1.tar.gz Source: ftp://oss.sgi.com/projects/xfs/cmd_tars/acl_%{version}-1.tar.gz
@ -9,6 +9,7 @@ Patch0: acl-2.2.3-multilib.patch
Patch1: acl-2.2.39-build.patch Patch1: acl-2.2.39-build.patch
Patch2: acl-2.2.39-path_max.patch Patch2: acl-2.2.39-path_max.patch
Patch3: acl-2.2.39-walk.patch Patch3: acl-2.2.39-walk.patch
Patch4: acl-2.2.39-exitcode.patch
BuildRequires: autoconf, libtool >= 1.5, gettext BuildRequires: autoconf, libtool >= 1.5, gettext
License: GPL License: GPL
Group: System Environment/Base Group: System Environment/Base
@ -47,6 +48,7 @@ defined in POSIX 1003.1e draft standard 17.
%patch1 -p1 -b .build %patch1 -p1 -b .build
%patch2 -p1 -b .path_max %patch2 -p1 -b .path_max
%patch3 -p1 -b .walk %patch3 -p1 -b .walk
%patch4 -p1 -b .exitcode
autoconf autoconf
%build %build
@ -102,6 +104,9 @@ rm -rf $RPM_BUILD_ROOT
/%{_lib}/libacl.so.* /%{_lib}/libacl.so.*
%changelog %changelog
* Thu Nov 8 2007 Jiri Moskovcak <jmoskovc@redhat.com> 2.2.39-6
- Fixed setfacl exitcodes
* Wed Nov 7 2007 Jiri Moskovcak <jmoskovc@redhat.com> 2.2.39-5 * Wed Nov 7 2007 Jiri Moskovcak <jmoskovc@redhat.com> 2.2.39-5
- New walk patch backported from upstream - better symlink handling - New walk patch backported from upstream - better symlink handling