Skip to content

Commit

Permalink
Fix special %doc and %license %defattr() dir permissions (RhBug:1399798)
Browse files Browse the repository at this point in the history
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 README.md" 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 bde88ad
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion build/files.c
Expand Up @@ -2207,7 +2207,6 @@ static void processSpecialDir(rpmSpec spec, Package pkg, FileList fl,
FileEntryFree(&fl->cur); FileEntryFree(&fl->cur);
FileEntryFree(&fl->def); FileEntryFree(&fl->def);
copyFileEntry(&sd->entries[0].defEntry, &fl->def); copyFileEntry(&sd->entries[0].defEntry, &fl->def);
copyFileEntry(&sd->entries[0].defEntry, &fl->cur);
fl->cur.isDir = 1; fl->cur.isDir = 1;
(void) processBinaryFile(pkg, fl, sd->dirname); (void) processBinaryFile(pkg, fl, sd->dirname);


Expand Down

0 comments on commit bde88ad

Please sign in to comment.