diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-09-10 05:00:46 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-09-10 05:00:46 +0000 |
| commit | 1f3fede16846d80124ecbeac1cb607f6dfa7e13a (patch) | |
| tree | 705a865eb505036c0433cd3aae7e2c1f8fb24a10 /backport-bugfix-wrong-symlink-length-on-some-filesystems.patch | |
| parent | ace4b47f753a0aa3fe0a01808b658bc4e936d0a7 (diff) | |
automatic import of rpmopeneuler22.03_LTS
Diffstat (limited to 'backport-bugfix-wrong-symlink-length-on-some-filesystems.patch')
| -rw-r--r-- | backport-bugfix-wrong-symlink-length-on-some-filesystems.patch | 45 |
1 files changed, 0 insertions, 45 deletions
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 <dominikns@bachtechnology.com> -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)) { - |
