View | Details | Raw Unified | Return to bug 396070
Collapse All | Expand All

(-)SambaNetJoin.pm (-3 / +4 lines)
Lines 12-18 Link Here
12
use strict;
12
use strict;
13
use Data::Dumper;
13
use Data::Dumper;
14
14
15
use YaST::YCP qw(:DATA :LOGGING);
15
use YaST::YCP qw(:LOGGING);
16
use YaPI;
16
use YaPI;
17
17
18
textdomain "samba-client";
18
textdomain "samba-client";
Lines 21-26 Link Here
21
YaST::YCP::Import("SCR");
21
YaST::YCP::Import("SCR");
22
YaST::YCP::Import("SambaConfig");
22
YaST::YCP::Import("SambaConfig");
23
YaST::YCP::Import("SambaAD");
23
YaST::YCP::Import("SambaAD");
24
YaST::YCP::Import("String");
24
25
25
my %TestJoinCache;
26
my %TestJoinCache;
26
27
Lines 97-103 Link Here
97
	. ($protocol ne "ads" ? " -w '$domain'" : "")
98
	. ($protocol ne "ads" ? " -w '$domain'" : "")
98
	. " -s $conf_file"
99
	. " -s $conf_file"
99
	. (($protocol ne "ads" && $netbios_name)?" -n '$netbios_name'":"")
100
	. (($protocol ne "ads" && $netbios_name)?" -n '$netbios_name'":"")
100
	. " -U '" . ($user||"") . "%" . ($passwd||"") . "'";
101
	. " -U '" . String->Quote ($user) . "%" . String->Quote ($passwd) . "'";
101
102
102
    if ($machine) {
103
    if ($machine) {
103
	$machine	=~ s/dc=([^,]*)//gi; # remove DC=* parts
104
	$machine	=~ s/dc=([^,]*)//gi; # remove DC=* parts
Lines 144-150 Link Here
144
    SCR->Write (".target.string", $conf_file, "[global]\n\trealm = $realm\n\tsecurity = ADS\n\tworkgroup = $domain\n");
145
    SCR->Write (".target.string", $conf_file, "[global]\n\trealm = $realm\n\tsecurity = ADS\n\tworkgroup = $domain\n");
145
146
146
    my $cmd = "net ads leave -s $conf_file"
147
    my $cmd = "net ads leave -s $conf_file"
147
	. " -U '" . ($user||"") . "%" . ($passwd||"") . "'";
148
	. " -U '" . String->Quote ($user) . "%" . String->Quote ($passwd) . "'";
148
149
149
    my $result = SCR->Execute(".target.bash_output", $cmd);
150
    my $result = SCR->Execute(".target.bash_output", $cmd);
150
    $cmd =~ s/(-U '[^%]*)%[^']*'/$1'/; # hide password in the log
151
    $cmd =~ s/(-U '[^%]*)%[^']*'/$1'/; # hide password in the log

Return to bug 396070