Skip to content

chown() does not handle UID > INT_MAX #45186

Closed

Description

@owsla
mannequin
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 = []

    Activity

    1. owsla commented on Jul 12, 2007

      owslamannequin
      MannequinAuthor

      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.

    2. added
      extension-modules
      on Jul 12, 2007
    3. birkenfeld commented on Aug 23, 2007

      @birkenfeld
      Member

      Closing, superseder has more information and same patch.

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      extension-modules

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions