revert: create maildir again

This commit is contained in:
Peter Hormanns 2022-12-28 20:42:08 +01:00
parent 6196c64ce2
commit ec0f777199

View File

@ -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" +
"\""
));
}
}