ls: upstream fix - correctly show symlinks in /

This commit is contained in:
Ondřej Vašík 2012-05-11 21:19:04 +02:00
parent 315471e18a
commit bfd5cf1204
2 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,21 @@
diff -urNp coreutils-8.17-orig/src/ls.c coreutils-8.17/src/ls.c
--- coreutils-8.17-orig/src/ls.c 2012-05-11 20:59:01.467946060 +0200
+++ coreutils-8.17/src/ls.c 2012-05-11 21:00:38.276821883 +0200
@@ -3206,14 +3206,9 @@ make_link_name (char const *name, char const *linkname)
if (IS_ABSOLUTE_FILE_NAME (linkname))
return xstrdup (linkname);
- /* The link is to a relative name. Prepend any leading directory
- in 'name' to the link name. */
- size_t prefix_len = dir_len (name);
- if (prefix_len == 0)
- return xstrdup (linkname);
-
- char *p = xmalloc (prefix_len + 1 + strlen (linkname) + 1);
- stpcpy (stpncpy (p, name, prefix_len + 1), linkname);
+ char *d = dir_name (name);
+ char *p = file_name_concat (d, linkname, NULL);
+ free (d);
return p;
}

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.17
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@ -18,6 +18,7 @@ Source202: coreutils-su-l.pamd
Source203: coreutils-runuser-l.pamd
# From upstream
Patch1: coreutils-8.17-ls-rootdir-symlink.patch
# Our patches
#general patch to workaround koji build system issues
@ -143,6 +144,7 @@ the old GNU fileutils, sh-utils, and textutils packages.
%setup -q
# From upstream
%patch1 -p1 -b .roodirsymlink
# Our patches
%patch100 -p1 -b .configure
@ -416,6 +418,9 @@ fi
%{?!norunuser:%{_sbindir}/runuser}
%changelog
* Fri May 11 2012 Ondrej Vasik <ovasik@redhat.com> 8.17-2
- ls: upstream fix - correctly show symlinks in /
* Fri May 11 2012 Ondrej Vasik <ovasik@redhat.com> 8.17-1
- new upstream release 8.17