If there are no hardlinks, dont bother with s-bit and caps removal
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 11 Jun 2010 05:17:12 +0000 (08:17 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 11 Jun 2010 08:48:14 +0000 (11:48 +0300)
(cherry picked from commit 89be57ad9239c9ada0cba94a5003876b456d46bf)

lib/fsm.c

index 7cdefab..22db47a 100644 (file)
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -1323,7 +1323,7 @@ static const char * rpmteTypeString(rpmte te)
 static void removeSBITS(const char *path)
 {
     struct stat stb;
-    if (lstat(path, &stb) == 0 && S_ISREG(stb.st_mode)) {
+    if (lstat(path, &stb) == 0 && S_ISREG(stb.st_mode) && stb.st_nlink > 1) {
        if ((stb.st_mode & 06000) != 0) {
            (void) chmod(path, stb.st_mode & 0777);
        }