From 52ad171b21ca9d3e381b5c743ec0688d5922d786 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Tue, 9 Dec 1997 09:07:10 +0000 Subject: always those small bugs.. --- kerberosIV/krb/get_krbrlm.c | 4 ++-- kerberosIV/krb/kuserok.c | 4 ++-- kerberosIV/krb/unparse_name.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'kerberosIV/krb') diff --git a/kerberosIV/krb/get_krbrlm.c b/kerberosIV/krb/get_krbrlm.c index 11de4231b19..8bbb3f35de6 100644 --- a/kerberosIV/krb/get_krbrlm.c +++ b/kerberosIV/krb/get_krbrlm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: get_krbrlm.c,v 1.9 1997/12/09 07:57:17 art Exp $ */ +/* $OpenBSD: get_krbrlm.c,v 1.10 1997/12/09 09:07:07 art Exp $ */ /* $KTH: get_krbrlm.c,v 1.16 1997/05/02 01:26:22 assar Exp $ */ /* @@ -73,7 +73,7 @@ krb_get_lrealm(char *r, int n) return(KFAILURE); /* Temporary restriction */ /* First try user specified file */ - if (dir != 0 && getuid() != geteuid()) { + if (dir != 0 && !issetugid()) { char fname[MAXPATHLEN]; if(k_concat(fname, sizeof(fname), dir, "/krb.conf", NULL) == 0) if (krb_get_lrealm_f(r, n, fname) == KSUCCESS) diff --git a/kerberosIV/krb/kuserok.c b/kerberosIV/krb/kuserok.c index 45e6ce0028b..7989fde5e7d 100644 --- a/kerberosIV/krb/kuserok.c +++ b/kerberosIV/krb/kuserok.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kuserok.c,v 1.4 1997/12/09 07:57:26 art Exp $ */ +/* $OpenBSD: kuserok.c,v 1.5 1997/12/09 09:07:08 art Exp $ */ /* $KTH: kuserok.c,v 1.21 1997/04/01 08:18:35 joda Exp $ */ /* @@ -107,7 +107,7 @@ krb_kuserok(char *name, char *instance, char *realm, char *luser) return OK; strncpy(file, pwd->pw_dir, MAXPATHLEN); file[MAXPATHLEN-1] = '\0'; - strncat(file, "/.klogin", MAXPATHLEN); + strncat(file, "/.klogin", MAXPATHLEN - strlen(file)); file[MAXPATHLEN-1] = '\0'; f = fopen(file, "r"); diff --git a/kerberosIV/krb/unparse_name.c b/kerberosIV/krb/unparse_name.c index 2b74e030156..78f3675a775 100644 --- a/kerberosIV/krb/unparse_name.c +++ b/kerberosIV/krb/unparse_name.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unparse_name.c,v 1.2 1997/12/09 07:57:41 art Exp $ */ +/* $OpenBSD: unparse_name.c,v 1.3 1997/12/09 09:07:09 art Exp $ */ /* $KTH: unparse_name.c,v 1.7 1997/04/01 08:18:46 joda Exp $ */ /* @@ -60,12 +60,12 @@ krb_unparse_name_r(krb_principal *pr, char *fullname) { quote_string("'@\\", pr->name, fullname); if(pr->instance[0]){ - strncat(fullname, ".", MAXPATHLEN); + strncat(fullname, ".", MAXPATHLEN - strlen(fullname)); fullname[MAXPATHLEN-1] = '\0'; quote_string("@\\", pr->instance, fullname + strlen(fullname)); } if(pr->realm[0]){ - strncat(fullname, "@", MAXPATHLEN); + strncat(fullname, "@", MAXPATHLEN - strlen(fullname)); fullname[MAXPATHLEN-1] = '\0'; quote_string("\\", pr->realm, fullname + strlen(fullname)); } -- cgit v1.2.3