Hello community,
here is the log from the commit of package yast2-samba-server
checked in at Tue Apr 17 00:29:19 CEST 2007.
--------
--- yast2-samba-server/yast2-samba-server.changes 2007-04-11 16:07:28.000000000 +0200
+++ /mounts/work_src_done/NOARCH/yast2-samba-server/yast2-samba-server.changes 2007-04-16 12:56:26.000000000 +0200
@@ -1,0 +2,15 @@
+Mon Apr 16 12:55:40 CEST 2007 - locilka@suse.cz
+
+- Added possibility to rename a share (#263302).
+- 2.15.6
+
+-------------------------------------------------------------------
+Fri Apr 13 08:42:27 CEST 2007 - locilka@suse.cz
+
+- Disabling MySQL passdb backend which has not support in smb.conf
+- Adjusting UI to allow set only one passdb backend
+- Allowing multiple ldap-server entries in ldapsam backend
+- Better parsing of passdb backend in SambaBackend module
+- Better parsing of passdb backend in SambaBackendLDAP
+
+-------------------------------------------------------------------
Old:
----
yast2-samba-server-2.15.5.tar.bz2
New:
----
yast2-samba-server-2.15.6.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-samba-server.spec ++++++
--- /var/tmp/diff_new_pack.t23835/_old 2007-04-17 00:29:01.000000000 +0200
+++ /var/tmp/diff_new_pack.t23835/_new 2007-04-17 00:29:01.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-samba-server (Version 2.15.5)
+# spec file for package yast2-samba-server (Version 2.15.6)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,12 +11,12 @@
# norootforbuild
Name: yast2-samba-server
-Version: 2.15.5
+Version: 2.15.6
Release: 1
License: GNU General Public License (GPL)
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-samba-server-2.15.5.tar.bz2
+Source0: yast2-samba-server-2.15.6.tar.bz2
prefix: /usr
BuildRequires: libsmbclient libsmbclient-devel perl-Crypt-SmbHash perl-X500-DN perl-XML-Writer samba-client update-desktop-files yast2 yast2-devtools yast2-ldap-client yast2-perl-bindings yast2-samba-client yast2-testsuite yast2-users
Requires: perl-Crypt-SmbHash
@@ -41,7 +41,7 @@
Lukas Ocilka
%prep
-%setup -n yast2-samba-server-2.15.5
+%setup -n yast2-samba-server-2.15.6
%build
%{prefix}/bin/y2tool y2autoconf
@@ -76,6 +76,15 @@
%doc %{prefix}/share/doc/packages/yast2-samba-server
%changelog
+* Mon Apr 16 2007 - locilka@suse.cz
+- Added possibility to rename a share (#263302).
+- 2.15.6
+* Fri Apr 13 2007 - locilka@suse.cz
+- Disabling MySQL passdb backend which has not support in smb.conf
+- Adjusting UI to allow set only one passdb backend
+- Allowing multiple ldap-server entries in ldapsam backend
+- Better parsing of passdb backend in SambaBackend module
+- Better parsing of passdb backend in SambaBackendLDAP
* Wed Apr 11 2007 - locilka@suse.cz
- Changing SambaServer functions to use only one "passdb backend"
for the configuration (#245167).
++++++ yast2-samba-server-2.15.5.tar.bz2 -> yast2-samba-server-2.15.6.tar.bz2 ++++++
++++ 1828 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-samba-server-2.15.5/configure.in new/yast2-samba-server-2.15.6/configure.in
--- old/yast2-samba-server-2.15.5/configure.in 2007-02-22 17:46:23.000000000 +0100
+++ new/yast2-samba-server-2.15.6/configure.in 2007-04-16 12:56:50.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.14.0 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-samba-server, 2.15.0, http://bugs.opensuse.org/, yast2-samba-server)
+AC_INIT(yast2-samba-server, 2.15.6, http://bugs.opensuse.org/, yast2-samba-server)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -17,7 +17,7 @@
AM_INIT_AUTOMAKE(tar-ustar) dnl searches for some needed programs
dnl Important YaST2 variables
-VERSION="2.15.0"
+VERSION="2.15.6"
RPMNAME="yast2-samba-server"
MAINTAINER="Lukas Ocilka "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-samba-server-2.15.5/src/dialogs-items.ycp new/yast2-samba-server-2.15.6/src/dialogs-items.ycp
--- old/yast2-samba-server-2.15.5/src/dialogs-items.ycp 2007-04-11 15:48:33.000000000 +0200
+++ new/yast2-samba-server-2.15.6/src/dialogs-items.ycp 2007-04-16 12:56:43.000000000 +0200
@@ -6,7 +6,7 @@
* Stanislav Visnovsky
* Martin Lazar
*
- * $Id: dialogs-items.ycp 33319 2006-10-10 13:29:05Z locilka $
+ * $Id: dialogs-items.ycp 37483 2007-04-16 10:56:41Z locilka $
*/
{
@@ -18,6 +18,7 @@
import "LogView";
import "TablePopup";
import "FileUtils";
+ import "Report";
import "SambaServer";
import "SambaConfig";
@@ -44,6 +45,7 @@
define string PassdbId2Key (map desc, any id);
define boolean PassdbEntryDelete (any opt_id, string opt_key);
define void PassdbEditOptionInit (any opt_id, string opt_key);
+ define boolean PassdbEditOptionValidate (string key, map event_descr);
define void PassdbEditOptionStore (any opt_id, string opt_key);
define void ShareInitFun(string key);
@@ -61,10 +63,12 @@
////////////////////////////////////
map shareswidget = TablePopup::CreateTableDescr (
- $["add_delete_buttons" : true,
- "up_down_buttons" : false,
- "unique_keys" : true ]
- , $[
+ $[
+ "add_delete_buttons" : true,
+ "up_down_buttons" : false,
+ "unique_keys" : true
+ ],
+ $[
"init" : ShareInitFun,
"handle" : ShareHandleFun,
"options" : local_option_widgets,
@@ -128,33 +132,41 @@
"widget" : `textentry,
],
],
- "mysql" : $[
- "table" : $[
- // table entry description for MySQL-based SAM
- "label" : _("MySQL database"),
- ],
- "popup" : $[
- "widget" : `textentry,
- ],
- ],
+// MySQL will not be offered, unknown backend
+// "mysql" : $[
+// "table" : $[
+// // table entry description for MySQL-based SAM
+// "label" : _("MySQL database"),
+// ],
+// "popup" : $[
+// "widget" : `textentry,
+// ],
+// ],
];
map passdbwidget = TablePopup::CreateTableDescr (
- $["add_delete_buttons" : true,
- "up_down_buttons" : true,
- "unique_keys" : false]
- , $[
+ $[
+ "add_delete_buttons" : true,
+ "up_down_buttons" : false,
+ "unique_keys" : false
+ ],
+ $[
"init" : initPassdb,
"handle" : handlePassdb,
"store" : storePassdb,
"ids" : PassdbEditContents,
"help" : HELPS["passdb_edit"]:"",
"options": passdboptions,
- "add_items" : [ "smbpasswd", "ldapsam", "tdbsam", "mysql" ],
+ "add_items" : [ "smbpasswd", "ldapsam", "tdbsam" ],
"add_unlisted" : false,
"id2key": PassdbId2Key,
"option_delete" : PassdbEntryDelete,
- "option_move" : PassdbOptionMove,
+ "validate_type" : `function,
+ "validate_function" : PassdbEditOptionValidate,
+
+ // only one passdb backend is possible
+ // "option_move" : PassdbOptionMove,
+
"fallback" : $[
"init" : PassdbEditOptionInit,
"store" : PassdbEditOptionStore,
@@ -178,29 +190,56 @@
*/
string shareToEdit = nil;
-// translators: error message for wrong LDAP source
-string wrong_ldap_url = _("The entered LDAP URL is invalid.");
-
boolean ValidateLDAPURL(any opt_id, string opt_key, map event_descr) {
import "URL";
string url = (string) UI::QueryWidget ( `id (opt_key), `Value );
- if ( ! URL::Check (url) )
- {
- Popup::Error ( wrong_ldap_url );
+ if (regexpmatch (url, "^[ \t]+")) {
+ // TRANSLATORS: popup error
+ Report::Error (_("Optional value must not begin with space character."));
return false;
}
-
- map u = URL::Parse (url);
- if ( u["scheme"]:nil != "ldap" && u["scheme"]:nil != "ldaps" )
- {
- Popup::Error ( wrong_ldap_url );
+
+ boolean quotes_used = false;
+
+ // ldapsam:"ldap://ldap1.example.com ldap://ldap2.example.com"
+ if (regexpmatch (url, "^\".*\"[ \t]*$")) {
+ quotes_used = true;
+ url = regexpsub (url, "^\"(.*)\"[ \t]*$", "\\1");
+ }
+
+ list <string> urls = splitstring (url, " \t");
+ urls = filter (string url, urls, { return url != ""; });
+
+ if (size(urls) > 1 && !quotes_used) {
+ // TRANSLATORS: popup error
+ Report::Error (_("Multiple optional values for one back-end must be quoted."));
return false;
}
+
+ boolean ret = true;
+ foreach (string url, urls, {
+ if (ret != true) return;
+
+ if (! URL::Check (url)) {
+ y2error ("Invalid url '%1'", url);
+ // TRANSLATORS: popup error, %1 is replaced with some URL
+ Popup::Error (sformat(_("The entered URL '%1' is invalid"), url));
+ ret = false;
+ }
+
+ map u = URL::Parse (url);
+ if (u["scheme"]:nil != "ldap" && u["scheme"]:nil != "ldaps") {
+ y2error ("Invalid url '%1'", url);
+ // TRANSLATORS: popup error, %1 is replaced with some URL
+ Popup::Error (sformat(_("The entered URL '%1' is invalid"), url));
+ ret = false;
+ }
+ });
- return true;
+ return ret;
}
boolean SharePathWarning (string p)
@@ -379,6 +418,16 @@
map passdb_backends = nil;
list<string> passdb_order = [];
+ boolean SomeBackendsAreInUse () {
+ return size (passdb_backends) > 0;
+ }
+
+ void RedrawPassdbEditButtons () {
+ if (UI::WidgetExists (`id (`_tp_add))) {
+ UI::ChangeWidget (`id (`_tp_add), `Enabled, (! SomeBackendsAreInUse()));
+ }
+ }
+
define list PassdbEditContents (map descr) ``{
if (passdb_backends != nil)
{
@@ -401,6 +450,16 @@
return ids;
}
}
+
+ define boolean PassdbEditOptionValidate (string key, map event_descr) {
+ if (! SomeBackendsAreInUse()) {
+ Report::Error (_("At least one back-end must be specified."));
+
+ return false;
+ }
+
+ return true;
+ }
define void PassdbEditOptionInit (any opt_id, string opt_key) ``{
if( opt_id != nil ) {
@@ -408,6 +467,8 @@
UI::ChangeWidget (`id (opt_key), `Value, SambaBackend::GetLocation(passdb_backends[(string)opt_id]:""));
}
UI::SetFocus (`id (opt_key));
+
+ RedrawPassdbEditButtons();
}
define void PassdbEditOptionStore (any opt_id, string opt_key) ``{
@@ -449,18 +510,15 @@
define boolean PassdbEntryDelete (any opt_id, string opt_key) ``{
- // don't delete the last one
- if (size (passdb_backends) == 1)
- {
- import "Report";
-
- // error message if user tries to delete the last passdb backend
- Report::Error (_("At least one back-end must be specified.
-
-The back-end cannot be deleted.
-"));
- return false;
- }
+// if (size (passdb_backends) == 1)
+// {
+// // error message if user tries to delete the last passdb backend
+// Report::Error (_("At least one back-end must be specified.
+//
+//The back-end cannot be deleted.
+//"));
+// return false;
+// }
// message popup
if (! Popup::YesNo (_("Delete the selected back-end?")))
@@ -469,6 +527,9 @@
string id = (string) opt_id;
passdb_backends = (map)filter (string k, string v, passdb_backends, ``(k != id));
passdb_order = (list<string>)filter (string k, passdb_order, ``(k != id));
+
+ RedrawPassdbEditButtons();
+
return true;
}
@@ -484,9 +545,10 @@
// translators: passdb backend radio button
`Left (`RadioButton ( `id("ldapsam"), `opt (`notify),_("LDAP") ) ),
// translators: passdb backend radio button
- `Left (`RadioButton ( `id("tdbsam"), `opt (`notify),_("TDB Database") ) ),
- // translators: passdb backend radio button
- `Left (`RadioButton ( `id("mysql"), `opt (`notify),_("MySQL Database") ) )
+ `Left (`RadioButton ( `id("tdbsam"), `opt (`notify),_("TDB Database") ) )
+// Unknown passdb backend
+// // translators: passdb backend radio button
+// `Left (`RadioButton ( `id("mysql"), `opt (`notify),_("MySQL Database") ) )
))),
// translators: textentry label to enter details for the selected passdb backend
`TextEntry ( `id("details"), _("&Details") ),
@@ -582,6 +644,7 @@
define void initPassdb(string key) ``{
TablePopup::TableInit(xx_widgets["passdb_edit"]:$[], key);
+ RedrawPassdbEditButtons();
}
define symbol handlePassdb(string key, map event_descr) ``{
@@ -589,6 +652,7 @@
{
AddPassdbBackend ();
TablePopup::TableInit(xx_widgets["passdb_edit"]:$[], key);
+ RedrawPassdbEditButtons();
// continue
return nil;
}
@@ -599,7 +663,9 @@
return nil;
}
- return TablePopup::TableHandle(xx_widgets["passdb_edit"]:$[], key, event_descr);
+ symbol ret = TablePopup::TableHandle(xx_widgets["passdb_edit"]:$[], key, event_descr);
+ RedrawPassdbEditButtons();
+ return ret;
}
define void storePassdb(string key, map event) ``{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-samba-server-2.15.5/src/dialogs.ycp new/yast2-samba-server-2.15.6/src/dialogs.ycp
--- old/yast2-samba-server-2.15.5/src/dialogs.ycp 2007-03-21 12:31:13.000000000 +0100
+++ new/yast2-samba-server-2.15.6/src/dialogs.ycp 2007-04-16 12:56:43.000000000 +0200
@@ -5,7 +5,7 @@
* Authors: Stanislav Visnovsky
* Lukas Ocilka
*
- * $Id: dialogs.ycp 37051 2007-03-21 11:31:11Z locilka $
+ * $Id: dialogs.ycp 37483 2007-04-16 10:56:41Z locilka $
*/
{
@@ -358,6 +358,91 @@
AdjustUserShareWidgets();
}
+// Bugzilla #263302
+boolean RenameShare (string share) {
+ if (! SambaConfig::ShareExists (share)) {
+ y2error ("Share %1 doesn't exist", share);
+ return false;
+ }
+
+ term content = `VBox (
+ // TRANSLATORS: dialog caption
+ `Heading (_("Rename Share")),
+ `HSquash (`MinWidth (
+ 35,
+ `VBox (
+ // TRANSLATORS: text entry
+ `TextEntry (`id ("share_name"), `opt(`hstretch), _("New Share &Name"), share)
+ )
+ )),
+ `VSpacing (1),
+ `HBox (
+ `PushButton (`id (`ok), Label::OKButton()),
+ `PushButton (`id (`cancel), Label::CancelButton())
+ )
+ );
+
+ UI::OpenDialog (content);
+ UI::SetFocus (`id ("share_name"));
+
+ boolean fc_ret = false;
+
+ any ret = nil;
+ while (true) {
+ ret = UI::UserInput();
+
+ if (ret == `ok) {
+ string new_share_name = (string) UI::QueryWidget (`id ("share_name"), `Value);
+
+ if (new_share_name == "") {
+ // TRANSLATORS: popup error message
+ Report::Error (_("Enter a new share name, please."));
+ continue;
+ } else if (share == new_share_name) {
+ y2milestone ("Old and new share names are the same");
+ break;
+ } else if (SambaConfig::ShareExists (new_share_name)) {
+ // TRANSLATORS: popup error message, %1 is a variable share name
+ Report::Error (sformat (
+ _("Share '%1' already exists.\nChoose another share name, please."),
+ new_share_name
+ ));
+ continue;
+ }
+
+ // Renaming share
+ map old_share_settings = SambaConfig::ShareGetMap (share);
+ boolean old_share_enabled = SambaConfig::ShareEnabled (share);
+
+ y2milestone (
+ "Creating new share '%1' %2 -> %3",
+ new_share_name, old_share_settings,
+ SambaConfig::ShareSetMap (new_share_name, old_share_settings)
+ );
+ y2milestone (
+ "Removing share '%1' -> %2",
+ share,
+ SambaConfig::ShareRemove (share)
+ );
+
+ // enable or disable new share according the old one
+ if (SambaConfig::ShareEnabled (new_share_name) != old_share_enabled) {
+ SambaConfig::ShareAdjust(new_share_name, !SambaConfig::ShareEnabled (new_share_name));
+ }
+
+ fc_ret = true;
+ break;
+ # cancel
+ } else {
+ break;
+ }
+ }
+
+ UI::CloseDialog();
+
+ return fc_ret;
+}
+
symbol SharesWidgetHandle(string key, map event_descr)
{
if (! is(event_descr["ID"]:nil, symbol)) return nil;
@@ -398,10 +483,20 @@
// confirmation dialog before deleting a share
if (Popup::YesNo( sformat( _("If you delete share %1,\nall its settings will be lost.\nReally delete it?"), share)))
{
- SambaConfig::ShareRemove(share);
+ y2milestone (
+ "Removing share '%1' -> %2",
+ share,
+ SambaConfig::ShareRemove (share)
+ );
UI::ChangeWidget( `id(`table), `Items, sharesItems(false));
}
}
+ if (ret == `rename) {
+ if (RenameShare (share)) {
+ UI::ChangeWidget (`id(`table), `Items, sharesItems(false));
+ }
+ return nil;
+ }
return nil;
}
@@ -698,8 +793,12 @@
`PushButton(`id(`edit), Label::EditButton() + "..."),
`PushButton(`id(`delete), Label::DeleteButton()),
`HStretch(),
- `PushButton(`id(`toggle), _("&Toggle Status"))))),
- `HWeight(1, `Empty()));
+ `PushButton(`id(`rename), _("&Rename...")),
+ `PushButton(`id(`toggle), _("&Toggle Status"))
+ )
+ )),
+ `HWeight(1, `Empty())
+ );
term wins_widget = `HBox(
`HSpacing(1),
@@ -984,7 +1083,7 @@
/*
UI::ReplaceWidget( `id(`_tp_table_repl),
- // translators: menu button label for accessing the LDAP-related settings and actions
+ // TRANSLATORS: menu button label for accessing the LDAP-related settings and actions
`MenuButton( "LDAP",
// translators: menu item to show a LDAP-related settings
[ `item( `id(`ldap), _("Global LDAP Settings") ),
@@ -1014,7 +1113,7 @@
`VBox(
`Label( _("For a proper function, Samba server needs an\nadministrative account (root).\nIt will be created now.")),
`Password(`id(`passwd1), _("Samba root &Password")),
- `Password(`id(`passwd2), _("Verify Password")),
+ `Password(`id(`passwd2), _("&Verify Password")),
`HBox(
`PushButton(`id(`ok), `opt(`default), Label::OKButton()),
`PushButton(`id(`cancel), Label::CancelButton())))));
@@ -1029,6 +1128,7 @@
string passwd1 = (string) UI::QueryWidget(`id(`passwd1), `Value);
string passwd2 = (string) UI::QueryWidget(`id(`passwd2), `Value);
if ( passwd1 != passwd2 ) {
+ // TRANSLATORS: popup error message
Popup::Error (_("The first and the second version\nof the password do not match."));
ret = nil;
} else {
@@ -1041,7 +1141,7 @@
if (ret == `cancel) return `cancel;
if (SambaAccounts::UserAdd("root", passwd)) {
- //%1 is username
+ // TRANSLATORS: popup error message, %1 is a username
Popup::Error ( sformat(_("Cannot create account for user %1."), "root" ) );
return `error;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-samba-server-2.15.5/src/helps.ycp new/yast2-samba-server-2.15.6/src/helps.ycp
--- old/yast2-samba-server-2.15.5/src/helps.ycp 2006-10-09 15:51:00.000000000 +0200
+++ new/yast2-samba-server-2.15.6/src/helps.ycp 2007-04-13 08:51:32.000000000 +0200
@@ -5,7 +5,7 @@
* Authors: Stanislav Visnovsky
* Lukas Ocilka
*
- * $Id: helps.ycp 27015 2006-01-13 14:44:40Z locilka $
+ * $Id: helps.ycp 37433 2007-04-13 06:51:30Z locilka $
*/
{
@@ -185,9 +185,8 @@
/* passdb backend configuration dialog help 1/7 */
"passdb_edit" : _("<p><b><big>User Authentication Information Back-Ends</big></b><br>
Here, choose where the Samba server should look for the authentication
-information. The top one is used as a default for adding
-a new users. Samba 3 supports multiple back-end types and a same type
-can be used for multiple back-ends.</p>
+information. Samba does not support multiple back-ends at once anymore,
+only one is allowed.</p>
") +
/* passdb backend configuration dialog help 2/7 */
_("<p><b>smbpasswd file</b> is the file using the same format as
@@ -203,24 +202,28 @@
_("<p><b>TDB database</b> uses an internal Samba database binary format
to store and look up the information.</p>
") +
- /* passdb backend configuration dialog help 5/7 */
-_("<p><b>MySQL database</b> uses an external MySQL database to
-to store and look up the information.</p>
-") +
+
+// we don't seem to support mysql anymore
+// /* passdb backend configuration dialog help 5/7 */
+//_("<p><b>MySQL database</b> uses an external MySQL database to
+//to store and look up the information.</p>
+//") +
+
/* passdb backend configuration dialog help 6/7 */
_("<p>Use <b>Add</b> to add a new configuration option, <b>Edit</b> to modify
an existing option, and <b>Delete</b> to delete an option.
Use <b>Up</b> and <b>Down</b> to change the order
of the back-ends.</p>
-") +
-
- /* passdb backend configuration dialog help 7/7 */
-_("<p>The <b>LDAP</b> button gives access to
-details of an LDAP configuration and also allows
-checking a connection to an LDAP server for the currently
-selected LDAP back-end.</p>
"),
+// no such button there
+// /* passdb backend configuration dialog help 7/7 */
+//_("<p>The <b>LDAP</b> button gives access to
+//details of an LDAP configuration and also allows
+//checking a connection to an LDAP server for the currently
+//selected LDAP back-end.</p>
+//"),
+
/* add new share dialog help 1/3 */
"add_share" : _("<p><b><big>Add a New Share</big></b><br>
Here, enter the basic information about a share to add.</p>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-samba-server-2.15.5/src/SambaBackendLDAP.pm new/yast2-samba-server-2.15.6/src/SambaBackendLDAP.pm
--- old/yast2-samba-server-2.15.5/src/SambaBackendLDAP.pm 2006-10-09 15:51:00.000000000 +0200
+++ new/yast2-samba-server-2.15.6/src/SambaBackendLDAP.pm 2007-04-13 08:51:32.000000000 +0200
@@ -3,7 +3,7 @@
# Authors: Stanislav Visnovsky
# Martin Lazar
#
-# $Id: SambaBackendLDAP.pm 30866 2006-05-11 13:45:25Z locilka $
+# $Id: SambaBackendLDAP.pm 37433 2007-04-13 06:51:30Z locilka $
#
# Representation of the configuration of samba-server.
# Input and output routines.
@@ -106,23 +106,39 @@
# return true if ldapsam is first passdb backend
sub isLDAPDefault {
my @backends = split " ", SambaConfig->GlobalGetStr("passdb backend", "sambapasswd");
- return $backends[0] =~ /^ldapsam(?::.*)?$/ ? 1 : 0;
+ return (defined $backends[0] && $backends[0] =~ /^ldapsam(:.*)?$/ ? 1 : 0);
}
# return LDAP server URL form first ldapsam backend
BEGIN{$TYPEINFO{GetPassdbServerUrl}=["function",["map","string","string"]]}
sub GetPassdbServerUrl {
# find our host - first LDAP backend
- my @backends = split " ", SambaConfig->GlobalGetStr("passdb backend", "smbpasswd");
- foreach (@backends) {
- next unless (/^ldapsam(?::(.*))?/);
- my $url = $1 ? URL->Parse(String($1)) : { host => "localhost"};
- my $ssl = SambaConfig->GlobalGetStr("ldap ssl", "Start_tls") =~ /^(Yes|On)$/i;
-# $url->{port} = $ssl ? 639 : 389 unless $url->{port};
- $url->{scheme} = $ssl ? "ldaps" : "ldap" unless $url->{scheme};
- return $url;
- };
- return undef;
+ my $url_string = SambaConfig->GlobalGetStr("passdb backend", "smbpasswd");
+
+ # ldap not used
+ return undef if ($url_string !~ /^ldapsam:?/);
+
+ # ldapsam:"ldap://a1.example.com ldap://a2.example.com"
+ if ($url_string =~ /^ldapsam:\"[^\"]*\"/) {
+ $url_string =~ s/^ldapsam:\"([^\"]*)\".*$/$1/;
+
+ # ldapsam:ldap://abc.example.com
+ } elsif ($url_string =~ /^ldapsam:.+/) {
+ $url_string =~ s/^ldapsam:([^ \t]+).*$/$1/;
+ }
+
+ # use the first url
+ if ($url_string =~ /^[^ \t]+[ \t]+.*$/) {
+ $url_string =~ s/^([^ \t]+)[ \t]+.*$/$1/;
+ }
+
+ y2milestone ("using URL: ".$url_string);
+
+ my $url = ($url_string ? URL->Parse(String($url_string)) : { host => "localhost"});
+ my $ssl = SambaConfig->GlobalGetStr("ldap ssl", "Start_tls") =~ /^(Yes|On)$/i;
+ $url->{scheme} = $ssl ? "ldaps" : "ldap" unless $url->{scheme};
+
+ return $url;
}
# return LDAP server URL form idmap backend
@@ -332,7 +348,7 @@
unless ($url->{port}) {
my $ssl = SambaConfig->GlobalGetStr("ldap ssl", "Start_tls") =~ /^(Yes|On)$/i;
- $url->{port} = ($url->{scheme} eq "ldaps" || $ssl) ? 689 : 389;
+ $url->{port} = ((defined $url->{scheme} && $url->{scheme} eq "ldaps") || $ssl) ? 689 : 389;
}
$passwd = $Passwd unless defined $passwd;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-samba-server-2.15.5/src/SambaBackend.pm new/yast2-samba-server-2.15.6/src/SambaBackend.pm
--- old/yast2-samba-server-2.15.5/src/SambaBackend.pm 2007-04-11 15:48:49.000000000 +0200
+++ new/yast2-samba-server-2.15.6/src/SambaBackend.pm 2007-04-13 08:51:32.000000000 +0200
@@ -3,7 +3,7 @@
# Authors: Stanislav Visnovsky
# Martin Lazar
#
-# $Id: SambaBackend.pm 37398 2007-04-11 13:48:47Z locilka $
+# $Id: SambaBackend.pm 37433 2007-04-13 06:51:30Z locilka $
#
# Representation of the configuration of samba-server.
# Input and output routines.
@@ -45,15 +45,69 @@
sub GetPassdbBackends {
my ($self) = @_;
- my @current = split (" ", SambaConfig->GlobalGetStr("passdb backend", "smbpasswd"));
+ my $passdb_backend = SambaConfig->GlobalGetStr("passdb backend", "smbpasswd");
+ # limit spaces
+ $passdb_backend =~ s/[ \t]+/ /;
+ # remove unneeded spaces
+ $passdb_backend =~ s/(^[ \t]*|[ \t]*$)//g;
+
+ my @current = ();
+ my $error_count = 0;
+
+ while ($passdb_backend && $error_count < 30) {
+ # ldapsam
+ # ldapsam:ldap://ldap.example.com
+ # ldapsam:"ldap://ldap1.example.com ldap://ldap2.example.com"
+ if ($passdb_backend =~ /^ldapsam[:\"]?/) {
+ if ($passdb_backend =~ s/^ldapsam(:(\"[^\"]*\"|[^ ]*))?//) {
+ push @current, $&;
+ } else {
+ ++$error_count;
+ }
+
+ # tdbsam
+ # tdbsam:/etc/passdb.tdb
+ } elsif ($passdb_backend =~ /^tdbsam:?/) {
+ if ($passdb_backend =~ s/^tdbsam(:[^ ]*)?//) {
+ push @current, $&;
+ } else {
+ ++$error_count;
+ }
+
+ # smbpasswd
+ # smbpasswd:/etc/smbpasswd
+ } elsif ($passdb_backend =~ /^smbpasswd:?/) {
+ if ($passdb_backend =~ s/^smbpasswd(:[^ ]*)?//) {
+ push @current, $&;
+ } else {
+ ++$error_count;
+ }
+
+ # anything else
+ } else {
+ if ($passdb_backend =~ s/^[^ ]*//) {
+ push @current, $&;
+ } else {
+ ++$error_count;
+ }
+ }
+ $passdb_backend =~ s/(^[ \t]*|[ \t]*$)//g;
+ }
+
+ if ($passdb_backend) {
+ foreach my $one_unknown (split / /, $passdb_backend) {
+ push @current, $one_unknown;
+ }
+ }
+
my $backends_found = -1;
- my @ret;
+ my @ret;
# only the first backend can be used
# bugzilla #245167
foreach my $one (@current) {
my $is_backend = $one;
- $is_backend =~ s/^([^:]+)(:.*)*$/$1/;
+ $is_backend =~ s/^([^:]+)(:.*)$/$1/;
if (defined $AvailableBackends{$is_backend}) {
++$backends_found;
}
@@ -110,7 +164,7 @@
# bugzilla #245167
foreach my $one (@{$backends}) {
my $is_backend = $one;
- $is_backend =~ s/^([^:]+)(:.*)*$/$1/;
+ $is_backend =~ s/^([^:]+)(:.*)$/$1/;
if (defined $AvailableBackends{$is_backend}) {
++$backends_found;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-samba-server-2.15.5/users-plugin/users_plugin_samba_groups.ycp new/yast2-samba-server-2.15.6/users-plugin/users_plugin_samba_groups.ycp
--- old/yast2-samba-server-2.15.5/users-plugin/users_plugin_samba_groups.ycp 2006-11-14 13:01:02.000000000 +0100
+++ new/yast2-samba-server-2.15.6/users-plugin/users_plugin_samba_groups.ycp 2007-04-16 12:56:43.000000000 +0200
@@ -9,7 +9,7 @@
* This is part GUI of UsersPluginSambaGroups - plugin for editing all LDAP
* attributes for Samba groups.
*
- * $Id: users_plugin_samba_groups.ycp 34378 2006-11-14 12:01:01Z locilka $
+ * $Id: users_plugin_samba_groups.ycp 37483 2007-04-16 10:56:41Z locilka $
*/
@@ -67,7 +67,7 @@
string help_text =
# help text
-_("<p>This plugin can be used to enable an LDAP group to be avaiable for Samba.
+_("<p>This plugin can be used to enable an LDAP group to be available for Samba.
The only setting that you can edit here is the <b>Samba Group Name</b> Attribute,
which is the Name of the Group as it should appear for Samba-Clients. All other
settings are computed automatically. If you leave the <b>Samba Group Name</b> empty,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-samba-server-2.15.5/VERSION new/yast2-samba-server-2.15.6/VERSION
--- old/yast2-samba-server-2.15.5/VERSION 2007-04-11 15:47:42.000000000 +0200
+++ new/yast2-samba-server-2.15.6/VERSION 2007-04-16 12:56:32.000000000 +0200
@@ -1 +1 @@
-2.15.5
+2.15.6
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org