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

(-)SambaNetJoin.pm (-3 / +3 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 97-103 Link Here
97
	. ($protocol ne "ads" ? " -w '$domain'" : "")
97
	. ($protocol ne "ads" ? " -w '$domain'" : "")
98
	. " -s $conf_file"
98
	. " -s $conf_file"
99
	. (($protocol ne "ads" && $netbios_name)?" -n '$netbios_name'":"")
99
	. (($protocol ne "ads" && $netbios_name)?" -n '$netbios_name'":"")
100
	. " -U '" . ($user||"") . "%" . ($passwd||"") . "'";
100
	. " -U '" . String->Quote ($user) . "%" . String->Quote ($passwd) . "'";
101
101
102
    if ($machine) {
102
    if ($machine) {
103
	$machine	=~ s/dc=([^,]*)//gi; # remove DC=* parts
103
	$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");
144
    SCR->Write (".target.string", $conf_file, "[global]\n\trealm = $realm\n\tsecurity = ADS\n\tworkgroup = $domain\n");
145
145
146
    my $cmd = "net ads leave -s $conf_file"
146
    my $cmd = "net ads leave -s $conf_file"
147
	. " -U '" . ($user||"") . "%" . ($passwd||"") . "'";
147
	. " -U '" . String->Quote ($user) . "%" . String->Quote ($passwd) . "'";
148
148
149
    my $result = SCR->Execute(".target.bash_output", $cmd);
149
    my $result = SCR->Execute(".target.bash_output", $cmd);
150
    $cmd =~ s/(-U '[^%]*)%[^']*'/$1'/; # hide password in the log
150
    $cmd =~ s/(-U '[^%]*)%[^']*'/$1'/; # hide password in the log

Return to bug 396070