diff options
author | Karl Ramm <kcr@mit.edu> | 2009-03-24 03:40:55 +0000 |
---|---|---|
committer | Karl Ramm <kcr@mit.edu> | 2009-03-24 03:40:55 +0000 |
commit | 1f49ca59077f337c6327e80833265ac32932b876 (patch) | |
tree | 1b6eeab4ebe9b032e8930a9e025587dbb4f36183 /server/kstuff.c | |
parent | cf8bf8391cffc4cd35e634a8b9a3adf954260b88 (diff) |
keep track of total # of incoming header fields, and cksum appropriately
Diffstat (limited to 'server/kstuff.c')
-rw-r--r-- | server/kstuff.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/server/kstuff.c b/server/kstuff.c index 5ae30d4..3a013e1 100644 --- a/server/kstuff.c +++ b/server/kstuff.c @@ -431,15 +431,24 @@ ZCheckRealmAuthentication(ZNotice_t *notice, cksum0_len = x + strlen(x) + 1 - cksum0_base; /* second part is from z_multinotice through other fields: * - z_multinotice - * - z_multiuid + * - z_multiuid + * - z_sender_(sock)addr + * - z_charset * - z_other_fields[] */ cksum1_base = notice->z_multinotice; if (notice->z_num_other_fields) - x = notice->z_other_fields[notice->z_num_other_fields]; - else - x = cksum1_base + strlen(cksum1_base) + 1; /* multiuid */ - cksum1_len = x + strlen(x) + 1 - cksum1_base; + x = notice->z_other_fields[notice->z_num_other_fields - 1]; + else { + /* see also lib/ZCkZaut.c:ZCheckZcodeAuthentication */ + /* XXXXXXXXXXXXXXXXXXXXXXX */ + x = cksum1_base + strlen(cksum1_base) + 1; /* multinotice */ + if (notice->z_num_hdr_fields > 17) + x = x + strlen(x) + 1; /* multiuid */ + if (notice->z_num_hdr_fields > 18) + x = x + strlen(x) + 1; /* sender */ + } + cksum1_len = x + strlen(x) + 1 - cksum1_base; /* charset / extra field */ /* last part is the message body */ cksum2_base = notice->z_message; |