Author: lmuelle
Date: 2007-02-22 23:12:36 +0000 (Thu, 22 Feb 2007)
New Revision: 21509

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21509

Log:
Merge lp_passdb_backend() from rev 21506 to 3_0_25.

Slightly change the DEBUG 0 message as suggested by Volker on
samba-technical.

Modified:
   branches/SAMBA_3_0/source/param/loadparm.c
   branches/SAMBA_3_0_25/source/param/loadparm.c


Changeset:
Modified: branches/SAMBA_3_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_3_0/source/param/loadparm.c  2007-02-22 21:59:54 UTC (rev 
21508)
+++ branches/SAMBA_3_0/source/param/loadparm.c  2007-02-22 23:12:36 UTC (rev 
21509)
@@ -1858,8 +1858,8 @@
 warn:
        DEBUG(0, ("WARNING: Your 'passdb backend' configuration includes 
multiple backends.  This\n"
                "is deprecated since Samba 3.0.23.  Please check WHATSNEW.txt 
or the section 'Passdb\n"
-               "Changes' from the ChangeNotes as part of the Samba HOWTO 
collection.  The first part\n"
-               "(%s) of your configuration is used instead.\n", 
Globals.szPassdbBackend));
+               "Changes' from the ChangeNotes as part of the Samba HOWTO 
collection.  Only the first\n"
+               "backend (%s) is used.  The rest is ignored.\n", 
Globals.szPassdbBackend));
 
 out:
        return Globals.szPassdbBackend;

Modified: branches/SAMBA_3_0_25/source/param/loadparm.c
===================================================================
--- branches/SAMBA_3_0_25/source/param/loadparm.c       2007-02-22 21:59:54 UTC 
(rev 21508)
+++ branches/SAMBA_3_0_25/source/param/loadparm.c       2007-02-22 23:12:36 UTC 
(rev 21509)
@@ -1820,7 +1820,49 @@
 FN_GLOBAL_STRING(lp_nis_home_map_name, &Globals.szNISHomeMapName)
 static FN_GLOBAL_STRING(lp_announce_version, &Globals.szAnnounceVersion)
 FN_GLOBAL_LIST(lp_netbios_aliases, &Globals.szNetbiosAliases)
-FN_GLOBAL_STRING(lp_passdb_backend, &Globals.szPassdbBackend)
+/* FN_GLOBAL_STRING(lp_passdb_backend, &Globals.szPassdbBackend)
+ * lp_passdb_backend() should be replace by the this macro again after
+ * some releases.
+ * */
+const char *lp_passdb_backend()
+{
+       char *delim, *quote;
+       int pos, i;
+
+       delim = strchr( Globals.szPassdbBackend, ' ');
+       /* no space at all */
+       if (delim == NULL) {
+               goto out;
+       }
+
+       quote = strchr(Globals.szPassdbBackend, '"');
+       /* no quote char or non in the first part */
+       if (quote == NULL || quote > delim) {
+               *delim = '\0';
+               goto warn;
+       }
+
+       quote = strchr(quote+1, '"');
+       if (quote == NULL) {
+               DEBUG(0, ("WARNING: Your 'passdb backend' configuration is 
invalid due to a missing second \" char.\n"));
+               goto out;
+       } else if (*(quote+1) == '\0') {
+               /* space, fitting quote char, and one backend only */
+               goto out;
+       } else {
+               /* terminate string after the fitting quote char */
+               *(quote+1) = '\0';
+       }
+
+warn:
+       DEBUG(0, ("WARNING: Your 'passdb backend' configuration includes 
multiple backends.  This\n"
+               "is deprecated since Samba 3.0.23.  Please check WHATSNEW.txt 
or the section 'Passdb\n"
+               "Changes' from the ChangeNotes as part of the Samba HOWTO 
collection.  Only the first\n"
+               "backend (%s) is used.  The rest is ignored.\n", 
Globals.szPassdbBackend));
+
+out:
+       return Globals.szPassdbBackend;
+}
 FN_GLOBAL_LIST(lp_preload_modules, &Globals.szPreloadModules)
 FN_GLOBAL_STRING(lp_panic_action, &Globals.szPanicAction)
 FN_GLOBAL_STRING(lp_adduser_script, &Globals.szAddUserScript)

Reply via email to