summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-09-26 13:42:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:58 -0500
commit98a7da234869576c0b4b41ede9fd64a022c3ec58 (patch)
tree6d4ce967d473837a2261ba1af41a419071b5016b
parenteb5af8841a58a2f87f0b0d0c1ca5062a4a6df8a6 (diff)
downloadsamba-98a7da234869576c0b4b41ede9fd64a022c3ec58.tar.gz
samba-98a7da234869576c0b4b41ede9fd64a022c3ec58.tar.bz2
samba-98a7da234869576c0b4b41ede9fd64a022c3ec58.zip
r10508: - implement WINBINDD_NETBIOS_NAME, WINBINDD_DOMAIN_NAME and WINBINDD_INFO
is there a way to test this calls? vl: please review this metze (This used to be commit 85d4565fce0fcd6abad5fb11246d2671675ee37d)
-rw-r--r--source4/winbind/wb_samba3_cmd.c29
-rw-r--r--source4/winbind/wb_samba3_protocol.c17
-rw-r--r--source4/winbind/wb_samba3_protocol.h4
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)