Uploaded image for project: 'VCL'
  1. VCL
  2. VCL-860

Linux.pm's create_user silently fails if vcl group does not exist

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.4, 2.4.1, 2.4.2
    • 2.5
    • vcld (backend)
    • None

    Description

      The Linux.pm::create_user subroutine could be improved. If the vcl user group does not exist, create_user does not successfully create the user but returns true. No useful output is displayed in vcld.log indicating the user was not created. The following error message is being generated by the command but not being caught or displayed:

      useradd: group 'vcl' does not exist
      

      Later on, the following is displayed in vcld.log when the code attempts to set the password of the non-existent user:

      chpasswd: (user arkurth) pam_chauthtok() failed, error:
      Authentication token manipulation error
      chpasswd: (line 1, user arkurth) password not changed
      

      This leads someone to try to troubleshoot a problem with the passwd command, even though the underlying problem is with sloppy code in create_user. This subroutine should be improved.

      Why is the vcl group even needed? This user group is not a default characteristic of the OS and is hard-coded in the VCL code – something which should be avoided. It would simplify things if the default user group named after the user is used. If we add features in the future allowing more elaborate user groups to be configured, the vcl user group is going to continue to be a nuisance.

      Attachments

        Activity

          People

            arkurth Andrew Kurth
            arkurth Andrew Kurth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: