Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5047

POSIX Exec throws error when group has no name

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 3.7.1, PUP 5.0.1
    • Fix Version/s: PUP 5.1.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Mac OS X 10.10.5
      Puppet 3.7.1 (code still seems evident on master)
      System Auth via LDAP

    • Template:
    • Team:
      Platform OS
    • Story Points:
      0
    • Sprint:
      Platform OS 2017-08-09, Platform OS 2017-08-22
    • Release Notes:
      Bug Fix
    • QA Risk Assessment:
      Manual

      Description

      If trying to execute with the group set to a group that has no name (just number), an error will be thrown:

      Bad file descriptor (Errno::EBADF)

      This occurs even if the group ID is passed in.

      Digging in, seems to be a failure in Puppet::Util::POSIX#gid. If I add a check to see if the group ID is an integer and skip this call, it skips this check and the exec works fine [1]

      This is reproducible with Etc.getgrgid, so not sure if it's an issue elsewhere. Overall though, if an integer is passed in as the group seems like we can just skip this altogether. It will remove intentional verification, but we will end up with an error regardless so I'm not sure that's a big issue.

      If it's agreed this is an issue, I'm happy to work up a proper PR.

      [1]: https://github.com/lstoll/puppet/commit/53efaffcb45fc165b12685f2085c1f732e4bfb9b

        Attachments

          Activity

            People

            • Assignee:
              erik Erik Dasher
              Reporter:
              lstoll Lincoln Stoll
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support