Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chown() does not handle UID > INT_MAX #45186

Closed
owsla mannequin opened this issue Jul 12, 2007 · 2 comments
Closed

chown() does not handle UID > INT_MAX #45186

owsla mannequin opened this issue Jul 12, 2007 · 2 comments
Labels
extension-modules C modules in the Modules dir

Comments

@owsla
Copy link
Mannequin

owsla mannequin commented Jul 12, 2007

BPO 1752703
Nosy @birkenfeld
Superseder
  • bpo-1747858: chown broken on 64bit
  • Files
  • chown_fix.patch: Use unsigned int instead of int in chown()
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2007-08-23.18:49:43.258>
    created_at = <Date 2007-07-12.15:16:35.000>
    labels = ['extension-modules']
    title = 'chown() does not handle UID > INT_MAX'
    updated_at = <Date 2007-08-23.18:49:43.256>
    user = 'https://bugs.python.org/owsla'

    bugs.python.org fields:

    activity = <Date 2007-08-23.18:49:43.256>
    actor = 'georg.brandl'
    assignee = 'none'
    closed = True
    closed_date = <Date 2007-08-23.18:49:43.258>
    closer = 'georg.brandl'
    components = ['Extension Modules']
    creation = <Date 2007-07-12.15:16:35.000>
    creator = 'owsla'
    dependencies = []
    files = ['8095']
    hgrepos = []
    issue_num = 1752703
    keywords = ['patch']
    message_count = 2.0
    messages = ['52865', '55179']
    nosy_count = 2.0
    nosy_names = ['georg.brandl', 'owsla']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = '1747858'
    type = None
    url = 'https://bugs.python.org/issue1752703'
    versions = []

    @owsla
    Copy link
    Mannequin Author

    owsla mannequin commented Jul 12, 2007

    On at least some Unix platforms, uid_t and gid_t are mapped to unsigned int. Python parses the values for chown() into signed ints. This causes an exception when a UID is greater than INT_MAX.

    For a few releases now, 64-bit Fedora has used UINT_MAX-1 as the UID of the nfsnobody user. Python programs chown'ing to the nfsnobody user encounter this problem.

    The fix is only two lines and is attached. This issue is also documented in Bug 1747858.

    @owsla owsla mannequin added extension-modules C modules in the Modules dir labels Jul 12, 2007
    @birkenfeld
    Copy link
    Member

    Closing, superseder has more information and same patch.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant