ctdb-recoverd: Flatten update_flags_on_all_nodes()
[Samba.git] / source4 / kdc / mit-kdb / kdb_samba_change_pwd.c
blobe0264cb4f0952d9453871176fd906e362c3227c3
1 /*
2 Unix SMB/CIFS implementation.
4 Samba KDB plugin for MIT Kerberos
6 Copyright (c) 2010 Simo Sorce <idra@samba.org>.
7 Copyright (c) 2014 Andreas Schneider <asn@samba.org>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "includes.h"
25 #include "system/kerberos.h"
27 #include <profile.h>
28 #include <kdb.h>
30 #include "kdc/mit_samba.h"
31 #include "kdb_samba.h"
33 krb5_error_code kdb_samba_change_pwd(krb5_context context,
34 krb5_keyblock *master_key,
35 krb5_key_salt_tuple *ks_tuple,
36 int ks_tuple_count, char *passwd,
37 int new_kvno, krb5_boolean keepold,
38 krb5_db_entry *db_entry)
40 struct mit_samba_context *mit_ctx;
41 krb5_error_code code;
43 mit_ctx = ks_get_context(context);
44 if (mit_ctx == NULL) {
45 return KRB5_KDB_DBNOTINITED;
48 code = mit_samba_kpasswd_change_password(mit_ctx, passwd, db_entry);
49 if (code != 0) {
50 goto cleanup;
53 cleanup:
55 return code;