diff options
author | Hans Insulander <hin@cvs.openbsd.org> | 2002-02-06 08:55:55 +0000 |
---|---|---|
committer | Hans Insulander <hin@cvs.openbsd.org> | 2002-02-06 08:55:55 +0000 |
commit | cb0daaa684a0c09c7d73e18eecbee4faeb8270a5 (patch) | |
tree | f796bba2c64e7071b92b86b450e31b8da2b75644 | |
parent | ad16fc130420004ad0d467d78de48a9eeb05d834 (diff) |
Import of heimdal-0.4e
-rw-r--r-- | kerberosV/src/lib/krb5/krbhst-test.c | 46 | ||||
-rw-r--r-- | kerberosV/src/lib/roken/base64-test.c | 6 | ||||
-rw-r--r-- | kerberosV/src/lib/roken/ecalloc.c | 4 | ||||
-rw-r--r-- | kerberosV/src/lib/roken/hostent_find_fqdn.c | 4 | ||||
-rw-r--r-- | kerberosV/src/lib/roken/setprogname.c | 12 |
5 files changed, 19 insertions, 53 deletions
diff --git a/kerberosV/src/lib/krb5/krbhst-test.c b/kerberosV/src/lib/krb5/krbhst-test.c index df252d120b0..a987e3a81f6 100644 --- a/kerberosV/src/lib/krb5/krbhst-test.c +++ b/kerberosV/src/lib/krb5/krbhst-test.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001 - 2002 Kungliga Tekniska Högskolan + * Copyright (c) 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,30 +33,7 @@ #include "krb5_locl.h" -#include <err.h> -#include <getarg.h> - -RCSID("$KTH: krbhst-test.c,v 1.3 2002/08/23 03:43:18 assar Exp $"); - -static int version_flag = 0; -static int help_flag = 0; - -static struct getargs args[] = { - {"version", 0, arg_flag, &version_flag, - "print version", NULL }, - {"help", 0, arg_flag, &help_flag, - NULL, NULL } -}; - -static void -usage (int ret) -{ - arg_printusage (args, - sizeof(args)/sizeof(*args), - NULL, - "[realms ...]"); - exit (ret); -} +RCSID("$KTH: krbhst-test.c,v 1.2 2001/06/17 12:22:59 assar Exp $"); int main(int argc, char **argv) @@ -66,26 +43,9 @@ main(int argc, char **argv) int types[] = {KRB5_KRBHST_KDC, KRB5_KRBHST_ADMIN, KRB5_KRBHST_CHANGEPW, KRB5_KRBHST_KRB524}; const char *type_str[] = {"kdc", "admin", "changepw", "krb524"}; - int optind = 0; - setprogname (argv[0]); - - if(getarg(args, sizeof(args) / sizeof(args[0]), argc, argv, &optind)) - usage(1); - - if (help_flag) - usage (0); - - if(version_flag){ - print_version(NULL); - exit(0); - } - - argc -= optind; - argv += optind; - krb5_init_context (&context); - for(i = 0; i < argc; i++) { + for(i = 1; i < argc; i++) { krb5_krbhst_handle handle; char host[MAXHOSTNAMELEN]; diff --git a/kerberosV/src/lib/roken/base64-test.c b/kerberosV/src/lib/roken/base64-test.c index f67f1760864..00e4c9e0453 100644 --- a/kerberosV/src/lib/roken/base64-test.c +++ b/kerberosV/src/lib/roken/base64-test.c @@ -33,7 +33,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> -RCSID("$KTH: base64-test.c,v 1.3 2005/04/04 19:24:18 lha Exp $"); +RCSID("$KTH: base64-test.c,v 1.2 2001/05/29 13:12:21 assar Exp $"); #endif #include <roken.h> @@ -71,8 +71,8 @@ main(int argc, char **argv) str = strdup(t->result); len = base64_decode(t->result, str); if(len != t->len) { - fprintf(stderr, "failed test %d: len %lu != %lu\n", numtest, - (unsigned long)len, (unsigned long)t->len); + fprintf(stderr, "failed test %d: len %d != %d\n", numtest, + len, t->len); numerr++; } else if(memcmp(str, t->data, t->len) != 0) { fprintf(stderr, "failed test %d: data\n", numtest); diff --git a/kerberosV/src/lib/roken/ecalloc.c b/kerberosV/src/lib/roken/ecalloc.c index 3558fa35bbe..a03b8bd3edb 100644 --- a/kerberosV/src/lib/roken/ecalloc.c +++ b/kerberosV/src/lib/roken/ecalloc.c @@ -33,7 +33,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> -RCSID("$KTH: ecalloc.c,v 1.2 2005/04/12 11:28:36 lha Exp $"); +RCSID("$KTH: ecalloc.c,v 1.1 2001/06/17 12:09:37 assar Exp $"); #endif #include <stdlib.h> @@ -45,7 +45,7 @@ RCSID("$KTH: ecalloc.c,v 1.2 2005/04/12 11:28:36 lha Exp $"); * Like calloc but never fails. */ -void * ROKEN_LIB_FUNCTION +void * ecalloc (size_t number, size_t size) { void *tmp = calloc (number, size); diff --git a/kerberosV/src/lib/roken/hostent_find_fqdn.c b/kerberosV/src/lib/roken/hostent_find_fqdn.c index 7df28aa66c3..d945b2f37ea 100644 --- a/kerberosV/src/lib/roken/hostent_find_fqdn.c +++ b/kerberosV/src/lib/roken/hostent_find_fqdn.c @@ -33,7 +33,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> -RCSID("$KTH: hostent_find_fqdn.c,v 1.3 2005/04/12 11:28:51 lha Exp $"); +RCSID("$KTH: hostent_find_fqdn.c,v 1.2 2001/07/10 11:58:23 assar Exp $"); #endif #include "roken.h" @@ -42,7 +42,7 @@ RCSID("$KTH: hostent_find_fqdn.c,v 1.3 2005/04/12 11:28:51 lha Exp $"); * Try to find a fqdn (with `.') in he if possible, else return h_name */ -const char * ROKEN_LIB_FUNCTION +const char * hostent_find_fqdn (const struct hostent *he) { const char *ret = he->h_name; diff --git a/kerberosV/src/lib/roken/setprogname.c b/kerberosV/src/lib/roken/setprogname.c index 6e5f9a79de3..19b70fbed9e 100644 --- a/kerberosV/src/lib/roken/setprogname.c +++ b/kerberosV/src/lib/roken/setprogname.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995-2004 Kungliga Tekniska Högskolan + * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #ifdef HAVE_CONFIG_H #include <config.h> -RCSID("$KTH: setprogname.c,v 1.3 2005/04/12 11:29:05 lha Exp $"); +RCSID("$KTH: setprogname.c,v 1.1 2001/07/09 14:56:51 assar Exp $"); #endif #include "roken.h" @@ -43,7 +43,7 @@ extern const char *__progname; #endif #ifndef HAVE_SETPROGNAME -void ROKEN_LIB_FUNCTION +void setprogname(const char *argv0) { #ifndef HAVE___PROGNAME @@ -59,3 +59,9 @@ setprogname(const char *argv0) #endif } #endif /* HAVE_SETPROGNAME */ + +void +set_progname(char *argv0) +{ + setprogname ((const char *)argv0); +} |