The branch, master has been updated via 39fa9468c6b8099429b971d75c0647033b60901c (commit) via d7c366f8de13ce6f2cf691b95974a18e21d0fff7 (commit) via 05959636328ae71b1969a85241a93883f20bcb69 (commit) from bd58a1461724eb92c9fedd014edb7465f5a16b40 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 39fa9468c6b8099429b971d75c0647033b60901c Author: Günther Deschner <g...@samba.org> Date: Mon Jul 13 23:42:57 2009 +0200 s3-account_policy: remove trailing whitespace. Guenther commit d7c366f8de13ce6f2cf691b95974a18e21d0fff7 Author: Günther Deschner <g...@samba.org> Date: Mon Jul 13 23:38:16 2009 +0200 s3: re-run make idl. Guenther commit 05959636328ae71b1969a85241a93883f20bcb69 Author: Günther Deschner <g...@samba.org> Date: Mon Jul 13 22:46:51 2009 +0200 samr: add missing samr_ValidationStatus codes. Guenther ----------------------------------------------------------------------- Summary of changes: librpc/gen_ndr/ndr_samr.c | 2 + librpc/gen_ndr/samr.h | 6 +++- librpc/idl/samr.idl | 4 ++- source3/lib/account_pol.c | 64 ++++++++++++++++++++++---------------------- 4 files changed, 42 insertions(+), 34 deletions(-) Changeset truncated at 500 lines: diff --git a/librpc/gen_ndr/ndr_samr.c b/librpc/gen_ndr/ndr_samr.c index 58b7ae2..258aba9 100644 --- a/librpc/gen_ndr/ndr_samr.c +++ b/librpc/gen_ndr/ndr_samr.c @@ -4831,12 +4831,14 @@ _PUBLIC_ void ndr_print_samr_ValidationStatus(struct ndr_print *ndr, const char case SAMR_VALIDATION_STATUS_SUCCESS: val = "SAMR_VALIDATION_STATUS_SUCCESS"; break; case SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE: val = "SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE"; break; case SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT: val = "SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT"; break; + case SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED: val = "SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED"; break; case SAMR_VALIDATION_STATUS_BAD_PASSWORD: val = "SAMR_VALIDATION_STATUS_BAD_PASSWORD"; break; case SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT: val = "SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT"; break; case SAMR_VALIDATION_STATUS_PWD_TOO_SHORT: val = "SAMR_VALIDATION_STATUS_PWD_TOO_SHORT"; break; case SAMR_VALIDATION_STATUS_PWD_TOO_LONG: val = "SAMR_VALIDATION_STATUS_PWD_TOO_LONG"; break; case SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH: val = "SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH"; break; case SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT: val = "SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT"; break; + case SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR: val = "SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR"; break; } ndr_print_enum(ndr, name, "ENUM", val, r); } diff --git a/librpc/gen_ndr/samr.h b/librpc/gen_ndr/samr.h index e44de1b..ce84b45 100644 --- a/librpc/gen_ndr/samr.h +++ b/librpc/gen_ndr/samr.h @@ -834,24 +834,28 @@ enum samr_ValidationStatus SAMR_VALIDATION_STATUS_SUCCESS=0, SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE=1, SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT=2, + SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED=3, SAMR_VALIDATION_STATUS_BAD_PASSWORD=4, SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT=5, SAMR_VALIDATION_STATUS_PWD_TOO_SHORT=6, SAMR_VALIDATION_STATUS_PWD_TOO_LONG=7, SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH=8, - SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT=9 + SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT=9, + SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR=10 } #else { __donnot_use_enum_samr_ValidationStatus=0x7FFFFFFF} #define SAMR_VALIDATION_STATUS_SUCCESS ( 0 ) #define SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE ( 1 ) #define SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT ( 2 ) +#define SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED ( 3 ) #define SAMR_VALIDATION_STATUS_BAD_PASSWORD ( 4 ) #define SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT ( 5 ) #define SAMR_VALIDATION_STATUS_PWD_TOO_SHORT ( 6 ) #define SAMR_VALIDATION_STATUS_PWD_TOO_LONG ( 7 ) #define SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH ( 8 ) #define SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT ( 9 ) +#define SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR ( 10 ) #endif ; diff --git a/librpc/idl/samr.idl b/librpc/idl/samr.idl index b7c151d..8a5692f 100644 --- a/librpc/idl/samr.idl +++ b/librpc/idl/samr.idl @@ -1544,12 +1544,14 @@ import "misc.idl", "lsa.idl", "security.idl"; SAMR_VALIDATION_STATUS_SUCCESS = 0, SAMR_VALIDATION_STATUS_PASSWORD_MUST_CHANGE = 1, SAMR_VALIDATION_STATUS_ACCOUNT_LOCKED_OUT = 2, + SAMR_VALIDATION_STATUS_PASSWORD_EXPIRED = 3, SAMR_VALIDATION_STATUS_BAD_PASSWORD = 4, SAMR_VALIDATION_STATUS_PWD_HISTORY_CONFLICT = 5, SAMR_VALIDATION_STATUS_PWD_TOO_SHORT = 6, SAMR_VALIDATION_STATUS_PWD_TOO_LONG = 7, SAMR_VALIDATION_STATUS_NOT_COMPLEX_ENOUGH = 8, - SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT = 9 + SAMR_VALIDATION_STATUS_PASSWORD_TOO_RECENT = 9, + SAMR_VALIDATION_STATUS_PASSWORD_FILTER_ERROR = 10 } samr_ValidationStatus; typedef struct { diff --git a/source3/lib/account_pol.c b/source3/lib/account_pol.c index 1e435ca..4b63375 100644 --- a/source3/lib/account_pol.c +++ b/source3/lib/account_pol.c @@ -1,20 +1,20 @@ -/* +/* * Unix SMB/CIFS implementation. * account policy storage * Copyright (C) Jean François Micouleau 1998-2001. * Copyright (C) Andrew Bartlett 2002 * Copyright (C) Guenther Deschner 2004-2005 - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, see <http://www.gnu.org/licenses/>. */ @@ -39,51 +39,51 @@ struct ap_table { }; static const struct ap_table account_policy_names[] = { - {AP_MIN_PASSWORD_LEN, "min password length", MINPASSWDLENGTH, - "Minimal password length (default: 5)", + {AP_MIN_PASSWORD_LEN, "min password length", MINPASSWDLENGTH, + "Minimal password length (default: 5)", "sambaMinPwdLength" }, {AP_PASSWORD_HISTORY, "password history", 0, - "Length of Password History Entries (default: 0 => off)", + "Length of Password History Entries (default: 0 => off)", "sambaPwdHistoryLength" }, - + {AP_USER_MUST_LOGON_TO_CHG_PASS, "user must logon to change password", 0, "Force Users to logon for password change (default: 0 => off, 2 => on)", "sambaLogonToChgPwd" }, - + {AP_MAX_PASSWORD_AGE, "maximum password age", (uint32) -1, - "Maximum password age, in seconds (default: -1 => never expire passwords)", + "Maximum password age, in seconds (default: -1 => never expire passwords)", "sambaMaxPwdAge" }, - + {AP_MIN_PASSWORD_AGE,"minimum password age", 0, - "Minimal password age, in seconds (default: 0 => allow immediate password change)", + "Minimal password age, in seconds (default: 0 => allow immediate password change)", "sambaMinPwdAge" }, - + {AP_LOCK_ACCOUNT_DURATION, "lockout duration", 30, "Lockout duration in minutes (default: 30, -1 => forever)", "sambaLockoutDuration" }, - + {AP_RESET_COUNT_TIME, "reset count minutes", 30, - "Reset time after lockout in minutes (default: 30)", + "Reset time after lockout in minutes (default: 30)", "sambaLockoutObservationWindow" }, - + {AP_BAD_ATTEMPT_LOCKOUT, "bad lockout attempt", 0, - "Lockout users after bad logon attempts (default: 0 => off)", + "Lockout users after bad logon attempts (default: 0 => off)", "sambaLockoutThreshold" }, - + {AP_TIME_TO_LOGOUT, "disconnect time", (uint32) -1, - "Disconnect Users outside logon hours (default: -1 => off, 0 => on)", - "sambaForceLogoff" }, - + "Disconnect Users outside logon hours (default: -1 => off, 0 => on)", + "sambaForceLogoff" }, + {AP_REFUSE_MACHINE_PW_CHANGE, "refuse machine password change", 0, "Allow Machine Password changes (default: 0 => off)", "sambaRefuseMachinePwdChange" }, - + {0, NULL, 0, "", NULL} }; void account_policy_names_list(const char ***names, int *num_names) -{ +{ const char **nl; int i, count; @@ -175,7 +175,7 @@ bool account_policy_get_default(int account_policy, uint32 *val) return True; } } - DEBUG(0,("no default for account_policy index %d found. This should never happen\n", + DEBUG(0,("no default for account_policy index %d found. This should never happen\n", account_policy)); return False; } @@ -189,7 +189,7 @@ static bool account_policy_set_default_on_empty(int account_policy) uint32 value; - if (!account_policy_get(account_policy, &value) && + if (!account_policy_get(account_policy, &value) && !account_policy_get_default(account_policy, &value)) { return False; } @@ -299,7 +299,7 @@ bool init_account_policy(void) } /***************************************************************************** -Get an account policy (from tdb) +Get an account policy (from tdb) *****************************************************************************/ bool account_policy_get(int field, uint32 *value) @@ -320,12 +320,12 @@ bool account_policy_get(int field, uint32 *value) DEBUG(1, ("account_policy_get: Field %d is not a valid account policy type! Cannot get, returning 0.\n", field)); return False; } - + if (!dbwrap_fetch_uint32(db, name, ®val)) { DEBUG(1, ("account_policy_get: tdb_fetch_uint32 failed for field %d (%s), returning 0\n", field, name)); return False; } - + if (value) { *value = regval; } @@ -336,7 +336,7 @@ bool account_policy_get(int field, uint32 *value) /**************************************************************************** -Set an account policy (in tdb) +Set an account policy (in tdb) ****************************************************************************/ bool account_policy_set(int field, uint32 value) @@ -362,12 +362,12 @@ bool account_policy_set(int field, uint32 value) } DEBUG(10,("account_policy_set: name: %s, value: %d\n", name, value)); - + return True; } /**************************************************************************** -Set an account policy in the cache +Set an account policy in the cache ****************************************************************************/ bool cache_account_policy_set(int field, uint32 value) @@ -404,7 +404,7 @@ bool cache_account_policy_set(int field, uint32 value) } /***************************************************************************** -Get an account policy from the cache +Get an account policy from the cache *****************************************************************************/ bool cache_account_policy_get(int field, uint32 *value) -- Samba Shared Repository