Fixed setfacl exitcodes

This commit is contained in:
Jiří Moskovčák 2007-11-08 13:56:28 +00:00
parent 448cce22e2
commit 84c71b1e27
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
+++ ../devel/acl-2.2.45/getfacl/getfacl.c 2007-11-07 09:53:50.000000000 +0100
--- acl-2.2.39/getfacl/getfacl.c.old 2007-11-08 14:38:56.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
char *resolve_symlinks(const char *file)
{
@ -27,3 +27,32 @@
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
Name: acl
Version: 2.2.39
Release: 11%{?dist}
Release: 12%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libattr-devel >= 2.4.1
BuildRequires: autoconf, libtool >= 1.5, gettext, gawk
@ -12,6 +12,7 @@ Patch2: acl-2.2.39-path_max.patch
Patch3: acl-2.2.39-walk.patch
Patch4: acl-2.2.39-params.patch
Patch5: acl-2.2.39-man.patch
Patch6: acl-2.2.39-exitcode.patch
License: GPL
Group: System Environment/Base
URL: http://oss.sgi.com/projects/xfs/
@ -52,6 +53,7 @@ defined in POSIX 1003.1e draft standard 17.
%patch3 -p1 -b .walk
%patch4 -p1 -b .params
%patch5 -p1 -b .man
%patch6 -p1 -b .exitcode
autoconf
%build
@ -107,6 +109,9 @@ rm -rf $RPM_BUILD_ROOT
/%{_lib}/libacl.so.*
%changelog
* Thu Nov 8 2007 Jiri Moskovcak <jmoskovc@redhat.com> 2.2.39-12
- Fixed setfacl exitcodes
* Wed Nov 7 2007 Jiri Moskovcak <jmoskovc@redhat.com> 2.2.39-11
- New walk patch backported from upstream