r25398: Parse loadparm context to all lp_*() functions.
[kai/samba.git] / source4 / ntptr / simple_ldb / ntptr_simple_ldb.c
index d504a53a836d1ee2b2b7a6d6ce0e351013992cfa..02808bfbc8ba9ac0ed3689a4e76367c94dda7e2d 100644 (file)
@@ -7,7 +7,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
@@ -16,8 +16,7 @@
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 /*
   This implements a NTPTR backend that store
@@ -36,6 +35,7 @@
 #include "dsdb/samdb/samdb.h"
 #include "db_wrap.h"
 #include "rpc_server/common/common.h"
+#include "param/param.h"
 
 /*
   connect to the SPOOLSS database
@@ -43,7 +43,7 @@
  */
 static struct ldb_context *sptr_db_connect(TALLOC_CTX *mem_ctx)
 {
-       return ldb_wrap_connect(mem_ctx, lp_spoolss_url(), system_session(mem_ctx), 
+       return ldb_wrap_connect(mem_ctx, lp_spoolss_url(global_loadparm), system_session(mem_ctx), 
                                NULL, 0, NULL);
 }
 
@@ -203,12 +203,12 @@ static WERROR sptr_GetPrintServerData(struct ntptr_GenericHandle *server, TALLOC
                r->out.data.binary      = blob;
                return WERR_OK;
        } else if (strcmp("DNSMachineName", r->in.value_name) == 0) {
-               if (!lp_realm()) return WERR_INVALID_PARAM;
+               if (!lp_realm(global_loadparm)) return WERR_INVALID_PARAM;
 
                r->out.type             = SPOOLSS_PRINTER_DATA_TYPE_STRING;
                r->out.data.string      = talloc_asprintf(mem_ctx, "%s.%s",
-                                                                  lp_netbios_name(),
-                                                                  lp_realm());
+                                                                  lp_netbios_name(global_loadparm),
+                                                                  lp_realm(global_loadparm));
                W_ERROR_HAVE_NO_MEMORY(r->out.data.string);
                return WERR_OK;
        }