From 1f3fede16846d80124ecbeac1cb607f6dfa7e13a Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Sun, 10 Sep 2023 05:00:46 +0000 Subject: automatic import of rpm --- ...-wrong-symlink-length-on-some-filesystems.patch | 45 ---------------------- 1 file changed, 45 deletions(-) delete mode 100644 backport-bugfix-wrong-symlink-length-on-some-filesystems.patch (limited to 'backport-bugfix-wrong-symlink-length-on-some-filesystems.patch') diff --git a/backport-bugfix-wrong-symlink-length-on-some-filesystems.patch b/backport-bugfix-wrong-symlink-length-on-some-filesystems.patch deleted file mode 100644 index 5de4522..0000000 --- a/backport-bugfix-wrong-symlink-length-on-some-filesystems.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 4c301883a5a94a9a186a1bb1d45d234db4db7c88 Mon Sep 17 00:00:00 2001 -From: Dominik Neudert-Schulz -Date: Wed, 30 Jun 2021 14:13:46 +0200 -Subject: [PATCH] fix rpmbuild failure because of wrong symlink length on some - filesystems - ---- - build/files.c | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/build/files.c b/build/files.c -index f8153ad2b5..571b502e91 100644 ---- a/build/files.c -+++ b/build/files.c -@@ -1363,6 +1363,8 @@ static rpmRC addFile(FileList fl, const char * diskPath, - { - size_t plen = strlen(diskPath); - char buf[plen + 1]; -+ char linkPath[PATH_MAX]; -+ ssize_t linkLen; - const char *cpioPath; - struct stat statbuf; - mode_t fileMode; -@@ -1459,6 +1461,20 @@ static rpmRC addFile(FileList fl, const char * diskPath, - fileUid = statp->st_uid; - fileGid = statp->st_gid; - -+ if (S_ISLNK(fileMode)) { -+ /* stat's man page states that statp->st_size should equal the length of -+ the pointed-to path. On some filesystem a wrong size is reported. -+ So, explicitly get the length here. */ -+ linkLen = readlink(diskPath, linkPath, sizeof(linkPath)); -+ if ((linkLen < 0) || (linkLen >= sizeof(linkPath))) { -+ rpmlog(RPMLOG_ERR, -+ "Symbolic link too long or corrupt: %s\n", -+ diskPath); -+ goto exit; -+ } -+ statp->st_size = linkLen; -+ } -+ - /* Explicit %attr() always wins */ - if (fl->cur.ar.ar_fmodestr) { - if (S_ISLNK(fileMode)) { - -- cgit v1.2.3