From 8709182fd3c740619fdb075b24023b1eaf192fcd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 8 Apr 2004 19:06:37 +0000 Subject: r126: - add first srvsvc and wkssvc server side stuff - we know can browse the server via the Windows Explorer - some little fixes to the winreg server pipe metze (This used to be commit 6f213a3494d3b5ab629944394b20a84075a04438) --- source4/rpc_server/common/server_info.c | 55 +++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 source4/rpc_server/common/server_info.c (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c new file mode 100644 index 0000000000..9c57d819e1 --- /dev/null +++ b/source4/rpc_server/common/server_info.c @@ -0,0 +1,55 @@ +/* + Unix SMB/CIFS implementation. + + common server info functions + + Copyright (C) Stefan (metze) Metzmacher 2004 + + 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 + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + 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. +*/ + +#include "includes.h" + +/* + Here are common server info functions used by some dcerpc server interfaces +*/ + +/* This hardcoded value should go into a ldb database! */ +uint32 dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return 500; +} + +const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return lp_netbios_name(); +} + +const char *dcesrv_common_get_domain_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return lp_workgroup(); +} + +/* This hardcoded value should go into a ldb database! */ +uint32 dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return 5; +} + +/* This hardcoded value should go into a ldb database! */ +uint32 dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return 2; +} -- cgit From d907dcf383fcdf82add4fd7c397885eab5bb57af Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 8 Apr 2004 19:59:24 +0000 Subject: r127: NetWkstaGetInfo level 101 and return WERR_ACCESS_DENIED for level 102, 502 so does my winXP box for a non-admin user metze (This used to be commit 975bf13f17e0bd95ec37af3534e5209c1de99252) --- source4/rpc_server/common/server_info.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 9c57d819e1..fc86e0f8c1 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -53,3 +53,9 @@ uint32 dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct dcesrv_contex { return 2; } + +/* This hardcoded value should go into a ldb database! */ +const char *dcesrv_common_get_lan_root(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return ""; +} -- cgit From f9d8f8843dc0ab8c9d59abde7222e0f118b86b5d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 25 May 2004 16:24:13 +0000 Subject: r884: convert samba4 to use [u]int32_t instead of [u]int32 metze (This used to be commit 0e5517d937a2eb7cf707991d1c7498c1ab456095) --- source4/rpc_server/common/server_info.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index fc86e0f8c1..1d16b8fe61 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -27,7 +27,7 @@ */ /* This hardcoded value should go into a ldb database! */ -uint32 dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return 500; } @@ -43,13 +43,13 @@ const char *dcesrv_common_get_domain_name(TALLOC_CTX *mem_ctx, struct dcesrv_con } /* This hardcoded value should go into a ldb database! */ -uint32 dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return 5; } /* This hardcoded value should go into a ldb database! */ -uint32 dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return 2; } -- cgit From 09ee8ae1deec97bb1df3c1c77d73192e63df4538 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 31 Dec 2004 02:48:11 +0000 Subject: r4425: - move srvsvc and wkssvc server code to the new W_ERROR_HAVE_NO_MEMORY() macro - add parameters for server_info:platform_id = 500 /* this is PLATFORM_ID_NT */ server_info:version_major = 5 server_info:version_minor = 2 - implmented srvsvc_NetSrvGetInfo level 101 - make dcesrv_common_get_server_name() match w2k3 metze (This used to be commit 16f43207704397c6e3c0132e9f17c8a1a846ddca) --- source4/rpc_server/common/server_info.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 1d16b8fe61..9212ada3da 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -29,33 +29,51 @@ /* This hardcoded value should go into a ldb database! */ uint32_t dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { - return 500; + return lp_parm_int(-1, "server_info", "platform_id", 500); } -const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, const char *server_unc) { - return lp_netbios_name(); + const char *p = server_unc; + + /* if there's no string return our NETBIOS name */ + if (!p) { + return talloc_strdup(mem_ctx, lp_netbios_name()); + } + + /* if there're '\\\\' in front remove them otherwise just pass the string */ + if (p[0] == '\\' && p[1] == '\\') { + p += 2; + } + + return talloc_strdup(mem_ctx, p); } const char *dcesrv_common_get_domain_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { - return lp_workgroup(); + return talloc_strdup(mem_ctx, lp_workgroup()); } /* This hardcoded value should go into a ldb database! */ uint32_t dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { - return 5; + return lp_parm_int(-1, "server_info", "version_major", 5); } /* This hardcoded value should go into a ldb database! */ uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { - return 2; + return lp_parm_int(-1, "server_info", "version_minor", 2); +} + +/* This hardcoded value should go into a ldb database! */ +uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return lp_default_server_announce(); } /* This hardcoded value should go into a ldb database! */ const char *dcesrv_common_get_lan_root(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { - return ""; + return talloc_strdup(mem_ctx, ""); } -- cgit From d62a44c447c2754948448ae618c75d29a6b8d89e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 6 Jan 2005 07:34:14 +0000 Subject: r4558: more use of bitmaps and enums metze (This used to be commit 2a859fbc90a6b043bac318196e42c2949958d57f) --- source4/rpc_server/common/server_info.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 9212ada3da..1a628a2ee6 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -21,15 +21,20 @@ */ #include "includes.h" +#include "librpc/gen_ndr/ndr_srvsvc.h" /* Here are common server info functions used by some dcerpc server interfaces */ /* This hardcoded value should go into a ldb database! */ -uint32_t dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { - return lp_parm_int(-1, "server_info", "platform_id", 500); + enum srvsvc_PlatformId id; + + id = lp_parm_int(-1, "server_info", "platform_id", PLATFORM_ID_NT); + + return id; } const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, const char *server_unc) -- cgit From 96a073fdeab2467e95ec332fd64293e882d16b5f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Jul 2005 10:58:22 +0000 Subject: r8049: add function that returns the build version (of w2k3 here 3790) metze (This used to be commit 81abbdaeb180a1618e34ab56275f6eeacfcc99ce) --- source4/rpc_server/common/server_info.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 1a628a2ee6..a5f8ce15fc 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -71,6 +71,12 @@ uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct dcesrv_cont return lp_parm_int(-1, "server_info", "version_minor", 2); } +/* This hardcoded value should go into a ldb database! */ +uint32_t dcesrv_common_get_version_build(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return lp_parm_int(-1, "server_info", "version_build", 3790); +} + /* This hardcoded value should go into a ldb database! */ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { -- cgit From e3f2414cf9e582a4e4deecc662b64a7bb2679a34 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 14 Mar 2006 15:03:25 +0000 Subject: r14380: Reduce the size of structs.h (This used to be commit 1a16a6f1dfa66499af43a6b88b3ea69a6a75f1fe) --- source4/rpc_server/common/server_info.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index a5f8ce15fc..9d0a884803 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -22,6 +22,7 @@ #include "includes.h" #include "librpc/gen_ndr/ndr_srvsvc.h" +#include "rpc_server/dcerpc_server.h" /* Here are common server info functions used by some dcerpc server interfaces -- cgit From 9565c708987fbe69b9ac981c99f6a5f239784c4a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 19 Mar 2006 17:51:15 +0000 Subject: r14567: Make some more functions public. (This used to be commit 8e84e6cb6b172c89072723e07f344da8f4476c1f) --- source4/rpc_server/common/server_info.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 9d0a884803..3277de8ac6 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -29,7 +29,7 @@ */ /* This hardcoded value should go into a ldb database! */ -enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +_PUBLIC_ enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { enum srvsvc_PlatformId id; @@ -38,7 +38,7 @@ enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct return id; } -const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, const char *server_unc) +_PUBLIC_ const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, const char *server_unc) { const char *p = server_unc; @@ -61,31 +61,31 @@ const char *dcesrv_common_get_domain_name(TALLOC_CTX *mem_ctx, struct dcesrv_con } /* This hardcoded value should go into a ldb database! */ -uint32_t dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +_PUBLIC_ uint32_t dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return lp_parm_int(-1, "server_info", "version_major", 5); } /* This hardcoded value should go into a ldb database! */ -uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +_PUBLIC_ uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return lp_parm_int(-1, "server_info", "version_minor", 2); } /* This hardcoded value should go into a ldb database! */ -uint32_t dcesrv_common_get_version_build(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +_PUBLIC_ uint32_t dcesrv_common_get_version_build(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return lp_parm_int(-1, "server_info", "version_build", 3790); } /* This hardcoded value should go into a ldb database! */ -uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +_PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return lp_default_server_announce(); } /* This hardcoded value should go into a ldb database! */ -const char *dcesrv_common_get_lan_root(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +_PUBLIC_ const char *dcesrv_common_get_lan_root(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return talloc_strdup(mem_ctx, ""); } -- cgit From 92689d180502896cbb07ada29c7349733af4a4b1 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 10 Sep 2006 00:41:15 +0000 Subject: r18315: Implement netSrvGetInfo level 102 fix names to be consistent between level 101 and 102 and typo in idl (This used to be commit 1962fb92d706962544c293770718294e595f9fc4) --- source4/rpc_server/common/server_info.c | 44 +++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 3277de8ac6..cd8106c03a 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -89,3 +89,47 @@ _PUBLIC_ const char *dcesrv_common_get_lan_root(TALLOC_CTX *mem_ctx, struct dces { return talloc_strdup(mem_ctx, ""); } + +/* This hardcoded value should go into a ldb database! */ +_PUBLIC_ uint32_t dcesrv_common_get_users(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return -1; +} + +/* This hardcoded value should go into a ldb database! */ +_PUBLIC_ uint32_t dcesrv_common_get_disc(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return 15; +} + +/* This hardcoded value should go into a ldb database! */ +_PUBLIC_ uint32_t dcesrv_common_get_hidden(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return 0; +} + +/* This hardcoded value should go into a ldb database! */ +_PUBLIC_ uint32_t dcesrv_common_get_announce(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return 240; +} + +/* This hardcoded value should go into a ldb database! */ +_PUBLIC_ uint32_t dcesrv_common_get_anndelta(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return 3000; +} + +/* This hardcoded value should go into a ldb database! */ +_PUBLIC_ uint32_t dcesrv_common_get_licenses(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return 0; +} + +/* This hardcoded value should go into a ldb database! */ +_PUBLIC_ const char *dcesrv_common_get_userpath(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +{ + return talloc_strdup(mem_ctx, "c:\\"); +} + + -- cgit From 7736d2f65cf0479c6a1588e3656809047a4b3d49 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 12 Sep 2006 02:24:21 +0000 Subject: r18412: Implement NetiNameValidate but just for share name right now (type 9) Simo. (This used to be commit 906429834a102349582017ef73a69e211ef5c500) --- source4/rpc_server/common/server_info.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index cd8106c03a..12f5c90e8d 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -132,4 +132,13 @@ _PUBLIC_ const char *dcesrv_common_get_userpath(TALLOC_CTX *mem_ctx, struct dces return talloc_strdup(mem_ctx, "c:\\"); } +#define INVALID_SHARE_NAME_CHARS " \"*+,./:;<=>?[\\]|" +_PUBLIC_ bool dcesrv_common_validate_share_name(TALLOC_CTX *mem_ctx, const char *share_name) +{ + if (strpbrk(share_name, INVALID_SHARE_NAME_CHARS)) { + return False; + } + + return True; +} -- cgit From d471e52d23bf89e472c34c58dd9f113e669323a4 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 13 Dec 2006 11:19:51 +0000 Subject: r20149: Remove the smb.conf distinction between PDC and BDC. Now the correct way to setup a Samba4 DC is to set 'server role = domain controller'. We use the fSMORoleOwner attribute in the base DN to determine the PDC. This patch is quite large, as I have corrected a number of places that assumed taht we are always the PDC, or that used the smb.conf lp_server_role() to determine that. Also included is a warning fix in the SAMR code, where the IDL has seperated a couple of types for group display enumeration. We also now use the ldb database to determine if we should run the global catalog service. In the near future, I will complete the DRSUAPI DsGetDomainControllerInfo server-side on the same basis. Andrew Bartlett (This used to be commit 67d8365e831adf3eaecd8b34dcc481fc82565893) --- source4/rpc_server/common/server_info.c | 75 ++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 12f5c90e8d..26667edc69 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -22,7 +22,10 @@ #include "includes.h" #include "librpc/gen_ndr/ndr_srvsvc.h" +#include "librpc/gen_ndr/svcctl.h" #include "rpc_server/dcerpc_server.h" +#include "dsdb/samdb/samdb.h" +#include "auth/auth.h" /* Here are common server info functions used by some dcerpc server interfaces @@ -81,7 +84,77 @@ _PUBLIC_ uint32_t dcesrv_common_get_version_build(TALLOC_CTX *mem_ctx, struct dc /* This hardcoded value should go into a ldb database! */ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { - return lp_default_server_announce(); + int default_server_announce = 0; + default_server_announce |= SV_TYPE_WORKSTATION; + default_server_announce |= SV_TYPE_SERVER; + default_server_announce |= SV_TYPE_SERVER_UNIX; + + switch (lp_announce_as()) { + case ANNOUNCE_AS_NT_SERVER: + default_server_announce |= SV_TYPE_SERVER_NT; + /* fall through... */ + case ANNOUNCE_AS_NT_WORKSTATION: + default_server_announce |= SV_TYPE_NT; + break; + case ANNOUNCE_AS_WIN95: + default_server_announce |= SV_TYPE_WIN95_PLUS; + break; + case ANNOUNCE_AS_WFW: + default_server_announce |= SV_TYPE_WFW; + break; + default: + break; + } + + switch (lp_server_role()) { + case ROLE_DOMAIN_MEMBER: + default_server_announce |= SV_TYPE_DOMAIN_MEMBER; + break; + case ROLE_DOMAIN_CONTROLLER: + { + struct ldb_context *samctx; + TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); + if (!tmp_ctx) { + break; + } + /* open main ldb */ + samctx = samdb_connect(tmp_ctx, anonymous_session(tmp_ctx)); + if (samctx == NULL) { + DEBUG(2,("Unable to open samdb in determining server announce flags\n")); + } else { + /* Determine if we are the pdc */ + BOOL is_pdc = samdb_is_pdc(samctx); + if (is_pdc) { + default_server_announce |= SV_TYPE_DOMAIN_CTRL; + } else { + default_server_announce |= SV_TYPE_DOMAIN_BAKCTRL; + } + } + /* Close it */ + talloc_free(tmp_ctx); + break; + } + case ROLE_STANDALONE: + default: + break; + } + if (lp_time_server()) + default_server_announce |= SV_TYPE_TIME_SOURCE; + + if (lp_host_msdfs()) + default_server_announce |= SV_TYPE_DFS_SERVER; + + +#if 0 + { + /* TODO: announce us as print server when we are a print server */ + BOOL is_print_server = False; + if (is_print_server) { + default_server_announce |= SV_TYPE_PRINTQ_SERVER; + } + } +#endif + return default_server_announce; } /* This hardcoded value should go into a ldb database! */ -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/rpc_server/common/server_info.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 26667edc69..ccd2bdbad4 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -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 . */ #include "includes.h" -- cgit From ffeee68e4b72dd94fee57366bd8d38b8c284c3d4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 12:42:09 +0000 Subject: r25026: Move param/param.h out of includes.h (This used to be commit abe8349f9b4387961ff3665d8c589d61cd2edf31) --- source4/rpc_server/common/server_info.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index ccd2bdbad4..7ca13fcf94 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -25,6 +25,7 @@ #include "rpc_server/dcerpc_server.h" #include "dsdb/samdb/samdb.h" #include "auth/auth.h" +#include "param/param.h" /* Here are common server info functions used by some dcerpc server interfaces -- cgit From 98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 8 Sep 2007 16:46:30 +0000 Subject: r25035: Fix some more warnings, use service pointer rather than service number in more places. (This used to be commit df9cebcb97e20564359097148665bd519f31bc6f) --- source4/rpc_server/common/server_info.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 7ca13fcf94..8848dcd1df 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -36,7 +36,7 @@ _PUBLIC_ enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ct { enum srvsvc_PlatformId id; - id = lp_parm_int(-1, "server_info", "platform_id", PLATFORM_ID_NT); + id = lp_parm_int(NULL, "server_info", "platform_id", PLATFORM_ID_NT); return id; } @@ -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(-1, "server_info", "version_major", 5); + return lp_parm_int(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(-1, "server_info", "version_minor", 2); + return lp_parm_int(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(-1, "server_info", "version_build", 3790); + return lp_parm_int(NULL, "server_info", "version_build", 3790); } /* This hardcoded value should go into a ldb database! */ -- cgit From 37d53832a4623653f706e77985a79d84bd7c6694 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 28 Sep 2007 01:17:46 +0000 Subject: r25398: Parse loadparm context to all lp_*() functions. (This used to be commit 3fcc960839c6e5ca4de2c3c042f12f369ac5f238) --- source4/rpc_server/common/server_info.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 8848dcd1df..a046f1e29f 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -47,7 +47,7 @@ _PUBLIC_ const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct d /* if there's no string return our NETBIOS name */ if (!p) { - return talloc_strdup(mem_ctx, lp_netbios_name()); + return talloc_strdup(mem_ctx, lp_netbios_name(global_loadparm)); } /* if there're '\\\\' in front remove them otherwise just pass the string */ @@ -60,7 +60,7 @@ _PUBLIC_ const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct d const char *dcesrv_common_get_domain_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { - return talloc_strdup(mem_ctx, lp_workgroup()); + return talloc_strdup(mem_ctx, lp_workgroup(global_loadparm)); } /* This hardcoded value should go into a ldb database! */ @@ -89,7 +89,7 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces default_server_announce |= SV_TYPE_SERVER; default_server_announce |= SV_TYPE_SERVER_UNIX; - switch (lp_announce_as()) { + switch (lp_announce_as(global_loadparm)) { case ANNOUNCE_AS_NT_SERVER: default_server_announce |= SV_TYPE_SERVER_NT; /* fall through... */ @@ -106,7 +106,7 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces break; } - switch (lp_server_role()) { + switch (lp_server_role(global_loadparm)) { case ROLE_DOMAIN_MEMBER: default_server_announce |= SV_TYPE_DOMAIN_MEMBER; break; @@ -138,10 +138,10 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces default: break; } - if (lp_time_server()) + if (lp_time_server(global_loadparm)) default_server_announce |= SV_TYPE_TIME_SOURCE; - if (lp_host_msdfs()) + if (lp_host_msdfs(global_loadparm)) default_server_announce |= SV_TYPE_DFS_SERVER; -- cgit From 60a1046c5c5783799bd64fe18e03534670f83d82 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 29 Sep 2007 18:00:19 +0000 Subject: r25430: Add the loadparm context to all parametric options. (This used to be commit fd697d77c9fe67a00939a1f04b35c451316fff58) --- source4/rpc_server/common/server_info.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index a046f1e29f..677faccf36 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -36,7 +36,7 @@ _PUBLIC_ enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ct { enum srvsvc_PlatformId id; - id = lp_parm_int(NULL, "server_info", "platform_id", PLATFORM_ID_NT); + id = lp_parm_int(global_loadparm, NULL, "server_info", "platform_id", PLATFORM_ID_NT); return id; } @@ -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(NULL, "server_info", "version_major", 5); + return lp_parm_int(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(NULL, "server_info", "version_minor", 2); + return lp_parm_int(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(NULL, "server_info", "version_build", 3790); + return lp_parm_int(global_loadparm, NULL, "server_info", "version_build", 3790); } /* This hardcoded value should go into a ldb database! */ -- cgit From 05e7c481465e3065effaf21b43636d6605d7c313 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:25:41 +0000 Subject: r25553: Convert to standard bool type. (This used to be commit b7371f1a191fb86834c0d586d094f39f0b04544b) --- source4/rpc_server/common/server_info.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 677faccf36..c6f93f076a 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -123,7 +123,7 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces DEBUG(2,("Unable to open samdb in determining server announce flags\n")); } else { /* Determine if we are the pdc */ - BOOL is_pdc = samdb_is_pdc(samctx); + bool is_pdc = samdb_is_pdc(samctx); if (is_pdc) { default_server_announce |= SV_TYPE_DOMAIN_CTRL; } else { @@ -148,7 +148,7 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces #if 0 { /* TODO: announce us as print server when we are a print server */ - BOOL is_print_server = False; + bool is_print_server = false; if (is_print_server) { default_server_announce |= SV_TYPE_PRINTQ_SERVER; } @@ -210,8 +210,8 @@ _PUBLIC_ const char *dcesrv_common_get_userpath(TALLOC_CTX *mem_ctx, struct dces _PUBLIC_ bool dcesrv_common_validate_share_name(TALLOC_CTX *mem_ctx, const char *share_name) { if (strpbrk(share_name, INVALID_SHARE_NAME_CHARS)) { - return False; + return false; } - return True; + return true; } -- cgit From f4a1083cf9f64b4d2b65b68942e93861409ea90f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 2 Dec 2007 17:09:52 +0100 Subject: r26227: Make loadparm_context part of a server task, move loadparm_contexts further up the call stack. (This used to be commit 0721a07aada6a1fae6dcbd610b8783df57d7bbad) --- source4/rpc_server/common/server_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index c6f93f076a..6896c9fada 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -118,7 +118,7 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces break; } /* open main ldb */ - samctx = samdb_connect(tmp_ctx, anonymous_session(tmp_ctx)); + samctx = samdb_connect(tmp_ctx, global_loadparm, anonymous_session(tmp_ctx)); if (samctx == NULL) { DEBUG(2,("Unable to open samdb in determining server announce flags\n")); } else { -- cgit From ecea5ce24553989103d4a06296b24f4d29f30a36 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 3 Dec 2007 17:41:50 +0100 Subject: r26260: Store loadparm context in gensec context. (This used to be commit b9e3a4862e267be39d603fed8207a237c3d72081) --- source4/rpc_server/common/server_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 6896c9fada..6275e35c6c 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -118,7 +118,7 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces break; } /* open main ldb */ - samctx = samdb_connect(tmp_ctx, global_loadparm, anonymous_session(tmp_ctx)); + samctx = samdb_connect(tmp_ctx, global_loadparm, anonymous_session(tmp_ctx, global_loadparm)); if (samctx == NULL) { DEBUG(2,("Unable to open samdb in determining server announce flags\n")); } else { -- cgit From 57f20ccd242e45ff91850341594aa040d113c19e Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 4 Dec 2007 20:05:00 +0100 Subject: r26296: Store loadparm context in DCE/RPC server context. (This used to be commit fc1f4d2d65d4c983cba5421e7ffb64dd75482860) --- source4/rpc_server/common/server_info.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 6275e35c6c..4a9d304192 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -36,7 +36,7 @@ _PUBLIC_ enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ct { enum srvsvc_PlatformId id; - id = lp_parm_int(global_loadparm, NULL, "server_info", "platform_id", PLATFORM_ID_NT); + id = lp_parm_int(dce_ctx->lp_ctx, NULL, "server_info", "platform_id", PLATFORM_ID_NT); return id; } @@ -47,7 +47,7 @@ _PUBLIC_ const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct d /* if there's no string return our NETBIOS name */ if (!p) { - return talloc_strdup(mem_ctx, lp_netbios_name(global_loadparm)); + return talloc_strdup(mem_ctx, lp_netbios_name(dce_ctx->lp_ctx)); } /* if there're '\\\\' in front remove them otherwise just pass the string */ @@ -60,25 +60,25 @@ _PUBLIC_ const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct d const char *dcesrv_common_get_domain_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { - return talloc_strdup(mem_ctx, lp_workgroup(global_loadparm)); + return talloc_strdup(mem_ctx, lp_workgroup(dce_ctx->lp_ctx)); } /* 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(global_loadparm, NULL, "server_info", "version_major", 5); + return lp_parm_int(dce_ctx->lp_ctx, 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(global_loadparm, NULL, "server_info", "version_minor", 2); + return lp_parm_int(dce_ctx->lp_ctx, 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(global_loadparm, NULL, "server_info", "version_build", 3790); + return lp_parm_int(dce_ctx->lp_ctx, NULL, "server_info", "version_build", 3790); } /* This hardcoded value should go into a ldb database! */ @@ -89,7 +89,7 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces default_server_announce |= SV_TYPE_SERVER; default_server_announce |= SV_TYPE_SERVER_UNIX; - switch (lp_announce_as(global_loadparm)) { + switch (lp_announce_as(dce_ctx->lp_ctx)) { case ANNOUNCE_AS_NT_SERVER: default_server_announce |= SV_TYPE_SERVER_NT; /* fall through... */ @@ -106,7 +106,7 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces break; } - switch (lp_server_role(global_loadparm)) { + switch (lp_server_role(dce_ctx->lp_ctx)) { case ROLE_DOMAIN_MEMBER: default_server_announce |= SV_TYPE_DOMAIN_MEMBER; break; @@ -118,7 +118,7 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces break; } /* open main ldb */ - samctx = samdb_connect(tmp_ctx, global_loadparm, anonymous_session(tmp_ctx, global_loadparm)); + samctx = samdb_connect(tmp_ctx, global_loadparm, anonymous_session(tmp_ctx, dce_ctx->lp_ctx)); if (samctx == NULL) { DEBUG(2,("Unable to open samdb in determining server announce flags\n")); } else { @@ -138,10 +138,10 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces default: break; } - if (lp_time_server(global_loadparm)) + if (lp_time_server(dce_ctx->lp_ctx)) default_server_announce |= SV_TYPE_TIME_SOURCE; - if (lp_host_msdfs(global_loadparm)) + if (lp_host_msdfs(dce_ctx->lp_ctx)) default_server_announce |= SV_TYPE_DFS_SERVER; -- cgit From 7f015e2e2e39e5eaf08261b97df885590f109abc Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 5 Dec 2007 01:20:53 +0100 Subject: r26300: Don't segfault when called from the ntptr libs. Andrew Bartlett (This used to be commit 89279d730f3fad01bd855f921b5155ba75892855) --- source4/rpc_server/common/server_info.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 4a9d304192..aa8dd7cc33 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -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! */ -- cgit From d378cf4c15e09b980f874bb103b28e89d9dd3a26 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 6 Dec 2007 16:36:54 +0100 Subject: r26310: Remove more uses of global_loadparm. (This used to be commit 9d806da113b5f0688b6193dfdee9b8765e18b38f) --- source4/rpc_server/common/server_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index aa8dd7cc33..cf46954c33 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -118,7 +118,7 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces break; } /* open main ldb */ - samctx = samdb_connect(tmp_ctx, global_loadparm, anonymous_session(tmp_ctx, dce_ctx->lp_ctx)); + samctx = samdb_connect(tmp_ctx, dce_ctx->lp_ctx, anonymous_session(tmp_ctx, dce_ctx->lp_ctx)); if (samctx == NULL) { DEBUG(2,("Unable to open samdb in determining server announce flags\n")); } else { -- cgit From 2f5ca872a80ad872ab864061f0c6982d8605393f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 6 Dec 2007 16:54:34 +0100 Subject: r26313: Fix more uses of static loadparm. (This used to be commit 6fd0d9d3b75546d08c24c513e05b1843d5777608) --- source4/rpc_server/common/server_info.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index cf46954c33..0a44493df5 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -64,21 +64,21 @@ 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) +_PUBLIC_ uint32_t dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { - return lp_parm_int(dce_ctx ? dce_ctx->lp_ctx : global_loadparm, NULL, "server_info", "version_major", 5); + return lp_parm_int(lp_ctx, 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) +_PUBLIC_ uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { - return lp_parm_int(dce_ctx ? dce_ctx->lp_ctx : global_loadparm, NULL, "server_info", "version_minor", 2); + return lp_parm_int(lp_ctx, 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) +_PUBLIC_ uint32_t dcesrv_common_get_version_build(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { - return lp_parm_int(dce_ctx ? dce_ctx->lp_ctx : global_loadparm, NULL, "server_info", "version_build", 3790); + return lp_parm_int(lp_ctx, NULL, "server_info", "version_build", 3790); } /* This hardcoded value should go into a ldb database! */ -- cgit From afe3e8172ddaa5e4aa811faceecda4f943d6e2ef Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Apr 2008 04:53:27 +0200 Subject: Install public header files again and include required prototypes. (This used to be commit 47ffbbf67435904754469544390b67d34c958343) --- source4/rpc_server/common/server_info.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 0a44493df5..646879ad0d 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -32,7 +32,7 @@ */ /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { enum srvsvc_PlatformId id; @@ -41,7 +41,7 @@ _PUBLIC_ enum srvsvc_PlatformId dcesrv_common_get_platform_id(TALLOC_CTX *mem_ct return id; } -_PUBLIC_ const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, const char *server_unc) +const char *dcesrv_common_get_server_name(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx, const char *server_unc) { const char *p = server_unc; @@ -64,25 +64,25 @@ 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 loadparm_context *lp_ctx) +uint32_t dcesrv_common_get_version_major(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { return lp_parm_int(lp_ctx, 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 loadparm_context *lp_ctx) +uint32_t dcesrv_common_get_version_minor(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { return lp_parm_int(lp_ctx, 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 loadparm_context *lp_ctx) +uint32_t dcesrv_common_get_version_build(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { return lp_parm_int(lp_ctx, NULL, "server_info", "version_build", 3790); } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { int default_server_announce = 0; default_server_announce |= SV_TYPE_WORKSTATION; @@ -158,56 +158,56 @@ _PUBLIC_ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dces } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ const char *dcesrv_common_get_lan_root(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +const char *dcesrv_common_get_lan_root(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return talloc_strdup(mem_ctx, ""); } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_users(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_users(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return -1; } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_disc(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_disc(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return 15; } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_hidden(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_hidden(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return 0; } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_announce(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_announce(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return 240; } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_anndelta(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_anndelta(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return 3000; } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ uint32_t dcesrv_common_get_licenses(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_licenses(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return 0; } /* This hardcoded value should go into a ldb database! */ -_PUBLIC_ const char *dcesrv_common_get_userpath(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +const char *dcesrv_common_get_userpath(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) { return talloc_strdup(mem_ctx, "c:\\"); } #define INVALID_SHARE_NAME_CHARS " \"*+,./:;<=>?[\\]|" -_PUBLIC_ bool dcesrv_common_validate_share_name(TALLOC_CTX *mem_ctx, const char *share_name) +bool dcesrv_common_validate_share_name(TALLOC_CTX *mem_ctx, const char *share_name) { if (strpbrk(share_name, INVALID_SHARE_NAME_CHARS)) { return false; -- cgit From 21fc7673780aa1d7c0caab7b17ff9171238913ba Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 17 Apr 2008 12:23:44 +0200 Subject: Specify event_context to ldb_wrap_connect explicitly. (This used to be commit b4e1ae07a284c044704322446c94351c2decff91) --- source4/rpc_server/common/server_info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/rpc_server/common/server_info.c') diff --git a/source4/rpc_server/common/server_info.c b/source4/rpc_server/common/server_info.c index 646879ad0d..da034e85ea 100644 --- a/source4/rpc_server/common/server_info.c +++ b/source4/rpc_server/common/server_info.c @@ -82,7 +82,7 @@ uint32_t dcesrv_common_get_version_build(TALLOC_CTX *mem_ctx, struct loadparm_co } /* This hardcoded value should go into a ldb database! */ -uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dcesrv_context *dce_ctx) +uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct event_context *event_ctx, struct dcesrv_context *dce_ctx) { int default_server_announce = 0; default_server_announce |= SV_TYPE_WORKSTATION; @@ -118,7 +118,7 @@ uint32_t dcesrv_common_get_server_type(TALLOC_CTX *mem_ctx, struct dcesrv_contex break; } /* open main ldb */ - samctx = samdb_connect(tmp_ctx, dce_ctx->lp_ctx, anonymous_session(tmp_ctx, dce_ctx->lp_ctx)); + samctx = samdb_connect(tmp_ctx, event_ctx, dce_ctx->lp_ctx, anonymous_session(tmp_ctx, event_ctx, dce_ctx->lp_ctx)); if (samctx == NULL) { DEBUG(2,("Unable to open samdb in determining server announce flags\n")); } else { -- cgit