summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2005-06-29 00:48:14 +0000
committerAntoine Ginies <aginies@mandriva.com>2005-06-29 00:48:14 +0000
commit635bc85235c1a6a36f6528d73230c69e64afa2cb (patch)
tree9b6bbf72aaf085f580f08052d72ebbe37b3f15c8
parentdafa3d10ce8476b21cf28b8b2c8f2bf24259d303 (diff)
downloaddrakwizard-635bc85235c1a6a36f6528d73230c69e64afa2cb.tar
drakwizard-635bc85235c1a6a36f6528d73230c69e64afa2cb.tar.gz
drakwizard-635bc85235c1a6a36f6528d73230c69e64afa2cb.tar.bz2
drakwizard-635bc85235c1a6a36f6528d73230c69e64afa2cb.tar.xz
drakwizard-635bc85235c1a6a36f6528d73230c69e64afa2cb.zip
test if samba user exist (avoid remove an existing password)
-rwxr-xr-xsamba_wizard/Sambashare.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/samba_wizard/Sambashare.pm b/samba_wizard/Sambashare.pm
index 932db9a1..1c43f9a4 100755
--- a/samba_wizard/Sambashare.pm
+++ b/samba_wizard/Sambashare.pm
@@ -500,7 +500,9 @@ sub create_smbuser {
my ($list)= @_;
my @users = split(" ", $list);
foreach my $user (@users) {
- system("smbpasswd -a $user -n");
+ if (!any { /^$user:/ } cat_("/etc/samba/smbpasswd") ) {
+ system("smbpasswd -a $user -n");
+ }
}
}