summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-10-09 07:17:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:20 -0500
commitcfed7a5a71aab48b1d5b758df318b991a95592a5 (patch)
tree5ebaab4d9b2dd20067b8194b9102bf54c4cb255d /source3/utils
parentd63a3e05a23ffb016578c3daa8b48d6fc32e1e8c (diff)
downloadsamba-cfed7a5a71aab48b1d5b758df318b991a95592a5.tar.gz
samba-cfed7a5a71aab48b1d5b758df318b991a95592a5.tar.bz2
samba-cfed7a5a71aab48b1d5b758df318b991a95592a5.zip
r19184: W2k3 returns its name for the GetServerInfo RAP call. Do the same.
Implement 'net rap server name'. Volker (This used to be commit 919385ed2a2a07e848bc0baaac9ed3d1964d4386)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rap.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/source3/utils/net_rap.c b/source3/utils/net_rap.c
index ef5df43535..9084122d68 100644
--- a/source3/utils/net_rap.c
+++ b/source3/utils/net_rap.c
@@ -407,12 +407,40 @@ int net_rap_server_usage(int argc, const char **argv)
net_common_flags_usage(argc, argv);
return -1;
}
+
+static int net_rap_server_name(int argc, const char *argv[])
+{
+ struct cli_state *cli;
+ char *name;
+
+ if (!(cli = net_make_ipc_connection(0)))
+ return -1;
+
+ if (!cli_get_server_name(NULL, cli, &name)) {
+ d_fprintf(stderr, "cli_get_server_name failed\n");
+ cli_shutdown(cli);
+ return -1;
+ }
+
+ d_printf("Server name = %s\n", name);
+
+ TALLOC_FREE(name);
+ cli_shutdown(cli);
+ return 0;
+}
int net_rap_server(int argc, const char **argv)
{
struct cli_state *cli;
int ret;
-
+
+ if (argc > 0) {
+ if (!strequal(argv[0], "name")) {
+ return net_rap_server_usage(argc-1, argv+1);
+ }
+ return net_rap_server_name(argc, argv);
+ }
+
if (!(cli = net_make_ipc_connection(0)))
return -1;