wuyuoss / rpms / rpm

Forked from rpms/rpm 3 years ago
Clone
648606
--- rpm-4.8.0/build/files.c.defattr-permissions	2015-02-23 10:45:47.043339687 +0100
648606
+++ rpm-4.8.0/build/files.c	2015-02-23 10:53:55.673480702 +0100
648606
@@ -1446,6 +1446,12 @@
648606
 	    if (fl->def.ar.ar_dmodestr) {
648606
 		fileMode &= S_IFMT;
648606
 		fileMode |= fl->def.ar.ar_dmode;
648606
+	    } else if (fl->def.ar.ar_fmodestr){
648606
+		rpmlog(RPMLOG_WARNING, _("%%defattr doesn't define directory "
648606
+		    "mode so file mode defined in %%defattr is used for "
648606
+		    "directory: %s\n"), diskPath);
648606
+		fileMode &= S_IFMT;
648606
+		fileMode |= fl->def.ar.ar_fmode;
648606
 	    }
648606
 	} else if (!S_ISLNK(fileMode) && fl->def.ar.ar_fmodestr) {
648606
 	    fileMode &= S_IFMT;
648606