Browse files

Fix special %doc and %license %defattr() dir permissions (RhBug:1399798)

Fixes regression from commit 877d5b1 which
broke directory permissions on special %doc and %license directories
due to this cpe/thinko/typo:
    +    copyFileEntry(&sd->entries[0].defEntry, &fl->def);
    +    copyFileEntry(&sd->entries[0].defEntry, &fl->cur);

However there's an added twist involved: the first special doc/license
entry from which the current attrs are copied is a *file*, so if you
have eg "%attr(444,-,-) %doc" as the first special %doc,
the directory ends up inaccessible because it inherits the file
permissions. This is much much older behavior, probably about as old as
rpm itself...

Anyway, since we now *can*, the right thing to do seems to be just not
copying the current attrs for the special doc/license *directory* at all.
There's no associated %files line with the directory either, so it makes
sense that only the defaults are applied..
  • Loading branch information...
pmatilai committed Nov 30, 2016
1 parent 4c53e57 commit bde88ada3a0fbd17f9b5db9fb5426eb0f1ff5efd
Showing with 0 additions and 1 deletion.
  1. +0 −1 build/files.c
@@ -2207,7 +2207,6 @@ static void processSpecialDir(rpmSpec spec, Package pkg, FileList fl,
copyFileEntry(&sd->entries[0].defEntry, &fl->def);
copyFileEntry(&sd->entries[0].defEntry, &fl->cur);
fl->cur.isDir = 1;
(void) processBinaryFile(pkg, fl, sd->dirname);

0 comments on commit bde88ad

Please sign in to comment.