mirror of
https://github.com/samba-team/samba.git
synced 2025-02-19 21:57:57 +03:00
r11852: Fill in samr_get_dom_pwinfo based on Samba4.
Guenther
This commit is contained in:
parent
4d681f560e
commit
a8bc4bc902
@ -1750,14 +1750,18 @@ typedef struct q_samr_get_dom_pwinfo
|
|||||||
|
|
||||||
} SAMR_Q_GET_DOM_PWINFO;
|
} SAMR_Q_GET_DOM_PWINFO;
|
||||||
|
|
||||||
|
#define DOMAIN_PASSWORD_COMPLEX 0x00000001
|
||||||
|
#define DOMAIN_PASSWORD_NO_ANON_CHANGE 0x00000002
|
||||||
|
#define DOMAIN_PASSWORD_NO_CLEAR_CHANGE 0x00000004
|
||||||
|
#define DOMAIN_LOCKOUT_ADMINS 0x00000008
|
||||||
|
#define DOMAIN_PASSWORD_STORE_CLEARTEXT 0x00000010
|
||||||
|
#define DOMAIN_REFUSE_PASSWORD_CHANGE 0x00000020
|
||||||
|
|
||||||
/* SAMR_R_GET_DOM_PWINFO */
|
/* SAMR_R_GET_DOM_PWINFO */
|
||||||
typedef struct r_samr_get_dom_pwinfo
|
typedef struct r_samr_get_dom_pwinfo
|
||||||
{
|
{
|
||||||
/*
|
uint16 min_pwd_length;
|
||||||
* See Samba4 IDL
|
uint32 password_properties;
|
||||||
*/
|
|
||||||
uint16 unk_0;
|
|
||||||
uint32 unk_1;
|
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
|
|
||||||
} SAMR_R_GET_DOM_PWINFO;
|
} SAMR_R_GET_DOM_PWINFO;
|
||||||
|
@ -1723,7 +1723,7 @@ NTSTATUS rpccli_samr_query_sec_obj(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
|
|||||||
/* Get domain password info */
|
/* Get domain password info */
|
||||||
|
|
||||||
NTSTATUS rpccli_samr_get_dom_pwinfo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
|
NTSTATUS rpccli_samr_get_dom_pwinfo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
|
||||||
uint16 *unk_0, uint16 *unk_1)
|
uint16 *min_pwd_length, uint32 *password_properties)
|
||||||
{
|
{
|
||||||
prs_struct qbuf, rbuf;
|
prs_struct qbuf, rbuf;
|
||||||
SAMR_Q_GET_DOM_PWINFO q;
|
SAMR_Q_GET_DOM_PWINFO q;
|
||||||
@ -1751,10 +1751,10 @@ NTSTATUS rpccli_samr_get_dom_pwinfo(struct rpc_pipe_client *cli, TALLOC_CTX *mem
|
|||||||
result = r.status;
|
result = r.status;
|
||||||
|
|
||||||
if (NT_STATUS_IS_OK(result)) {
|
if (NT_STATUS_IS_OK(result)) {
|
||||||
if (unk_0)
|
if (min_pwd_length)
|
||||||
*unk_0 = r.unk_0;
|
*min_pwd_length = r.min_pwd_length;
|
||||||
if (unk_1)
|
if (password_properties)
|
||||||
*unk_1 = r.unk_1;
|
*password_properties = r.password_properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -7038,15 +7038,11 @@ BOOL samr_io_r_get_dom_pwinfo(const char *desc, SAMR_R_GET_DOM_PWINFO * r_u,
|
|||||||
if(!prs_align(ps))
|
if(!prs_align(ps))
|
||||||
return False;
|
return False;
|
||||||
|
|
||||||
/*
|
if(!prs_uint16("min_pwd_length", ps, depth, &r_u->min_pwd_length))
|
||||||
* see the Samba4 IDL for what these actually are.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if(!prs_uint16("unk_0", ps, depth, &r_u->unk_0))
|
|
||||||
return False;
|
return False;
|
||||||
if(!prs_align(ps))
|
if(!prs_align(ps))
|
||||||
return False;
|
return False;
|
||||||
if(!prs_uint32("unk_1", ps, depth, &r_u->unk_1))
|
if(!prs_uint32("password_properties", ps, depth, &r_u->password_properties))
|
||||||
return False;
|
return False;
|
||||||
|
|
||||||
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
if(!prs_ntstatus("status", ps, depth, &r_u->status))
|
||||||
|
@ -1650,18 +1650,37 @@ static NTSTATUS cmd_samr_get_dom_pwinfo(struct rpc_pipe_client *cli,
|
|||||||
int argc, const char **argv)
|
int argc, const char **argv)
|
||||||
{
|
{
|
||||||
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
|
||||||
uint16 unk_0, unk_1;
|
uint16 min_pwd_length;
|
||||||
|
uint32 password_properties;
|
||||||
|
|
||||||
if (argc != 1) {
|
if (argc != 1) {
|
||||||
printf("Usage: %s\n", argv[0]);
|
printf("Usage: %s\n", argv[0]);
|
||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = rpccli_samr_get_dom_pwinfo(cli, mem_ctx, &unk_0, &unk_1) ;
|
result = rpccli_samr_get_dom_pwinfo(cli, mem_ctx, &min_pwd_length, &password_properties) ;
|
||||||
|
|
||||||
if (NT_STATUS_IS_OK(result)) {
|
if (NT_STATUS_IS_OK(result)) {
|
||||||
printf("unk_0 = 0x%08x\n", unk_0);
|
printf("min_pwd_length: %d\n", min_pwd_length);
|
||||||
printf("unk_1 = 0x%08x\n", unk_1);
|
printf("password_properties: 0x%08x\n", password_properties);
|
||||||
|
|
||||||
|
if (password_properties & DOMAIN_PASSWORD_COMPLEX)
|
||||||
|
printf("\tDOMAIN_PASSWORD_COMPLEX\n");
|
||||||
|
|
||||||
|
if (password_properties & DOMAIN_PASSWORD_NO_ANON_CHANGE)
|
||||||
|
printf("\tDOMAIN_PASSWORD_NO_ANON_CHANGE\n");
|
||||||
|
|
||||||
|
if (password_properties & DOMAIN_PASSWORD_NO_CLEAR_CHANGE)
|
||||||
|
printf("\tDOMAIN_PASSWORD_NO_CLEAR_CHANGE\n");
|
||||||
|
|
||||||
|
if (password_properties & DOMAIN_LOCKOUT_ADMINS)
|
||||||
|
printf("\tDOMAIN_LOCKOUT_ADMINS\n");
|
||||||
|
|
||||||
|
if (password_properties & DOMAIN_PASSWORD_STORE_CLEARTEXT)
|
||||||
|
printf("\tDOMAIN_PASSWORD_STORE_CLEARTEXT\n");
|
||||||
|
|
||||||
|
if (password_properties & DOMAIN_REFUSE_PASSWORD_CHANGE)
|
||||||
|
printf("\tDOMAIN_REFUSE_PASSWORD_CHANGE\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user