From ec0f777199c092807a5ffc9ed288f811c9e30648 Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Wed, 28 Dec 2022 20:42:08 +0100 Subject: [PATCH] revert: create maildir again --- .../mods/user/UnixUserProcessorFactory.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hsarback/src/de/hsadmin/mods/user/UnixUserProcessorFactory.java b/hsarback/src/de/hsadmin/mods/user/UnixUserProcessorFactory.java index e04a838..737b269 100644 --- a/hsarback/src/de/hsadmin/mods/user/UnixUserProcessorFactory.java +++ b/hsarback/src/de/hsadmin/mods/user/UnixUserProcessorFactory.java @@ -27,6 +27,8 @@ public class UnixUserProcessorFactory implements EntityProcessorFactory { + user.getUserId() + ":" + user.getPac().getName() + ":" + user.getComment() + ":" + user.getHomedir() + ":" + user.getShell() + "\n")); + appendSetHomeACLProcessor(aCP, user); + appendMakeMaildirProcessor(aCP, user); aCP.appendProcessor(new ShellProcessor("salt-call state.sls pacs >/dev/null 2>&1")); return aCP; } @@ -74,4 +76,17 @@ public class UnixUserProcessorFactory implements EntityProcessorFactory { return null; } + private void appendSetHomeACLProcessor(CompoundProcessor aCP, UnixUser user) { + aCP.appendProcessor(new ShellProcessor("chmod 700 " + user.getHomedir())); + } + + private void appendMakeMaildirProcessor(CompoundProcessor aCP, UnixUser user) { + aCP.appendProcessor( + new ShellProcessor( + "su -l " + user.getName() + " -s \"/bin/bash\" -c \"maildirmake " + + user.getHomedir() + "/Maildir" + + "\"" + )); + } + }