diff options
author | Hugh Graham <hugh@cvs.openbsd.org> | 2001-04-15 23:48:17 +0000 |
---|---|---|
committer | Hugh Graham <hugh@cvs.openbsd.org> | 2001-04-15 23:48:17 +0000 |
commit | 420542eac6b2a2ea081757507d99469d00de1411 (patch) | |
tree | 6cfc2d828c028c33379e38e4009c88801ecca433 /libexec/identd/parse.c | |
parent | 8a1460d1bbefded143a3197d62b0a666e5695840 (diff) |
Replace a bunch of conditional expressions with global pointers.
Requested and checked by millert.
Diffstat (limited to 'libexec/identd/parse.c')
-rw-r--r-- | libexec/identd/parse.c | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/libexec/identd/parse.c b/libexec/identd/parse.c index de7a26379a8..b31cd83f049 100644 --- a/libexec/identd/parse.c +++ b/libexec/identd/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.22 2001/04/14 02:49:19 hugh Exp $ */ +/* $OpenBSD: parse.c,v 1.23 2001/04/15 23:48:16 hugh Exp $ */ /* * This program is in the public domain and may be used freely by anyone @@ -280,9 +280,7 @@ parse(fd, laddr, faddr) uid); n = snprintf(buf, sizeof(buf), "%d , %d : USERID : %s%s%s :%d\r\n", - lport, fport, other_flag ? "OTHER" : "UNIX", - charset_name ? " , " : "", - charset_name ? charset_name : "", uid); + lport, fport, opsys_name, charset_sep, charset_name, uid); if (timed_write(fd, buf, n, IO_TIMEOUT) != n && syslog_flag) { syslog(LOG_NOTICE, "write to %s: %m", gethost(faddr)); return 1; @@ -313,9 +311,7 @@ parse(fd, laddr, faddr) token, uid, pw->pw_name); n = snprintf(buf, sizeof(buf), "%d , %d : USERID : %s%s%s :%s\r\n", - lport, fport, other_flag ? "OTHER" : "UNIX", - charset_name ? " , " : "", - charset_name ? charset_name : "", token); + lport, fport, opsys_name, charset_sep, charset_name, token); if (timed_write(fd, buf, n, IO_TIMEOUT) != n && syslog_flag) { syslog(LOG_NOTICE, "write to %s: %m", gethost(faddr)); return 1; @@ -329,9 +325,7 @@ parse(fd, laddr, faddr) pw->pw_name); n = snprintf(buf, sizeof(buf), "%d , %d : USERID : %s%s%s :%s\r\n", - lport, fport, other_flag ? "OTHER" : "UNIX", - charset_name ? " , " : "", - charset_name ? charset_name : "", token); + lport, fport, opsys_name, charset_sep, charset_name, token); if (timed_write(fd, buf, n, IO_TIMEOUT) != n && syslog_flag) { syslog(LOG_NOTICE, "write to %s: %m", gethost(faddr)); return 1; @@ -342,9 +336,7 @@ parse(fd, laddr, faddr) if (number_flag) { n = snprintf(buf, sizeof(buf), "%d , %d : USERID : %s%s%s :%d\r\n", - lport, fport, other_flag ? "OTHER" : "UNIX", - charset_name ? " , " : "", - charset_name ? charset_name : "", uid); + lport, fport, opsys_name, charset_sep, charset_name, uid); if (timed_write(fd, buf, n, IO_TIMEOUT) != n && syslog_flag) { syslog(LOG_NOTICE, "write to %s: %m", gethost(faddr)); return 1; @@ -352,9 +344,7 @@ parse(fd, laddr, faddr) return 0; } n = snprintf(buf, sizeof(buf), "%d , %d : USERID : %s%s%s :%s\r\n", - lport, fport, other_flag ? "OTHER" : "UNIX", - charset_name ? " , " : "", - charset_name ? charset_name : "", pw->pw_name); + lport, fport, opsys_name, charset_sep, charset_name, pw->pw_name); if (timed_write(fd, buf, n, IO_TIMEOUT) != n && syslog_flag) { syslog(LOG_NOTICE, "write to %s: %m", gethost(faddr)); return 1; @@ -458,9 +448,7 @@ parse6(fd, laddr, faddr) uid); n = snprintf(buf, sizeof(buf), "%d , %d : USERID : %s%s%s :%d\r\n", - lport, fport, other_flag ? "OTHER" : "UNIX", - charset_name ? " , " : "", - charset_name ? charset_name : "", uid); + lport, fport, opsys_name, charset_sep, charset_name, uid); if (timed_write(fd, buf, n, IO_TIMEOUT) != n && syslog_flag) { syslog(LOG_NOTICE, "write to %s: %m", gethost6(faddr)); return 1; @@ -491,9 +479,7 @@ parse6(fd, laddr, faddr) token, uid, pw->pw_name); n = snprintf(buf, sizeof(buf), "%d , %d : USERID : %s%s%s :%s\r\n", - lport, fport, other_flag ? "OTHER" : "UNIX", - charset_name ? " , " : "", - charset_name ? charset_name : "", token); + lport, fport, opsys_name, charset_sep, charset_name, token); if (timed_write(fd, buf, n, IO_TIMEOUT) != n && syslog_flag) { syslog(LOG_NOTICE, "write to %s: %m", gethost6(faddr)); return 1; @@ -507,9 +493,7 @@ parse6(fd, laddr, faddr) pw->pw_name); n = snprintf(buf, sizeof(buf), "%d , %d : USERID : %s%s%s :%s\r\n", - lport, fport, other_flag ? "OTHER" : "UNIX", - charset_name ? " , " : "", - charset_name ? charset_name : "", token); + lport, fport, opsys_name, charset_sep, charset_name, token); if (timed_write(fd, buf, n, IO_TIMEOUT) != n && syslog_flag) { syslog(LOG_NOTICE, "write to %s: %m", gethost6(faddr)); return 1; @@ -520,9 +504,7 @@ parse6(fd, laddr, faddr) if (number_flag) { n = snprintf(buf, sizeof(buf), "%d , %d : USERID : %s%s%s :%d\r\n", - lport, fport, other_flag ? "OTHER" : "UNIX", - charset_name ? " , " : "", - charset_name ? charset_name : "", uid); + lport, fport, opsys_name, charset_sep, charset_name, uid); if (timed_write(fd, buf, n, IO_TIMEOUT) != n && syslog_flag) { syslog(LOG_NOTICE, "write to %s: %m", gethost6(faddr)); return 1; @@ -531,9 +513,7 @@ parse6(fd, laddr, faddr) } n = snprintf(buf, sizeof(buf), "%d , %d : USERID : %s%s%s :%s\r\n", - lport, fport, other_flag ? "OTHER" : "UNIX", - charset_name ? " , " : "", - charset_name ? charset_name : "", pw->pw_name); + lport, fport, opsys_name, charset_sep, charset_name, pw->pw_name); if (timed_write(fd, buf, n, IO_TIMEOUT) != n && syslog_flag) { syslog(LOG_NOTICE, "write to %s: %m", gethost6(faddr)); return 1; |