2 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 #pragma ident "%Z%%M% %I% %E% SMI"
9 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
11 * Openvision retains the copyright to derivative works of
12 * this source code. Do *NOT* create a derivative of this
13 * source code before consulting with your legal department.
14 * Do *NOT* integrate *ANY* of this source code into another
15 * product before consulting with your legal department.
17 * For further information, read the top-level Openvision
18 * copyright which is contained in the top-level MIT Kerberos
21 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
27 * Copyright 1993-1994 OpenVision Technologies, Inc., All Rights Reserved.
29 * $Header: /cvs/krbdev/krb5/src/kadmin/passwd/tty_kpasswd.c,v 1.9 2001/02/26 18:22:08 epeisach Exp $
34 static char rcsid
[] = "$Id: tty_kpasswd.c,v 1.9 2001/02/26 18:22:08 epeisach Exp $";
36 #include <kadm5/admin.h>
39 #include "kpasswd_strings.h"
40 #define string_text error_message
51 void display_intro_message(fmt_string
, arg_string
)
52 const char *fmt_string
;
53 const char *arg_string
;
55 com_err(whoami
, 0, fmt_string
, arg_string
);
58 long read_old_password(context
, password
, pwsize
)
63 long code
= krb5_read_password(context
,
64 (char *) string_text(KPW_STR_OLD_PASSWORD_PROMPT
),
69 long read_new_password(server_handle
, password
, pwsize
, msg_ret
, msg_len
, princ
)
77 return (kadm5_chpass_principal_util(server_handle
, princ
, NULL
,
78 NULL
/* don't need new pw back */,
84 * main() for tty version of kpasswd.c
94 whoami
= (whoami
= strrchr(argv
[0], '/')) ? whoami
+ 1 : argv
[0];
96 (void) setlocale(LC_ALL
, "");
98 #if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */
99 #define TEXT_DOMAIN "SYS_TEST" /* Use this only if it weren't */
102 (void) textdomain(TEXT_DOMAIN
);
104 retval
= krb5_init_context(&context
);
106 com_err(whoami
, retval
, gettext("initializing krb5 context"));
109 /* initialize_kpws_error_table(); SUNWresync121 */
111 retval
= kpasswd(context
, argc
, argv
);
114 printf(string_text(KPW_STR_PASSWORD_CHANGED
));