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