Author: jsuchome
Date: Wed Apr 9 16:05:13 2008
New Revision: 46292
URL: http://svn.opensuse.org/viewcvs/yast?rev=46292&view=rev
Log:
- enable specifying of the machine account (fate#301320)
- 2.16.4
Modified:
trunk/samba-client/VERSION
trunk/samba-client/package/yast2-samba-client.changes
trunk/samba-client/src/SambaAD.pm
trunk/samba-client/src/SambaNetJoin.pm
trunk/samba-client/src/routines.ycp
trunk/samba-client/src/samba-client.ycp
Modified: trunk/samba-client/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/VERSION?rev=46292&r1=46291&r2=46292&view=diff
==============================================================================
--- trunk/samba-client/VERSION (original)
+++ trunk/samba-client/VERSION Wed Apr 9 16:05:13 2008
@@ -1 +1 @@
-2.16.3
+2.16.4
Modified: trunk/samba-client/package/yast2-samba-client.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/package/yast2-samba-client.changes?rev=46292&r1=46291&r2=46292&view=diff
==============================================================================
--- trunk/samba-client/package/yast2-samba-client.changes (original)
+++ trunk/samba-client/package/yast2-samba-client.changes Wed Apr 9 16:05:13 2008
@@ -1,4 +1,15 @@
-------------------------------------------------------------------
+Wed Apr 9 15:27:32 CEST 2008 - jsuchome@suse.cz
+
+- enable specifying of the machine account (fate#301320)
+- 2.16.4
+
+-------------------------------------------------------------------
+Wed Apr 2 11:28:21 CEST 2008 - jsuchome@suse.cz
+
+- enable single sign-on for SSH (fate #303415)
+
+-------------------------------------------------------------------
Fri Mar 28 12:52:34 CET 2008 - jsuchome@suse.cz
- do not check for required packages during Read (bnc#374703)
Modified: trunk/samba-client/src/SambaAD.pm
URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/src/SambaAD.pm?rev=46292&r1=46291&r2=46292&view=diff
==============================================================================
--- trunk/samba-client/src/SambaAD.pm (original)
+++ trunk/samba-client/src/SambaAD.pm Wed Apr 9 16:05:13 2008
@@ -36,6 +36,43 @@
# Kerberos realm for AD
my $realm = "";
+# Read the list of available machine accounts in the current domain
+#
+# @param domain AD domain
+# @param user user name
+# @param password password
+# @return list
+BEGIN{$TYPEINFO{GetMachines}= [
+ "function", ["list","string"], "string", "string", "string"]}
+sub GetMachines {
+
+ my ($self, $domain, $user, $passwd) = @_;
+ my @ret = ();
+
+ my $tmpdir = SCR->Read (".target.tmpdir");
+ my $conf_file = $tmpdir."/smb.conf";
+ my $cmd = "net ads search \"(objectclass=organizationalUnit)\" distinguishedName -s $conf_file -U '$user%". ($passwd||"") . "'";
+
+ SCR->Write (".target.string", $conf_file, "[global]\n\trealm = $realm\n\tsecurity = ADS\n\tworkgroup = $domain\n");
+
+ my $result = SCR->Execute(".target.bash_output", $cmd);
+
+ if ($result->{"exit"} eq 0) {
+ foreach my $line (split (/\n/,$result->{"stdout"} || "")) {
+ if ($line =~ m/^distinguishedName:/) {
+ my $dn = $line;
+ $dn =~ s/^distinguishedName:([\t ]*)//g;
+ push @ret, $dn if $dn;
+ }
+ }
+ }
+ else {
+ $cmd =~ s/(-U '[^%]*)%[^']*'/$1'/; # hide password in the log
+ y2warning ("$cmd failed: ".Dumper($result));
+ return undef;
+ }
+ return \@ret;
+}
# Check if a given workgroup is a Active Directory domain and return the name
# of AD domain controler
Modified: trunk/samba-client/src/SambaNetJoin.pm
URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/src/SambaNetJoin.pm?rev=46292&r1=46291&r2=46292&view=diff
==============================================================================
--- trunk/samba-client/src/SambaNetJoin.pm (original)
+++ trunk/samba-client/src/SambaNetJoin.pm Wed Apr 9 16:05:13 2008
@@ -66,11 +66,13 @@
# @param domain a name of a domain to be joined
# @param join_level level of a domain membership when joining ("member", "bdc" or "pdc")
# @param user username to be used for joining, or nil for anonymous
-# @param passwd password for the user
+# @param passwd password for the user
+# @param machine machine account to join into (fate 301320)
# @return string an error message or nil if successful
-BEGIN{$TYPEINFO{Join}=["function","string","string","string","string","string"]}
+BEGIN{$TYPEINFO{Join}=[
+ "function","string","string","string","string","string","string"]}
sub Join {
- my ($self, $domain, $join_level, $user, $passwd) = @_;
+ my ($self, $domain, $join_level, $user, $passwd, $machine) = @_;
my $netbios_name = SambaConfig->GlobalGetStr("netbios name", undef);
my $server = SambaAD->ADS ();
@@ -97,6 +99,8 @@
. (($protocol ne "ads" && $netbios_name)?" -n '$netbios_name'":"")
. " -U '" . ($user||"") . "%" . ($passwd||"") . "'";
+ $cmd = $cmd. " -createcomputer=\"$machine\"" if $machine;
+
my $result = SCR->Execute(".target.bash_output", $cmd);
$cmd =~ s/(-U '[^%]*)%[^']*'/$1'/; # hide password in debug
y2internal("$cmd => ".Dumper($result));
Modified: trunk/samba-client/src/routines.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/samba-client/src/routines.ycp?rev=46292&r1=46291&r2=46292&view=diff
==============================================================================
--- trunk/samba-client/src/routines.ycp (original)
+++ trunk/samba-client/src/routines.ycp Wed Apr 9 16:05:13 2008
@@ -30,34 +30,92 @@
* Allow user to type in a user/password pair in a popup.
*
* @param message a text to be displayed above the password text entry
- * @param defaultuser a pre-filled user name
+ * @param defaultuser a pre-filled user name
* @return map