summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Insulander <hin@cvs.openbsd.org>2002-06-07 05:05:16 +0000
committerHans Insulander <hin@cvs.openbsd.org>2002-06-07 05:05:16 +0000
commit4db144e990928baa765d9b66c12b7e619e76a895 (patch)
tree64cd46bf358672ba8bcf7aa14000be4bf060a3b6
parent897452938eeb640001f2551c37d01ca3036867db (diff)
Merge in some progname changes, and a couple of bugfixes from arla.
-rw-r--r--usr.sbin/afs/src/appl/bos/bos.c4
-rw-r--r--usr.sbin/afs/src/appl/lib/arlalib.c2
-rw-r--r--usr.sbin/afs/src/appl/lib/ka-procs.c12
-rw-r--r--usr.sbin/afs/src/appl/pts/pts.c5
-rw-r--r--usr.sbin/afs/src/appl/vos/vos.c3
-rw-r--r--usr.sbin/afs/src/arlad/arlad.c2
-rw-r--r--usr.sbin/afs/src/arlad/fcache.c2
-rw-r--r--usr.sbin/afs/src/lib/ko/agetarg.c2
-rw-r--r--usr.sbin/afs/src/lib/ko/kocell.c7
-rw-r--r--usr.sbin/afs/src/lib/ko/koerror.c2
-rw-r--r--usr.sbin/afs/src/lib/sl/sl.c2
-rw-r--r--usr.sbin/afs/src/rxdef/ka.xg2
-rw-r--r--usr.sbin/afs/src/util/log.c2
13 files changed, 28 insertions, 19 deletions
diff --git a/usr.sbin/afs/src/appl/bos/bos.c b/usr.sbin/afs/src/appl/bos/bos.c
index aab1932d598..63421da19d1 100644
--- a/usr.sbin/afs/src/appl/bos/bos.c
+++ b/usr.sbin/afs/src/appl/bos/bos.c
@@ -145,9 +145,7 @@ main(int argc, char **argv)
Log_method *method;
int ret = 0;
- set_progname(argv[0]);
-
- method = log_open (get_progname(), "/dev/stderr:notime");
+ method = log_open (__progname, "/dev/stderr:notime");
if (method == NULL)
errx (1, "log_open failed");
cell_init(0, method);
diff --git a/usr.sbin/afs/src/appl/lib/arlalib.c b/usr.sbin/afs/src/appl/lib/arlalib.c
index beee976b1d7..5d14eb84fbc 100644
--- a/usr.sbin/afs/src/appl/lib/arlalib.c
+++ b/usr.sbin/afs/src/appl/lib/arlalib.c
@@ -433,6 +433,8 @@ arlalib_get_viceid_servers (const char *username, const char *cellname,
*viceId = ilist.val[0];
return 0;
}
+ } else {
+ return ENETDOWN;
}
return res;
diff --git a/usr.sbin/afs/src/appl/lib/ka-procs.c b/usr.sbin/afs/src/appl/lib/ka-procs.c
index d8c8eb37ccd..f06d1b08cd3 100644
--- a/usr.sbin/afs/src/appl/lib/ka-procs.c
+++ b/usr.sbin/afs/src/appl/lib/ka-procs.c
@@ -396,8 +396,8 @@ ka_auth (const char *user, const char *instance, const char *cell,
req_challange = tv.tv_sec;
des_set_key (key, schedule);
- des_pcbc_encrypt ((unsigned char *)&f,
- (unsigned char *)buf,
+ des_pcbc_encrypt ((des_cblock *)&f,
+ (des_cblock *)&buf,
sizeof(f),
schedule,
key,
@@ -440,8 +440,8 @@ ka_auth (const char *user, const char *instance, const char *cell,
*/
des_set_key (key, schedule);
- des_pcbc_encrypt ((unsigned char *)answer.Seq.val,
- (unsigned char *)answer.Seq.val,
+ des_pcbc_encrypt ((des_cblock *)answer.Seq.val,
+ (des_cblock *)answer.Seq.val,
answer.Seq.len,
schedule,
key,
@@ -552,8 +552,8 @@ ka_getticket (const char *suser, const char *sinstance, const char *srealm,
/* decrypt it */
des_set_key (&adata->sessionkey, schedule);
- des_pcbc_encrypt ((unsigned char *)answer.Seq.val,
- (unsigned char *)answer.Seq.val,
+ des_pcbc_encrypt ((des_cblock *)answer.Seq.val,
+ (des_cblock *)answer.Seq.val,
answer.Seq.len,
schedule,
&adata->sessionkey,
diff --git a/usr.sbin/afs/src/appl/pts/pts.c b/usr.sbin/afs/src/appl/pts/pts.c
index 0a21f2e6d9a..ccab7ed9378 100644
--- a/usr.sbin/afs/src/appl/pts/pts.c
+++ b/usr.sbin/afs/src/appl/pts/pts.c
@@ -43,6 +43,8 @@ static int help_cmd (int argc, char **argv);
/* Debugging on/off */
static int prdebug = 0;
+extern char *__progname;
+
static int
empty_cmd (int argc, char **argv)
{
@@ -1525,10 +1527,9 @@ main(int argc, char **argv)
int pos = 0;
int i;
- set_progname(argv[0]);
tzset();
- method = log_open (get_progname(), "/dev/stderr:notime");
+ method = log_open (__progname, "/dev/stderr:notime");
if (method == NULL)
errx (1, "log_open failed");
cell_init(0, method);
diff --git a/usr.sbin/afs/src/appl/vos/vos.c b/usr.sbin/afs/src/appl/vos/vos.c
index 14a502e9e65..e8f86193c5c 100644
--- a/usr.sbin/afs/src/appl/vos/vos.c
+++ b/usr.sbin/afs/src/appl/vos/vos.c
@@ -147,10 +147,9 @@ main(int argc, char **argv)
Log_method *method;
int ret = 0;
- set_progname(argv[0]);
tzset();
- method = log_open (get_progname(), "/dev/stderr:notime");
+ method = log_open (__progname, "/dev/stderr:notime");
if (method == NULL)
errx (1, "log_open failed");
cell_init(0, method);
diff --git a/usr.sbin/afs/src/arlad/arlad.c b/usr.sbin/afs/src/arlad/arlad.c
index c8630166e2d..e12ddddd55d 100644
--- a/usr.sbin/afs/src/arlad/arlad.c
+++ b/usr.sbin/afs/src/arlad/arlad.c
@@ -235,8 +235,6 @@ main (int argc, char **argv)
int optind = 0;
int ret;
- set_progname (argv[0]);
-
if (getarg (args, sizeof(args)/sizeof(*args), argc, argv, &optind))
usage (1);
diff --git a/usr.sbin/afs/src/arlad/fcache.c b/usr.sbin/afs/src/arlad/fcache.c
index 66ff6c4ff95..1d7a1af4020 100644
--- a/usr.sbin/afs/src/arlad/fcache.c
+++ b/usr.sbin/afs/src/arlad/fcache.c
@@ -2555,7 +2555,7 @@ write_attr (FCacheEntry *entry,
if (connected_mode == CONNECTED) {
ConnCacheEntry *conn;
fs_server_context context;
- u_int32_t host;
+ u_int32_t host = 0;
for (conn = find_first_fs (entry, ce, &context);
conn != NULL;
diff --git a/usr.sbin/afs/src/lib/ko/agetarg.c b/usr.sbin/afs/src/lib/ko/agetarg.c
index 55ba76cc990..0f15bac8d1f 100644
--- a/usr.sbin/afs/src/lib/ko/agetarg.c
+++ b/usr.sbin/afs/src/lib/ko/agetarg.c
@@ -42,6 +42,8 @@ RCSID("$KTH: agetarg.c,v 1.8.2.3 2001/05/17 07:38:30 lha Exp $");
#define ISFLAG(X) ((X)->type == aarg_flag || (X)->type == aarg_negative_flag)
+extern char *__progname;
+
static size_t
print_arg (FILE *stream, int mdoc, int longp, struct agetargs *arg,
int style)
diff --git a/usr.sbin/afs/src/lib/ko/kocell.c b/usr.sbin/afs/src/lib/ko/kocell.c
index c329180a2a5..b699d720df4 100644
--- a/usr.sbin/afs/src/lib/ko/kocell.c
+++ b/usr.sbin/afs/src/lib/ko/kocell.c
@@ -274,7 +274,7 @@ dns_lookup_cell (const char *cell, cell_entry *c)
struct resource_record *rr;
int dbnum = 0;
cell_db_entry dbservers[256];
- int lowest_ttl;
+ int lowest_ttl = INT_MAX;
int i;
struct timeval tv;
@@ -300,7 +300,7 @@ dns_lookup_cell (const char *cell, cell_entry *c)
if (dbnum >= sizeof (dbservers) / sizeof(*dbservers)) {
break;
}
- if (lowest_ttl > rr->ttl || lowest_ttl == 0)
+ if (lowest_ttl > rr->ttl)
lowest_ttl = rr->ttl;
dbservers[dbnum].name = strdup (mx->domain);
if (dbservers[dbnum].name == NULL)
@@ -322,6 +322,9 @@ dns_lookup_cell (const char *cell, cell_entry *c)
}
dns_free_data(r);
+ if (lowest_ttl == INT_MAX)
+ lowest_ttl = 0;
+
/* catch the hosts that didn't fit in additional rr */
c->timeout = lowest_ttl + tv.tv_sec;
updatehosts (c, dbnum, dbservers);
diff --git a/usr.sbin/afs/src/lib/ko/koerror.c b/usr.sbin/afs/src/lib/ko/koerror.c
index da7eb2e7194..7397f089a26 100644
--- a/usr.sbin/afs/src/lib/ko/koerror.c
+++ b/usr.sbin/afs/src/lib/ko/koerror.c
@@ -46,7 +46,6 @@ RCSID("$KTH: koerror.c,v 1.20 2001/01/08 16:48:03 lha Exp $");
#include <pts.h>
#include <bos.h>
#include <ubik.h>
-#include <ka.h>
#include <rx/rx.h>
#include <rx/rxgencon.h>
#ifdef KERBEROS
@@ -54,6 +53,7 @@ RCSID("$KTH: koerror.c,v 1.20 2001/01/08 16:48:03 lha Exp $");
#include <des.h>
#include <rxkad.h>
#endif
+#include <ka.h>
#include <ko.h>
#include <fs_errors.h>
diff --git a/usr.sbin/afs/src/lib/sl/sl.c b/usr.sbin/afs/src/lib/sl/sl.c
index 374d86185be..bb07c2e1887 100644
--- a/usr.sbin/afs/src/lib/sl/sl.c
+++ b/usr.sbin/afs/src/lib/sl/sl.c
@@ -38,6 +38,8 @@ RCSID("$KTH: sl.c,v 1.8 2000/03/07 22:08:48 assar Exp $");
#include "sl_locl.h"
+extern char *__progname;
+
static size_t __attribute__ ((unused))
print_sl (FILE *stream, int mdoc, int longp, SL_cmd *c)
{
diff --git a/usr.sbin/afs/src/rxdef/ka.xg b/usr.sbin/afs/src/rxdef/ka.xg
index f1f30d9b31f..d4044dd67f1 100644
--- a/usr.sbin/afs/src/rxdef/ka.xg
+++ b/usr.sbin/afs/src/rxdef/ka.xg
@@ -112,7 +112,9 @@ struct EncryptionKey {
const MAXKANAMELEN = 64;
#define MAXKANAMELEN 64
+%#ifndef MAXKTCTICKETLEN
const MAXKTCTICKETLEN = 344;
+%#endif
const KA_LABELSIZE = 4;
typedef string kaname<MAXKANAMELEN>;
diff --git a/usr.sbin/afs/src/util/log.c b/usr.sbin/afs/src/util/log.c
index 4a748e810a4..2bb4ab7f349 100644
--- a/usr.sbin/afs/src/util/log.c
+++ b/usr.sbin/afs/src/util/log.c
@@ -62,6 +62,8 @@ RCSID("$KTH: log.c,v 1.28.2.2 2001/04/30 02:55:41 lha Exp $");
#include <err.h>
#include "log.h"
+extern char *__progname;
+
/*
* The structure for each logging method.
*/