Update to 3.0.5.4p2 broke Shell Users

Discussion in 'General' started by snowfly, Aug 8, 2014.

  1. snowfly

    snowfly Member

    A recent update to 3.0.5.4p2 on all our ISPConfig servers in a multi-server environment appears to have broken creating and updating shell users.

    When creating shell users, I get message:
    Code:
    08.08.2014-13:41 - WARNING - Shell user must not be root or in group root. 
    After some investigation, this error is returned from within function is_allowed_user(), in file: /usr/local/ispconfig/server/lib/classes/system.inc.php

    And the following line was causing the problem:
    Code:
    if(preg_match('/^[a-zA-Z0-9\.\-]{1,32}$/', $username) == false) return false;
    Because in our ISPConfig setup, we have the Shell user prefix set to:
    Code:
    ssh[CLIENTID]_
    (and our other prefixes also have underscores)

    So shell users are created like: ssh1234_bob

    The preg_match code above does not allow underscores, so now if we try to create a new SSH user on any server, or update any existing user, we get an error.

    Adding an underscore to the preg_match pattern solved the issue:
    Code:
    if(preg_match('/^[a-zA-Z0-9\.\-_]{1,32}$/', $username) == false) return false;
    Although now we have to make this manual fix across all our ISPConfig servers (over 20 servers).

    Can this please be updated for the next release?
    Thanks
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

Share This Page