Created attachment 1394823 [details] bug_reproducer.py Description of problem: When add_permission_file method is called with parameter mode=0755 the created RPM file does not honor this file permission mode. It is possible that this is happening only for .so lib file. Version-Release number of selected component (if applicable): 0.5.3-2.fc28 How reproducible: Always Steps to Reproduce: 1. Run my reproducer (where the mode="0755" parameter is used) 2. Look inside of the created RPM file to see that the .so file is not executable Actual results: The foo.so library inside is not executable even when the mode is set to 0755. Expected results: The foo.so library should be executable. Additional info: This is happening only on Rawhide. It is working correctly on Fedora 27 and before.
Looking into test-rpmbuild-test-1.0-1/LOGS/x86_64/build.log, there is: [...] + /usr/lib/rpm/redhat/brp-mangle-shebangs *** WARNING: ./usr/lib/fun.so is executable but has empty or no shebang, removing executable bit Processing files: test-1.0-1.x86_64 [...] so I assume build process just become "smarter" in Rawhide. I thought t could be resolved with: --- bz1544361.py.ORIG 2018-02-13 21:53:57.718403384 +0100 +++ bz1544361.py 2018-02-13 22:00:38.001926208 +0100 @@ -1,12 +1,12 @@ #!/bin/python3 -from rpmfluff import SimpleRpmBuild, SourceFile +from rpmfluff import SimpleRpmBuild, GeneratedSourceFile, make_elf p = SimpleRpmBuild("test", "1.0", "1") p.add_installed_file("/usr/lib/fun.so", - SourceFile("fun.so", "Content of the library"), + GeneratedSourceFile("fun.so", make_elf()), mode="0755") p.make() but looks like it still do not fool rpmbuild sufficiently...
Hmm, had to improve our faked ELF file header a bit: https://pagure.io/rpmfluff/c/d5db46219051aa32bdcd17a8e05bdedf3ec72520?branch=master
Built into Rawhide: https://koji.fedoraproject.org/koji/taskinfo?taskID=25018946