Author: locilka Date: Mon Dec 1 13:48:08 2008 New Revision: 53768 URL: http://svn.opensuse.org/viewcvs/yast?rev=53768&view=rev Log: - Using temporary file for pdbedit calls instead of stdin because pdbedit reads the input several times for one call (bnc #438481). - 2.17.6 Modified: trunk/samba-server/VERSION trunk/samba-server/package/yast2-samba-server.changes trunk/samba-server/src/SambaAccounts.pm Modified: trunk/samba-server/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-server/VERSION?rev=53768&r1=53767&r2=53768&view=diff ============================================================================== --- trunk/samba-server/VERSION (original) +++ trunk/samba-server/VERSION Mon Dec 1 13:48:08 2008 @@ -1 +1 @@ -2.17.5 +2.17.6 Modified: trunk/samba-server/package/yast2-samba-server.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-server/package/yast2-samba-server.changes?rev=53768&r1=53767&r2=53768&view=diff ============================================================================== --- trunk/samba-server/package/yast2-samba-server.changes (original) +++ trunk/samba-server/package/yast2-samba-server.changes Mon Dec 1 13:48:08 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Dec 1 13:45:39 CET 2008 - locilka@suse.cz + +- Using temporary file for pdbedit calls instead of stdin because + pdbedit reads the input several times for one call (bnc #438481). +- 2.17.6 + +------------------------------------------------------------------- Thu Nov 6 18:05:57 CET 2008 - locilka@suse.cz - Using new service:samba-server firewall service (bnc #247344). Modified: trunk/samba-server/src/SambaAccounts.pm URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-server/src/SambaAccounts.pm?rev=53768&r1=53767&r2=53768&view=diff ============================================================================== --- trunk/samba-server/src/SambaAccounts.pm (original) +++ trunk/samba-server/src/SambaAccounts.pm Mon Dec 1 13:48:08 2008 @@ -23,6 +23,8 @@ BEGIN { YaST::YCP::Import("SCR"); +YaST::YCP::Import("FileUtils"); +YaST::YCP::Import("Directory"); } my %Pdb = (); @@ -41,6 +43,8 @@ BEGIN{$TYPEINFO{Write}=["function","boolean"]} sub Write { my $error = 0; + my $tmpfile = Directory->tmpdir()."/samba-server-pdbedit-tmpfile"; + foreach my $user (keys %Pdb) { my $nthash = $Pdb{$user}{nthash}; $nthash = "X"x32 unless $nthash; @@ -59,13 +63,23 @@ y2debug("add user '$user'"); my $smbpasswd=sprintf "%s:%d:%s:%s:[%-11s]:LCT-%08X\n", $user, $uid, $lmhash, $nthash, "U", time; - my $cmd = "echo '$smbpasswd' | pdbedit -i smbpasswd:/dev/stdin"; + + y2milestone ("Writing user (".$user.") settings to: ".$tmpfile); + SCR->Write (".target.string", $tmpfile, $smbpasswd); + + my $cmd = "pdbedit -i smbpasswd:$tmpfile"; if (SCR->Execute(".target.bash", $cmd)) { y2error("Failed to execute '$cmd'"); $error = 1; next; } } + + if (FileUtils->Exists ($tmpfile)) { + y2milestone ("Removing temporary file: ".$tmpfile); + SCR->Execute (".target.remove", $tmpfile); + } + return $error == 0; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org