fixed #74
This commit is contained in:
parent
e280c2a192
commit
70633fc2c5
@ -56,13 +56,14 @@ public class UnixUserProcessorFactory implements EntityProcessorFactory {
|
||||
UnixUser user = (UnixUser) entity;
|
||||
String uid = user.getName();
|
||||
if (uid != null && uid.length() > 4) {
|
||||
Processor killProcessesProc = new ShellProcessor("killall -u " + uid);
|
||||
Processor userdelProc = null;
|
||||
if (user.isDefaultHomedir()) {
|
||||
userdelProc = new ShellProcessor("userdel " + uid + " && rm -rf '" + user.getHomedir() + "'");
|
||||
} else {
|
||||
userdelProc = new ShellProcessor("userdel " + uid);
|
||||
}
|
||||
CompoundProcessor proc = new CompoundProcessor(userdelProc);
|
||||
CompoundProcessor proc = new CompoundProcessor(killProcessesProc, userdelProc);
|
||||
proc.appendProcessor(new ShellProcessor("rm -f '/var/spool/cron/crontabs/" + uid + "'"));
|
||||
proc.appendProcessor(new ShellProcessor("rm -f '/var/mail/" + uid + "'"));
|
||||
return proc;
|
||||
|
Loading…
Reference in New Issue
Block a user