From 2d3e7e2ff06879a37f188b6543f7f00561caa777 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 14 Aug 2002 03:09:53 +0000 Subject: [PATCH] * acl_files.c (canon;): Properly handle appending of the local realm, which was botched due to a buffer-overflow patch. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14708 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/v4server/ChangeLog | 5 +++++ src/kadmin/v4server/acl_files.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/kadmin/v4server/ChangeLog b/src/kadmin/v4server/ChangeLog index a21170680..8865dde4a 100644 --- a/src/kadmin/v4server/ChangeLog +++ b/src/kadmin/v4server/ChangeLog @@ -1,3 +1,8 @@ +2002-08-13 Tom Yu + + * acl_files.c (canon;): Properly handle appending of the local + realm, which was botched due to a buffer-overflow patch. + 2001-11-19 Ezra Peisach * kadm_server.h: Update prototype for convert_kadm5_to_kadm. diff --git a/src/kadmin/v4server/acl_files.c b/src/kadmin/v4server/acl_files.c index 8a6118c83..bbc9bb71b 100644 --- a/src/kadmin/v4server/acl_files.c +++ b/src/kadmin/v4server/acl_files.c @@ -142,12 +142,19 @@ char *canon; return; } } else if(krb_get_lrealm(realm, 1) != KSUCCESS) { - if(canon + strlen(realm) < canon_save + MAX_PRINCIPAL_SIZE) { + if(canon + strlen(KRB_REALM) < canon_save + MAX_PRINCIPAL_SIZE) { strcpy(canon, KRB_REALM); } else { strcpy(canon, ""); return; } + } else { + if (canon + strlen(realm) < canon_save + MAX_PRINCIPAL_SIZE) { + strcpy(canon, realm); + } else { + strcpy(canon, ""); + return; + } } } -- 2.26.2