provide lingering flag

This commit is contained in:
Peter Hormanns 2022-12-15 12:37:43 +01:00
parent f8870d2575
commit 53d496da4c

View File

@ -207,6 +207,10 @@ public class JsonPillarServlet extends HttpServlet {
final UnixUser user = sortedUsersMap.get(nextName);
final String fullUsername = user.getName();
boolean isDomainAdmin = domainadmins.contains(fullUsername);
final String shell = user.getShell();
boolean isLingering = "/bin/bash".equals(shell) || "/bin/dash".equals(shell)
|| "/bin/sh".equals(shell) || "/bin/zsh".equals(shell) || "/bin/tcsh".equals(shell) || "/bin/csh".equals(shell)
|| "/usr/bin/zsh".equals(shell) || "/usr/bin/tcsh".equals(shell);
if (firstLoopUsers) {
firstLoopUsers = false;
writer.println(" {");
@ -225,6 +229,7 @@ public class JsonPillarServlet extends HttpServlet {
writer.println(" , \"storage_soft\": " + user.getStorageSoftlimit());
writer.println(" , \"storage_hard\": " + user.getStorageHardlimit());
writer.println(" , \"is_domainadmin\": " + Boolean.toString(isDomainAdmin).toLowerCase());
writer.println(" , \"is_lingering\": " + Boolean.toString(isLingering).toLowerCase());
writer.println(" , \"has_maildir\": " + Boolean.toString(true).toLowerCase());
writer.println(" }");
}