From 9195fb3c98716a623a482b35e346bddef074c492 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Mon, 12 Apr 2021 09:37:36 +0200 Subject: [PATCH] additionally sort by length of username for libnss-extrausers passwd file to have the main user as first in result in any case; fixes #933 Signed-off-by: Michael Kaufmann --- lib/Froxlor/Cron/System/Extrausers.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Froxlor/Cron/System/Extrausers.php b/lib/Froxlor/Cron/System/Extrausers.php index 74f1aea5..e3029be7 100644 --- a/lib/Froxlor/Cron/System/Extrausers.php +++ b/lib/Froxlor/Cron/System/Extrausers.php @@ -24,7 +24,7 @@ class Extrausers { // passwd $passwd = '/var/lib/extrausers/passwd'; - $sql = "SELECT customerid,username,'x' as password,uid,gid,'Froxlor User' as comment,homedir,shell, login_enabled FROM ftp_users ORDER BY uid ASC"; + $sql = "SELECT customerid,username,'x' as password,uid,gid,'Froxlor User' as comment,homedir,shell, login_enabled FROM ftp_users ORDER BY uid, LENGTH(username) ASC"; self::generateFile($passwd, $sql, $cronlog); // group