Commit 598b246b authored by Leigh Stoller's avatar Leigh Stoller

Set homedir to /var/empty when we deactivate the user.

parent b6f69ada
......@@ -382,7 +382,7 @@ sub DeactivateUser()
fatal("Could not set ZFS dir $zfsdir to mountpoint=none");
}
}
if (mysystem("$USERMOD $user -s $NOLOGIN")) {
if (mysystem("$USERMOD $user -d /var/empty -s $NOLOGIN")) {
fatal("Could not set shell to $NOLOGIN");
}
return 0;
......@@ -400,15 +400,18 @@ sub ReactivateUser()
fatal("reactivateuser: Wrong number of arguments");
}
my $user = shift(@ARGV);
my $hdir = USERROOT() . "/$user";
if ($WITHZFS) {
my $zfsdir = $ZFS_ROOT . USERROOT() . "/$user";
my $hdir = USERROOT() . "/$user";
if (ZFSexists($zfsdir) &&
mysystem("$ZFS set mountpoint=$hdir $zfsdir")) {
fatal("Could not set ZFS dir $zfsdir to mountpoint=$hdir");
}
}
if (mysystem("$USERMOD $user -d $hdir")) {
fatal("Could not set home directory back to $hdir");
}
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment