r26300: Don't segfault when called from the ntptr libs.
authorAndrew Bartlett <abartlet@samba.org>
Wed, 5 Dec 2007 00:20:53 +0000 (01:20 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:48:15 +0000 (05:48 +0100)
Andrew Bartlett
(This used to be commit 89279d730f3fad01bd855f921b5155ba75892855)

source4/rpc_server/common/server_info.c

index 4a9d3041924e8b711774977220874e1bacac556f..aa8dd7cc337d1aab46960dc7e3b5a170c559a354 100644 (file)
@@ -66,19 +66,19 @@ const char *dcesrv_common_get_domain_name(TALLOC_CTX *mem_ctx, struct dcesrv_con
 /* This hardcoded value should go into a ldb database! */
 _PUBLIC_ uint32_t dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx)
 {
-       return lp_parm_int(dce_ctx->lp_ctx, NULL, "server_info", "version_major", 5);
+       return lp_parm_int(dce_ctx ? dce_ctx->lp_ctx : global_loadparm, NULL, "server_info", "version_major", 5);
 }
 
 /* This hardcoded value should go into a ldb database! */
 _PUBLIC_ uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx)
 {
-       return lp_parm_int(dce_ctx->lp_ctx, NULL, "server_info", "version_minor", 2);
+       return lp_parm_int(dce_ctx ? dce_ctx->lp_ctx : global_loadparm, NULL, "server_info", "version_minor", 2);
 }
 
 /* This hardcoded value should go into a ldb database! */
 _PUBLIC_ uint32_t dcesrv_common_get_version_build(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx)
 {
-       return lp_parm_int(dce_ctx->lp_ctx, NULL, "server_info", "version_build", 3790);
+       return lp_parm_int(dce_ctx ? dce_ctx->lp_ctx : global_loadparm, NULL, "server_info", "version_build", 3790);
 }
 
 /* This hardcoded value should go into a ldb database! */