1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-29 15:42:04 +03:00

netapi: add NetUserChangePassword skeleton.

Guenther
(This used to be commit f4ce688710)
This commit is contained in:
Günther Deschner
2008-06-25 00:32:02 +02:00
parent 84cf8dc8c6
commit 6fa8ac6ab4
3 changed files with 72 additions and 0 deletions

View File

@ -585,6 +585,52 @@ NET_API_STATUS NetUserEnum(const char * server_name /* [in] [unique] */,
return r.out.result;
}
/****************************************************************
NetUserChangePassword
****************************************************************/
NET_API_STATUS NetUserChangePassword(const char * domain_name /* [in] */,
const char * user_name /* [in] */,
const char * old_password /* [in] */,
const char * new_password /* [in] */)
{
struct NetUserChangePassword r;
struct libnetapi_ctx *ctx = NULL;
NET_API_STATUS status;
WERROR werr;
status = libnetapi_getctx(&ctx);
if (status != 0) {
return status;
}
/* In parameters */
r.in.domain_name = domain_name;
r.in.user_name = user_name;
r.in.old_password = old_password;
r.in.new_password = new_password;
/* Out parameters */
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(NetUserChangePassword, &r);
}
if (LIBNETAPI_LOCAL_SERVER(domain_name)) {
werr = NetUserChangePassword_l(ctx, &r);
} else {
werr = NetUserChangePassword_r(ctx, &r);
}
r.out.result = W_ERROR_V(werr);
if (DEBUGLEVEL >= 10) {
NDR_PRINT_OUT_DEBUG(NetUserChangePassword, &r);
}
return r.out.result;
}
/****************************************************************
NetQueryDisplayInformation
****************************************************************/