260-remove_samr.patch 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. --- a/source3/rpc_server/rpc_handles.c
  2. +++ b/source3/rpc_server/rpc_handles.c
  3. @@ -59,8 +59,11 @@ struct handle_list {
  4. static bool is_samr_lsa_pipe(const struct ndr_syntax_id *syntax)
  5. {
  6. - return (ndr_syntax_id_equal(syntax, &ndr_table_samr.syntax_id)
  7. - || ndr_syntax_id_equal(syntax, &ndr_table_lsarpc.syntax_id));
  8. + return
  9. +#ifdef SAMR_SUPPORT
  10. + ndr_syntax_id_equal(syntax, &ndr_table_samr.syntax_id) ||
  11. +#endif
  12. + ndr_syntax_id_equal(syntax, &ndr_table_lsarpc.syntax_id);
  13. }
  14. size_t num_pipe_handles(struct pipes_struct *p)
  15. --- a/source3/librpc/rpc/rpc_common.c
  16. +++ b/source3/librpc/rpc/rpc_common.c
  17. @@ -100,9 +100,11 @@ static bool initialize_interfaces(void)
  18. return false;
  19. }
  20. #endif
  21. +#ifdef SAMR_SUPPORT
  22. if (!smb_register_ndr_interface(&ndr_table_samr)) {
  23. return false;
  24. }
  25. +#endif
  26. #ifdef NETLOGON_SUPPORT
  27. if (!smb_register_ndr_interface(&ndr_table_netlogon)) {
  28. return false;
  29. --- a/source3/rpc_server/rpc_ep_setup.c
  30. +++ b/source3/rpc_server/rpc_ep_setup.c
  31. @@ -557,6 +557,7 @@ static bool lsarpc_init_cb(void *ptr)
  32. return true;
  33. }
  34. +#ifdef SAMR_SUPPORT
  35. static bool samr_init_cb(void *ptr)
  36. {
  37. struct dcesrv_ep_context *ep_ctx =
  38. @@ -605,6 +606,7 @@ static bool samr_init_cb(void *ptr)
  39. return true;
  40. }
  41. +#endif
  42. #ifdef NETLOGON_SUPPORT
  43. static bool netlogon_init_cb(void *ptr)
  44. @@ -1111,12 +1113,14 @@ bool dcesrv_ep_setup(struct tevent_conte
  45. return false;
  46. }
  47. +#ifdef SAMR_SUPPORT
  48. samr_cb.init = samr_init_cb;
  49. samr_cb.shutdown = NULL;
  50. samr_cb.private_data = ep_ctx;
  51. if (!NT_STATUS_IS_OK(rpc_samr_init(&samr_cb))) {
  52. return false;
  53. }
  54. +#endif
  55. #ifdef NETLOGON_SUPPORT
  56. netlogon_cb.init = netlogon_init_cb;
  57. --- a/source3/smbd/server_exit.c
  58. +++ b/source3/smbd/server_exit.c
  59. @@ -159,7 +159,9 @@ static void exit_server_common(enum serv
  60. #ifdef NETLOGON_SUPPORT
  61. rpc_netlogon_shutdown();
  62. #endif
  63. +#ifdef SAMR_SUPPORT
  64. rpc_samr_shutdown();
  65. +#endif
  66. rpc_lsarpc_shutdown();
  67. }
  68. --- a/source3/rpcclient/rpcclient.c
  69. +++ b/source3/rpcclient/rpcclient.c
  70. @@ -623,7 +623,9 @@ static struct cmd_set *rpcclient_command
  71. rpcclient_commands,
  72. lsarpc_commands,
  73. ds_commands,
  74. +#ifdef SAMR_SUPPORT
  75. samr_commands,
  76. +#endif
  77. #ifdef PRINTER_SUPPORT
  78. spoolss_commands,
  79. #endif
  80. --- a/source3/smbd/lanman.c
  81. +++ b/source3/smbd/lanman.c
  82. @@ -2353,6 +2353,10 @@ static bool api_RNetGroupEnum(struct smb
  83. NTSTATUS status, result;
  84. struct dcerpc_binding_handle *b;
  85. +#ifndef SAMR_SUPPORT
  86. + return False;
  87. +#endif
  88. +
  89. if (!str1 || !str2 || !p) {
  90. return False;
  91. }
  92. @@ -2541,6 +2545,10 @@ static bool api_NetUserGetGroups(struct
  93. NTSTATUS status, result;
  94. struct dcerpc_binding_handle *b;
  95. +#ifndef SAMR_SUPPORT
  96. + return False;
  97. +#endif
  98. +
  99. if (!str1 || !str2 || !UserName || !p) {
  100. return False;
  101. }
  102. @@ -2741,6 +2749,10 @@ static bool api_RNetUserEnum(struct smbd
  103. struct dcerpc_binding_handle *b;
  104. +#ifndef SAMR_SUPPORT
  105. + return False;
  106. +#endif
  107. +
  108. if (!str1 || !str2 || !p) {
  109. return False;
  110. }
  111. @@ -2979,6 +2991,10 @@ static bool api_SamOEMChangePassword(str
  112. int bufsize;
  113. struct dcerpc_binding_handle *b;
  114. +#ifndef SAMR_SUPPORT
  115. + return False;
  116. +#endif
  117. +
  118. *rparam_len = 4;
  119. *rparam = smb_realloc_limit(*rparam,*rparam_len);
  120. if (!*rparam) {
  121. @@ -4020,6 +4036,10 @@ static bool api_RNetUserGetInfo(struct s
  122. union samr_UserInfo *info;
  123. struct dcerpc_binding_handle *b = NULL;
  124. +#ifndef SAMR_SUPPORT
  125. + return False;
  126. +#endif
  127. +
  128. if (!str1 || !str2 || !UserName || !p) {
  129. return False;
  130. }
  131. --- a/source3/rpc_server/srv_pipe.c
  132. +++ b/source3/rpc_server/srv_pipe.c
  133. @@ -409,6 +409,7 @@ static bool check_bind_req(struct pipes_
  134. context_fns->syntax = *abstract;
  135. context_fns->allow_connect = lp_allow_dcerpc_auth_level_connect();
  136. +#ifdef SAMR_SUPPORT
  137. /*
  138. * for the samr and the lsarpc interfaces we don't allow "connect"
  139. * auth_level by default.
  140. @@ -417,6 +418,7 @@ static bool check_bind_req(struct pipes_
  141. if (ok) {
  142. context_fns->allow_connect = false;
  143. }
  144. +#endif
  145. ok = ndr_syntax_id_equal(abstract, &ndr_table_lsarpc.syntax_id);
  146. if (ok) {
  147. context_fns->allow_connect = false;