* Code for getting the remote time
*/
-
int net_time(struct net_context *ctx, int argc, const char **argv)
{
NTSTATUS status;
if (argc > 0 && argv[0]) {
server_name = argv[0];
} else {
- DEBUG(0,("net_time: server name needed!\n"));
- return -1;
+ return net_time_usage(ctx, argc, argv);
}
libnetctx = libnet_context_init();
if (!libnetctx) {
return -1;
}
- libnetctx->user.account_name = ctx->user.account_name;
- libnetctx->user.domain_name = ctx->user.domain_name;
- libnetctx->user.password = ctx->user.password;
+ libnetctx->user.account_name= cli_credentials_get_username(ctx->credentials);
+ libnetctx->user.domain_name = cli_credentials_get_domain(ctx->credentials);
+ libnetctx->user.password = cli_credentials_get_password(ctx->credentials);
/* prepare to get the time */
r.generic.level = LIBNET_REMOTE_TOD_GENERIC;
return -1;
}
- ZERO_ARRAY(timestr);
+ ZERO_STRUCT(timestr);
tm = localtime(&r.generic.out.time);
strftime(timestr, sizeof(timestr)-1, "%c %Z",tm);
int net_time_usage(struct net_context *ctx, int argc, const char **argv)
{
- d_printf("net_time_usage: TODO\n");
- return 0;
-}
-
-int net_time_help(struct net_context *ctx, int argc, const char **argv)
-{
- d_printf("net_time_help: TODO\n");
+ d_printf("net time <server> [options]\n");
return 0;
}