diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/winbind/wb_samba3_cmd.c | 29 | ||||
-rw-r--r-- | source4/winbind/wb_samba3_protocol.c | 17 | ||||
-rw-r--r-- | source4/winbind/wb_samba3_protocol.h | 4 |
3 files changed, 42 insertions, 8 deletions
diff --git a/source4/winbind/wb_samba3_cmd.c b/source4/winbind/wb_samba3_cmd.c index 01f284d72c..752a368d31 100644 --- a/source4/winbind/wb_samba3_cmd.c +++ b/source4/winbind/wb_samba3_cmd.c @@ -30,6 +30,7 @@ #include "librpc/gen_ndr/nbt.h" #include "libcli/raw/libcliraw.h" #include "libcli/composite/composite.h" +#include "include/version.h" NTSTATUS wbsrv_samba3_interface_version(struct wbsrv_samba3_call *s3call) { @@ -38,6 +39,28 @@ NTSTATUS wbsrv_samba3_interface_version(struct wbsrv_samba3_call *s3call) return NT_STATUS_OK; } +NTSTATUS wbsrv_samba3_info(struct wbsrv_samba3_call *s3call) +{ + s3call->response.result = WINBINDD_OK; + s3call->response.data.info.winbind_separator = *lp_winbind_separator(); + WBSRV_SAMBA3_SET_STRING(s3call->response.data.info.samba_version, SAMBA_VERSION_STRING); + return NT_STATUS_OK; +} + +NTSTATUS wbsrv_samba3_domain_name(struct wbsrv_samba3_call *s3call) +{ + s3call->response.result = WINBINDD_OK; + WBSRV_SAMBA3_SET_STRING(s3call->response.data.domain_name, lp_workgroup()); + return NT_STATUS_OK; +} + +NTSTATUS wbsrv_samba3_netbios_name(struct wbsrv_samba3_call *s3call) +{ + s3call->response.result = WINBINDD_OK; + WBSRV_SAMBA3_SET_STRING(s3call->response.data.netbios_name, lp_netbios_name()); + return NT_STATUS_OK; +} + NTSTATUS wbsrv_samba3_priv_pipe_dir(struct wbsrv_samba3_call *s3call) { s3call->response.result = WINBINDD_OK; @@ -70,10 +93,8 @@ static void wbsrv_samba3_check_machacc_reply(struct composite_context *action) status = wb_finddcs_recv(action, s3call); s3call->response.data.auth.nt_status = NT_STATUS_V(status); - strncpy(s3call->response.data.auth.nt_status_string, nt_errstr(status), - sizeof(s3call->response.data.auth.nt_status_string)-1); - strncpy(s3call->response.data.auth.error_string, nt_errstr(status), - sizeof(s3call->response.data.auth.error_string)-1); + WBSRV_SAMBA3_SET_STRING(s3call->response.data.auth.nt_status_string, nt_errstr(status)); + WBSRV_SAMBA3_SET_STRING(s3call->response.data.auth.error_string, nt_errstr(status)); s3call->response.data.auth.pam_error = nt_status_to_pam(status); if (NT_STATUS_IS_OK(status)) { diff --git a/source4/winbind/wb_samba3_protocol.c b/source4/winbind/wb_samba3_protocol.c index 4519f89540..af63b4c876 100644 --- a/source4/winbind/wb_samba3_protocol.c +++ b/source4/winbind/wb_samba3_protocol.c @@ -72,14 +72,23 @@ NTSTATUS wbsrv_samba3_handle_call(struct wbsrv_call *call) case WINBINDD_INTERFACE_VERSION: return wbsrv_samba3_interface_version(s3call); - case WINBINDD_PRIV_PIPE_DIR: - return wbsrv_samba3_priv_pipe_dir(s3call); + case WINBINDD_CHECK_MACHACC: + return wbsrv_samba3_check_machacc(s3call); case WINBINDD_PING: return wbsrv_samba3_ping(s3call); - case WINBINDD_CHECK_MACHACC: - return wbsrv_samba3_check_machacc(s3call); + case WINBINDD_INFO: + return wbsrv_samba3_domain_name(s3call); + + case WINBINDD_DOMAIN_NAME: + return wbsrv_samba3_domain_name(s3call); + + case WINBINDD_NETBIOS_NAME: + return wbsrv_samba3_netbios_name(s3call); + + case WINBINDD_PRIV_PIPE_DIR: + return wbsrv_samba3_priv_pipe_dir(s3call); } s3call->response.result = WINBINDD_ERROR; diff --git a/source4/winbind/wb_samba3_protocol.h b/source4/winbind/wb_samba3_protocol.h index 473a91b752..9a13210187 100644 --- a/source4/winbind/wb_samba3_protocol.h +++ b/source4/winbind/wb_samba3_protocol.h @@ -33,3 +33,7 @@ struct wbsrv_samba3_call { /* the response structure of the samba3 protocol*/ struct winbindd_response response; }; + +#define WBSRV_SAMBA3_SET_STRING(dest, src) do { \ + strncpy(dest, src, sizeof(dest)-1);\ +} while(0) |