From 6c84ecb55657ae28eb739a72164f6d7251dc627f Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Sat, 12 Feb 2005 00:51:31 +0000 Subject: r5349: After talking with Jerry, reverted the addition of account policies to passdb in 3_0 (they are still in trunk). Guenther (This used to be commit fdf9bdbbac1d8d4f3b3e1fc7e49c1e659b9301b1) --- source3/utils/net_rpc_samsync.c | 18 +++++++++--------- source3/utils/pdbedit.c | 42 +++++++---------------------------------- 2 files changed, 16 insertions(+), 44 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c index cc81719b6a..49aef2a23c 100644 --- a/source3/utils/net_rpc_samsync.c +++ b/source3/utils/net_rpc_samsync.c @@ -1000,34 +1000,34 @@ static NTSTATUS fetch_domain_info(uint32 rid, SAM_DOMAIN_INFO *delta) } - if (!pdb_set_account_policy(AP_PASSWORD_HISTORY, delta->pwd_history_len)) + if (!account_policy_set(AP_PASSWORD_HISTORY, delta->pwd_history_len)) return nt_status; - if (!pdb_set_account_policy(AP_MIN_PASSWORD_LEN, delta->min_pwd_len)) + if (!account_policy_set(AP_MIN_PASSWORD_LEN, delta->min_pwd_len)) return nt_status; - if (!pdb_set_account_policy(AP_MAX_PASSWORD_AGE, (uint32)u_max_age)) + if (!account_policy_set(AP_MAX_PASSWORD_AGE, (uint32)u_max_age)) return nt_status; - if (!pdb_set_account_policy(AP_MIN_PASSWORD_AGE, (uint32)u_min_age)) + if (!account_policy_set(AP_MIN_PASSWORD_AGE, (uint32)u_min_age)) return nt_status; - if (!pdb_set_account_policy(AP_TIME_TO_LOGOUT, (uint32)u_logout)) + if (!account_policy_set(AP_TIME_TO_LOGOUT, (uint32)u_logout)) return nt_status; - if (!pdb_set_account_policy(AP_BAD_ATTEMPT_LOCKOUT, delta->account_lockout.bad_attempt_lockout)) + if (!account_policy_set(AP_BAD_ATTEMPT_LOCKOUT, delta->account_lockout.bad_attempt_lockout)) return nt_status; - if (!pdb_set_account_policy(AP_RESET_COUNT_TIME, (uint32)u_lockoutreset/60)) + if (!account_policy_set(AP_RESET_COUNT_TIME, (uint32)u_lockoutreset/60)) return nt_status; if (u_lockouttime != -1) u_lockouttime /= 60; - if (!pdb_set_account_policy(AP_LOCK_ACCOUNT_DURATION, (uint32)u_lockouttime)) + if (!account_policy_set(AP_LOCK_ACCOUNT_DURATION, (uint32)u_lockouttime)) return nt_status; - if (!pdb_set_account_policy(AP_USER_MUST_LOGON_TO_CHG_PASS, delta->logon_chgpass)) + if (!account_policy_set(AP_USER_MUST_LOGON_TO_CHG_PASS, delta->logon_chgpass)) return nt_status; return NT_STATUS_OK; diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c index d29b6ea66c..3584ef0367 100644 --- a/source3/utils/pdbedit.c +++ b/source3/utils/pdbedit.c @@ -118,27 +118,6 @@ static int export_groups (struct pdb_context *in, struct pdb_context *out) { return 0; } -/********************************************************* - Add all currently available account policy from tdb to one backend - ********************************************************/ - -static int export_account_policies (struct pdb_context *in, struct pdb_context *out) -{ - int i; - - for (i=1; decode_account_policy_name(i) != NULL; i++) { - uint32 policy_value; - if (NT_STATUS_IS_ERR(in->pdb_get_account_policy(in, i, &policy_value))) { - fprintf(stderr, "Can't get account policy from tdb\n"); - return -1; - } - out->pdb_set_account_policy(out, i, policy_value); - } - - return 0; -} - - /********************************************************* Print info from sam structure **********************************************************/ @@ -669,7 +648,6 @@ int main (int argc, char **argv) static char *backend_in = NULL; static char *backend_out = NULL; static BOOL transfer_groups = False; - static BOOL transfer_account_policies = False; static BOOL force_initialised_password = False; static char *logon_script = NULL; static char *profile_path = NULL; @@ -710,7 +688,6 @@ int main (int argc, char **argv) {"import", 'i', POPT_ARG_STRING, &backend_in, 0, "import user accounts from this backend", NULL}, {"export", 'e', POPT_ARG_STRING, &backend_out, 0, "export user accounts to this backend", NULL}, {"group", 'g', POPT_ARG_NONE, &transfer_groups, 0, "use -i and -e for groups", NULL}, - {"policies", 'y', POPT_ARG_NONE, &transfer_account_policies, 0, "use -i and -e to move account policies between backends", NULL}, {"account-policy", 'P', POPT_ARG_STRING, &account_policy, 0,"value of an account policy (like maximum password age)",NULL}, {"value", 'C', POPT_ARG_LONG, &account_policy_value, 'C',"set the account policy to this value", NULL}, {"account-control", 'c', POPT_ARG_STRING, &account_control, 0, "Values of account control", NULL}, @@ -810,22 +787,20 @@ int main (int argc, char **argv) SAFE_FREE(apn); exit(1); } - if (!pdb_get_account_policy(field, &value)) { + if (!account_policy_get(field, &value)) { fprintf(stderr, "valid account policy, but unable to fetch value!\n"); - if (!account_policy_value_set) - exit(1); + exit(1); } - printf("account policy \"%s\" description: %s\n", account_policy, account_policy_get_comment(field)); if (account_policy_value_set) { - printf("account policy \"%s\" value was: %u\n", account_policy, value); - if (!pdb_set_account_policy(field, account_policy_value)) { + printf("account policy value for %s was %u\n", account_policy, value); + if (!account_policy_set(field, account_policy_value)) { fprintf(stderr, "valid account policy, but unable to set value!\n"); exit(1); } - printf("account policy \"%s\" value is now: %lu\n", account_policy, account_policy_value); + printf("account policy value for %s is now %lu\n", account_policy, account_policy_value); exit(0); } else { - printf("account policy \"%s\" value is: %u\n", account_policy, value); + printf("account policy value for %s is %u\n", account_policy, value); exit(0); } } @@ -849,10 +824,7 @@ int main (int argc, char **argv) } else { bout = bdef; } - if (transfer_account_policies) { - if (!(checkparms & BIT_USER)) - return export_account_policies(bin, bout); - } else if (transfer_groups) { + if (transfer_groups) { if (!(checkparms & BIT_USER)) return export_groups(bin, bout); } else { -- cgit