summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorHans Insulander <hin@cvs.openbsd.org>2001-06-26 20:15:33 +0000
committerHans Insulander <hin@cvs.openbsd.org>2001-06-26 20:15:33 +0000
commitcd779a12202556278f6eed9718b9f706329b8a30 (patch)
tree2eb82114ad864646c24059478da27c9617f31f6d /usr.bin
parente9513614682e0b0aac963a1004c47adeea24aff4 (diff)
Adapt for our use
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/passwd/krb5_passwd.c58
1 files changed, 22 insertions, 36 deletions
diff --git a/usr.bin/passwd/krb5_passwd.c b/usr.bin/passwd/krb5_passwd.c
index 4ef36c408d6..5d085366750 100644
--- a/usr.bin/passwd/krb5_passwd.c
+++ b/usr.bin/passwd/krb5_passwd.c
@@ -31,60 +31,46 @@
* SUCH DAMAGE.
*/
-#include "kpasswd_locl.h"
-RCSID("$KTH: kpasswd.c,v 1.23 2000/12/31 07:48:34 assar Exp $");
-
-static int version_flag;
-static int help_flag;
-
-static struct getargs args[] = {
- { "version", 0, arg_flag, &version_flag },
- { "help", 0, arg_flag, &help_flag }
-};
-
-static void
-usage (int ret, struct getargs *a, int num_args)
-{
- arg_printusage (a, num_args, NULL, "[principal]");
- exit (ret);
-}
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/uio.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <sys/time.h>
+#include <sys/select.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <errno.h>
+#include <dlfcn.h>
+#include <util.h>
+#include <err.h>
+#include <kerberosV/krb5.h>
+
+/* RCSID("$KTH: kpasswd.c,v 1.23 2000/12/31 07:48:34 assar Exp $"); */
int
-main (int argc, char **argv)
+krb5_passwd (int argc, char **argv)
{
krb5_error_code ret;
krb5_context context;
krb5_principal principal;
- int optind = 0;
krb5_get_init_creds_opt opt;
krb5_creds cred;
int result_code;
krb5_data result_code_string, result_string;
char pwbuf[BUFSIZ];
- optind = krb5_program_setup(&context, argc, argv,
- args, sizeof(args) / sizeof(args[0]), usage);
-
- if (help_flag)
- usage (0, args, sizeof(args) / sizeof(args[0]));
-
- if(version_flag){
- print_version (NULL);
- exit(0);
- }
-
krb5_get_init_creds_opt_init (&opt);
krb5_get_init_creds_opt_set_tkt_life (&opt, 300);
krb5_get_init_creds_opt_set_forwardable (&opt, FALSE);
krb5_get_init_creds_opt_set_proxiable (&opt, FALSE);
- argc -= optind;
- argv += optind;
-
- if (argc > 1)
- usage (1, args, sizeof(args) / sizeof(args[0]));
-
ret = krb5_init_context (&context);
if (ret)
errx (1, "krb5_init_context failed: %d", ret);