You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry if the title isn't clear, but basically when an index record says that its data is of type, say, RPM_INT16_TYPE, the corresponding data should be interpreted as an unsigned integer, whereas currently the implementation interprets it as signed.
Anecdotally, I first realised this was an issue when I was using your library to test some RPMs I'm building with an automated tool. I wanted to verify the permissions on the files were being set right so I retrieved headers['filemodes'][x] and tried to use the stat functions on the value (the RPM spec says that filemodes should be identical to st_mode in struct stat). However I kept getting OverflowError: can't convert negative value to unsigned int which made me wonder if the values ought to be unsigned.
If I understand the issue correctly, it should be a small change to extract_int16 and extract_int32. I'll raise a PR shortly.
Sorry if the title isn't clear, but basically when an index record says that its data is of type, say,
RPM_INT16_TYPE
, the corresponding data should be interpreted as an unsigned integer, whereas currently the implementation interprets it as signed.Here is a reference to the RPM docs saying so: https://github.com/rpm-software-management/rpm/blob/master/docs/manual/tags.md#scalar-types
Additionally, if you look in the rpm C code, you can see there are a lot of references to headers using unsigned int values for data, and none using signed ints - for instance here: https://github.com/rpm-software-management/rpm/blob/master/include/rpm/header.h#L205
Anecdotally, I first realised this was an issue when I was using your library to test some RPMs I'm building with an automated tool. I wanted to verify the permissions on the files were being set right so I retrieved
headers['filemodes'][x]
and tried to use thestat
functions on the value (the RPM spec says thatfilemodes
should be identical tost_mode
instruct stat
). However I kept gettingOverflowError: can't convert negative value to unsigned int
which made me wonder if the values ought to be unsigned.If I understand the issue correctly, it should be a small change to
extract_int16
andextract_int32
. I'll raise a PR shortly.hello-2.12.1-2.fc39.x86_64.rpm.gz
The text was updated successfully, but these errors were encountered: