mirror of
https://github.com/samba-team/samba.git
synced 2025-10-26 23:33:15 +03:00
net_vampire: move pull_netr_AcctLockStr() to libnet.
Guenther
This commit is contained in:
@@ -59,4 +59,7 @@ NTSTATUS samsync_process_database(struct rpc_pipe_client *pipe_hnd,
|
||||
enum netr_SamDatabaseID database_id,
|
||||
samsync_fn_t callback_fn,
|
||||
struct samsync_context *ctx);
|
||||
NTSTATUS pull_netr_AcctLockStr(TALLOC_CTX *mem_ctx,
|
||||
struct lsa_BinaryString *r,
|
||||
struct netr_AcctLockStr **str_p);
|
||||
#endif /* _LIBNET_PROTO_H_ */
|
||||
|
||||
@@ -375,3 +375,41 @@ NTSTATUS samsync_process_database(struct rpc_pipe_client *pipe_hnd,
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* pull_netr_AcctLockStr
|
||||
*/
|
||||
|
||||
NTSTATUS pull_netr_AcctLockStr(TALLOC_CTX *mem_ctx,
|
||||
struct lsa_BinaryString *r,
|
||||
struct netr_AcctLockStr **str_p)
|
||||
{
|
||||
struct netr_AcctLockStr *str;
|
||||
enum ndr_err_code ndr_err;
|
||||
DATA_BLOB blob;
|
||||
|
||||
if (!mem_ctx || !r || !str_p) {
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
*str_p = NULL;
|
||||
|
||||
str = TALLOC_ZERO_P(mem_ctx, struct netr_AcctLockStr);
|
||||
if (!str) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
blob = data_blob_const(r->array, r->length);
|
||||
|
||||
ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, str,
|
||||
(ndr_pull_flags_fn_t)ndr_pull_netr_AcctLockStr);
|
||||
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
||||
return ndr_map_error2ntstatus(ndr_err);
|
||||
}
|
||||
|
||||
*str_p = str;
|
||||
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,40 +84,6 @@ static void display_account_info(uint32_t rid,
|
||||
pdb_encode_acct_ctrl(r->acct_flags, NEW_PW_FORMAT_SPACE_PADDED_LEN));
|
||||
}
|
||||
|
||||
static NTSTATUS pull_netr_AcctLockStr(TALLOC_CTX *mem_ctx,
|
||||
struct lsa_BinaryString *r,
|
||||
struct netr_AcctLockStr **str_p)
|
||||
{
|
||||
struct netr_AcctLockStr *str;
|
||||
enum ndr_err_code ndr_err;
|
||||
DATA_BLOB blob;
|
||||
|
||||
if (!mem_ctx || !r || !str_p) {
|
||||
return NT_STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
*str_p = NULL;
|
||||
|
||||
str = TALLOC_ZERO_P(mem_ctx, struct netr_AcctLockStr);
|
||||
if (!str) {
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
blob = data_blob_const(r->array, r->length);
|
||||
|
||||
ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, str,
|
||||
(ndr_pull_flags_fn_t)ndr_pull_netr_AcctLockStr);
|
||||
data_blob_free(&blob);
|
||||
|
||||
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
|
||||
return ndr_map_error2ntstatus(ndr_err);
|
||||
}
|
||||
|
||||
*str_p = str;
|
||||
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
static void display_domain_info(struct netr_DELTA_DOMAIN *r)
|
||||
{
|
||||
time_t u_logout;
|
||||
|
||||
Reference in New Issue
Block a user