summaryrefslogtreecommitdiff
path: root/kerberosIV/kafs
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1997-12-12 11:46:33 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1997-12-12 11:46:33 +0000
commit010210f5e782885370197a5401cbc2cde33dfd8b (patch)
tree3d4e65ee8bb32537340a0db454de276937c7191b /kerberosIV/kafs
parent390045d41f0f925904ec89d6771a384ac0bebdb5 (diff)
This should be the last cleanup for today. *yawn*
Diffstat (limited to 'kerberosIV/kafs')
-rw-r--r--kerberosIV/kafs/afskrb.c3
-rw-r--r--kerberosIV/kafs/afssys.c1
-rw-r--r--kerberosIV/kafs/afssysdefs.h3
-rw-r--r--kerberosIV/kafs/common.c19
4 files changed, 17 insertions, 9 deletions
diff --git a/kerberosIV/kafs/afskrb.c b/kerberosIV/kafs/afskrb.c
index d6809e541ed..8f85cd4e35d 100644
--- a/kerberosIV/kafs/afskrb.c
+++ b/kerberosIV/kafs/afskrb.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: afskrb.c,v 1.2 1997/12/12 11:46:31 art Exp $ */
/* $KTH: afskrb.c,v 1.8 1997/10/14 23:00:39 joda Exp $ */
/*
@@ -87,7 +88,7 @@ static char *
get_realm(kafs_data *data, const char *host)
{
char *r = krb_realmofhost(host);
- if(r)
+ if(r != NULL)
return strdup(r);
return NULL;
}
diff --git a/kerberosIV/kafs/afssys.c b/kerberosIV/kafs/afssys.c
index eb849791abc..168e467ad10 100644
--- a/kerberosIV/kafs/afssys.c
+++ b/kerberosIV/kafs/afssys.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: afssys.c,v 1.4 1997/12/12 11:46:31 art Exp $ */
/* $KTH: afssys.c,v 1.53 1997/05/04 02:30:41 assar Exp $ */
/*
diff --git a/kerberosIV/kafs/afssysdefs.h b/kerberosIV/kafs/afssysdefs.h
index 7aa113d6f78..0a35fe2e70e 100644
--- a/kerberosIV/kafs/afssysdefs.h
+++ b/kerberosIV/kafs/afssysdefs.h
@@ -1,3 +1,4 @@
+/* $OpenBSD: afssysdefs.h,v 1.3 1997/12/12 11:46:32 art Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
@@ -36,7 +37,7 @@
* SUCH DAMAGE.
*/
-/* $Id: afssysdefs.h,v 1.2 1997/11/28 12:48:43 art Exp $ */
+/* $Id: afssysdefs.h,v 1.3 1997/12/12 11:46:32 art Exp $ */
/*
* This section is for machines using single entry point AFS syscalls!
diff --git a/kerberosIV/kafs/common.c b/kerberosIV/kafs/common.c
index 12f175e696a..8a35d4dea8b 100644
--- a/kerberosIV/kafs/common.c
+++ b/kerberosIV/kafs/common.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: common.c,v 1.3 1997/12/12 11:46:32 art Exp $ */
/* $KTH: common.c,v 1.3 1997/11/03 20:35:24 bg Exp $ */
/*
@@ -218,9 +219,12 @@ _kafs_afslog_all_local_cells(kafs_data *data, uid_t uid)
find_cells(_PATH_THISCELL, &cells, &index);
ret = afslog_cells(data, cells, index, uid);
- while(index > 0)
+ while(index > 0) {
free(cells[--index]);
+ cells[index] = NULL;
+ }
free(cells);
+ cells = NULL;
return ret;
}
@@ -282,10 +286,10 @@ realm_of_cell(kafs_data *data, const char *cell, char **realm)
int
_kafs_get_cred(kafs_data *data,
- const char *cell,
- const char *krealm,
- const char *lrealm,
- CREDENTIALS *c)
+ const char *cell,
+ const char *krealm,
+ const char *lrealm,
+ CREDENTIALS *c)
{
int ret = -1;
char *vl_realm;
@@ -316,7 +320,7 @@ _kafs_get_cred(kafs_data *data,
* blondino and she might as well have it.)
*/
- if (krealm) {
+ if (krealm != NULL) {
ret = (*data->get_cred)(data, AUTH_SUPERUSER, cell, krealm, c);
if (ret == 0) return 0;
ret = (*data->get_cred)(data, AUTH_SUPERUSER, "", krealm, c);
@@ -337,10 +341,11 @@ _kafs_get_cred(kafs_data *data,
if (ret)
ret = (*data->get_cred)(data, AUTH_SUPERUSER, "", vl_realm, c);
free(vl_realm);
+ vl_realm = NULL;
if (ret == 0) return 0;
}
- if (lrealm)
+ if (lrealm != NULL)
ret = (*data->get_cred)(data, AUTH_SUPERUSER, cell, lrealm, c);
return ret;
}