[187] in bug-owl
auth patch fix
daemon@ATHENA.MIT.EDU (Roman Mitz)
Wed Jun 18 17:49:51 2003
Date: Wed, 18 Jun 2003 17:49:41 -0400
Mime-Version: 1.0 (Apple Message framework v552)
Content-Type: multipart/mixed; boundary=Apple-Mail-8-356370635
From: Roman Mitz <rmitz@cmu.edu>
To: bug-owl@mit.edu
Message-Id: <C44E8B0B-A1D6-11D7-982F-000393C44284@cmu.edu>
--Apple-Mail-8-356370635
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
I had assumed that for messages of directions other than in, the
znotice would be null. That appears to not be the case. I have
attached a corrected patch. I tested this particular case. :) I'm not
as happy with the solution, but I figure there are reasons why the
direction has to be checked. I'd be interested in knowing why my
assumption (a comment in the previous patch) was invalid...
--Apple-Mail-8-356370635
Content-Disposition: attachment;
filename=owl-auth-export.patch
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
x-unix-mode=0600;
name="owl-auth-export.patch"
Index: functions.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/ktools/src/owl/repository//owl/functions.c,v
retrieving revision 1.62
diff -u -r1.62 functions.c
--- functions.c 2003/06/07 16:09:48 1.62
+++ functions.c 2003/06/17 21:01:08
@@ -1310,16 +1310,8 @@
owl_fmtext_append_normal(&fm, buff);
owl_fmtext_append_normal(&fm, " Auth : ");
- if (n->z_auth == ZAUTH_FAILED) {
- owl_fmtext_append_normal(&fm, "FAILED\n");
- } else if (n->z_auth == ZAUTH_NO) {
- owl_fmtext_append_normal(&fm, "NO\n");
- } else if (n->z_auth == ZAUTH_YES) {
- owl_fmtext_append_normal(&fm, "YES\n");
- } else {
- sprintf(buff, "Unknown State (%i)\n", n->z_auth);
- owl_fmtext_append_normal(&fm, buff);
- }
+ owl_fmtext_append_normal(&fm, owl_zephyr_get_auth(n));
+ owl_fmtext_append_normal(&fm, "\n");
/* fix this */
sprintf(buff, " Checkd Ath: %i\n", n->z_checked_auth);
Index: readconfig.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/ktools/src/owl/repository//owl/readconfig.c,v
retrieving revision 1.10
diff -u -r1.10 readconfig.c
--- readconfig.c 2003/06/10 19:15:00 1.10
+++ readconfig.c 2003/06/18 21:32:49
@@ -168,9 +168,17 @@
/* set owl::type */
sv_setpv(perl_get_sv("owl::type", TRUE), owl_message_type_to_string(m));
+
+ /* set owl::auth default */
+ sv_setpv(perl_get_sv("owl::auth", TRUE), "YES");
+
/* set owl::direction */
if (owl_message_is_direction_in(m)) {
sv_setpv(perl_get_sv("owl::direction", TRUE), "in");
+
+ /* Change auth value for in messages */
+ sv_setpv(perl_get_sv("owl::auth", TRUE), owl_zephyr_get_auth(owl_message_get_notice(m)));
+
} else if (owl_message_is_direction_out(m)) {
sv_setpv(perl_get_sv("owl::direction", TRUE), "out");
} else if (owl_message_is_direction_none(m)) {
Index: zephyr.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/ktools/src/owl/repository//owl/zephyr.c,v
retrieving revision 1.17
diff -u -r1.17 zephyr.c
--- zephyr.c 2003/06/04 15:14:41 1.17
+++ zephyr.c 2003/06/18 16:20:12
@@ -255,6 +255,30 @@
}
+char *owl_zephyr_get_auth(ZNotice_t *n)
+{
+ /* return auth string */
+
+ if (!n) {
+ return "UNKNOWN";
+ }
+
+ if (n->z_auth == ZAUTH_FAILED) {
+ return ("FAILED");
+ } else if (n->z_auth == ZAUTH_NO) {
+ return ("NO");
+ } else if (n->z_auth == ZAUTH_YES) {
+ return ("YES");
+ } else {
+ return ("UNKNOWN");
+ }
+}
+
+
int send_zephyr(char *opcode, char *zsig, char *class, char *instance, char *recipient, char *message)
{
int ret;
--Apple-Mail-8-356370635
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
Roman.
------
Director of Computing Resources
The Center for the Neural Basis of Cognition
--Apple-Mail-8-356370635--