Bug 15194 - pysmbd uses python "i" to covert gid to a gid_t type, but this is unsigned on linux
Summary: pysmbd uses python "i" to covert gid to a gid_t type, but this is unsigned on...
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Python (show other bugs)
Version: 4.17.0
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Douglas Bagnall
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-07 00:35 UTC by Andrew Bartlett
Modified: 2022-10-07 00:35 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Bartlett 2022-10-07 00:35:28 UTC
While gid values > INT_MAX are unlikely, we should convert as an unsigned integer with correct range checking, coping with gid_t being unsigned or signed and of any bit length, rather than mapping as a C "int".

We also need to allow this to be unspecified, and have a safe default value. 

uid_t and gid_t are used in a few different functions here, all need to be checked.

See the PIDL python range handling for an example of trying to get this right in pidl/lib/Parse/Pidl/Samba4/Python.pm