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

Can't create users using useradd provider when specifying uid since 6.8.0

    Details

    • Template:
      PUP Bug Template
    • Agent OS:
      Ubuntu 16.04 (i386, amd64)
    • Master OS:
      Ubuntu 16.04 (amd64)
    • Team:
      Coremunity
    • Sprint:
      Platform Core KANBAN
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Puppet could not execute commands with non-string arguments if the command was also marked as sensitive and the arguments were passed as an Array to the `execute` method. The issue is fixed for all providers, including the useradd provider.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet Version: 6.8.0
      Puppet Server Version: 6.4.0
      OS Name/Version: Ubuntu 18.04

      Creating a user specifying the UID (uses useradd provider automatically):

      user { 'test':   ...   uid => 123,}
      

      Desired Behavior:

      User is created with uid 123.

      Actual Behavior:

      Error: Could not create user test1: Execution of '[redacted]' returned 1: Error: Could not execute posix command: no implicit conversion of Integer into String

      Debugging showed the command as:

      ["/usr/sbin/useradd", "-c", "Test1", "-g", "users", "-d", "/home/test1", "-p", "removed", "-s", "/bin/tcsh", "-u", 123, "-m", "test1"]

      So I'm assuming the 123 argument there should be quoted.

      Suspect this is to do with this change, but can't see why:

      https://github.com/puppetlabs/puppet/commit/70d20329012fc986c3d130f5769cc644f248c1b0#diff-f5b9cc80dd02278d845d220721ac0217

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                josh Josh Cooper
                Reporter:
                tdb Tim Bishop
              • Votes:
                3 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support