aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Lécureuil <neoclust@mageia.org>2018-01-11 18:19:26 +0100
committerNicolas Lécureuil <neoclust@mageia.org>2018-01-11 18:19:26 +0100
commiteea83398deb651edac83b481393f441484c21b53 (patch)
tree6920eaac00c5ca1041b3a65667c3b92f1c327dc2
parenta3bc1fbf4f74dc9a15b24920e23e1d8cc5e3fc5b (diff)
downloaduserdrake-eea83398deb651edac83b481393f441484c21b53.tar
userdrake-eea83398deb651edac83b481393f441484c21b53.tar.gz
userdrake-eea83398deb651edac83b481393f441484c21b53.tar.bz2
userdrake-eea83398deb651edac83b481393f441484c21b53.tar.xz
userdrake-eea83398deb651edac83b481393f441484c21b53.zip
add patch to notify of existing home directory (mga#21333)
From Mike Rambo
-rw-r--r--NEWS2
-rwxr-xr-xuserdrake6
2 files changed, 8 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 17fbc17..9b0c06a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- add patch to notify of existing home directory (mga#21333)
+
Version 2.16 - 5 June 2017
- Translation updates
diff --git a/userdrake b/userdrake
index 2274013..9711db4 100755
--- a/userdrake
+++ b/userdrake
@@ -585,6 +585,12 @@ sub AddUser() {
$userEnt->Gid($u{gid});
$userEnt->ShadowMin(-1); $userEnt->ShadowMax(99999);
$userEnt->ShadowWarn(-1); $userEnt->ShadowInact(-1);
+ if ((-e $u{homedir}) && (-d $u{homedir})) {
+ my $keephomedir = $in->ask_yesorno(N("Home directory already exists"), N("The requested home directory already exists. Would you like to preserve the existing home directory?"));
+ if (!$keephomedir) {
+ return;
+ }
+ }
$ctx->UserAdd($userEnt, $is_system, $dontcreatehomedir, $homedir_perms);
$ctx->UserSetPass($userEnt, $u{passwd});
defined $us->{o}{iconval} and