samba36: remove more parts of srvsvc
git-svn-id: svn://svn.openwrt.org/openwrt/packages@30494 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
21c46423c5
commit
d032773db1
@ -64,9 +64,117 @@
|
||||
#ifdef NETLOGON_SUPPORT
|
||||
netlogon_commands,
|
||||
#endif
|
||||
+#ifdef NETLOGON_SUPPORT
|
||||
+#ifdef SRVSVC_SUPPORT
|
||||
srvsvc_commands,
|
||||
+#endif
|
||||
#ifdef DFS_SUPPORT
|
||||
dfs_commands,
|
||||
#endif
|
||||
--- a/source3/smbd/lanman.c
|
||||
+++ b/source3/smbd/lanman.c
|
||||
@@ -2197,6 +2197,10 @@ static bool api_RNetShareAdd(struct smbd
|
||||
struct srvsvc_NetShareInfo2 info2;
|
||||
struct dcerpc_binding_handle *b;
|
||||
|
||||
+#ifndef SRVSVC_SUPPORT
|
||||
+ return False;
|
||||
+#endif
|
||||
+
|
||||
if (!str1 || !str2 || !p) {
|
||||
return False;
|
||||
}
|
||||
@@ -3818,10 +3822,7 @@ static bool api_RNetServerGetInfo(struct
|
||||
NTSTATUS status;
|
||||
WERROR werr;
|
||||
TALLOC_CTX *mem_ctx = talloc_tos();
|
||||
- struct rpc_pipe_client *cli = NULL;
|
||||
- union srvsvc_NetSrvInfo info;
|
||||
int errcode;
|
||||
- struct dcerpc_binding_handle *b;
|
||||
|
||||
if (!str1 || !str2 || !p) {
|
||||
return False;
|
||||
@@ -3884,66 +3885,16 @@ static bool api_RNetServerGetInfo(struct
|
||||
p = *rdata;
|
||||
p2 = p + struct_len;
|
||||
|
||||
- status = rpc_pipe_open_interface(mem_ctx, &ndr_table_srvsvc.syntax_id,
|
||||
- conn->session_info,
|
||||
- &conn->sconn->client_id,
|
||||
- conn->sconn->msg_ctx,
|
||||
- &cli);
|
||||
- if (!NT_STATUS_IS_OK(status)) {
|
||||
- DEBUG(0,("api_RNetServerGetInfo: could not connect to srvsvc: %s\n",
|
||||
- nt_errstr(status)));
|
||||
- errcode = W_ERROR_V(ntstatus_to_werror(status));
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- b = cli->binding_handle;
|
||||
-
|
||||
- status = dcerpc_srvsvc_NetSrvGetInfo(b, mem_ctx,
|
||||
- NULL,
|
||||
- 101,
|
||||
- &info,
|
||||
- &werr);
|
||||
- if (!NT_STATUS_IS_OK(status)) {
|
||||
- errcode = W_ERROR_V(ntstatus_to_werror(status));
|
||||
- goto out;
|
||||
- }
|
||||
- if (!W_ERROR_IS_OK(werr)) {
|
||||
- errcode = W_ERROR_V(werr);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- if (info.info101 == NULL) {
|
||||
- errcode = W_ERROR_V(WERR_INVALID_PARAM);
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
if (uLevel != 20) {
|
||||
- srvstr_push(NULL, 0, p, info.info101->server_name, 16,
|
||||
+ srvstr_push(NULL, 0, p, global_myname(), 16,
|
||||
STR_ASCII|STR_UPPER|STR_TERMINATE);
|
||||
- }
|
||||
+ }
|
||||
p += 16;
|
||||
if (uLevel > 0) {
|
||||
- SCVAL(p,0,info.info101->version_major);
|
||||
- SCVAL(p,1,info.info101->version_minor);
|
||||
- SIVAL(p,2,info.info101->server_type);
|
||||
-
|
||||
- if (mdrcnt == struct_len) {
|
||||
- SIVAL(p,6,0);
|
||||
- } else {
|
||||
- SIVAL(p,6,PTR_DIFF(p2,*rdata));
|
||||
- if (mdrcnt - struct_len <= 0) {
|
||||
- return false;
|
||||
- }
|
||||
- push_ascii(p2,
|
||||
- info.info101->comment,
|
||||
- MIN(mdrcnt - struct_len,
|
||||
- MAX_SERVER_STRING_LENGTH),
|
||||
- STR_TERMINATE);
|
||||
- p2 = skip_string(*rdata,*rdata_len,p2);
|
||||
- if (!p2) {
|
||||
- return False;
|
||||
- }
|
||||
- }
|
||||
+ SCVAL(p,0,lp_major_announce_version());
|
||||
+ SCVAL(p,1,lp_minor_announce_version());
|
||||
+ SIVAL(p,2,lp_default_server_announce());
|
||||
+ SIVAL(p,6,0);
|
||||
}
|
||||
|
||||
if (uLevel > 1) {
|
||||
@@ -5630,6 +5581,10 @@ static bool api_RNetSessionEnum(struct s
|
||||
uint32_t totalentries, resume_handle = 0;
|
||||
uint32_t count = 0;
|
||||
|
||||
+#ifndef SRVSVC_SUPPORT
|
||||
+ return False;
|
||||
+#endif
|
||||
+
|
||||
if (!str1 || !str2 || !p) {
|
||||
return False;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user