head 1.4; access; symbols pkgsrc-2021Q1:1.3.0.142 pkgsrc-2021Q1-base:1.3 pkgsrc-2020Q4:1.3.0.140 pkgsrc-2020Q4-base:1.3 pkgsrc-2020Q3:1.3.0.138 pkgsrc-2020Q3-base:1.3 pkgsrc-2020Q2:1.3.0.134 pkgsrc-2020Q2-base:1.3 pkgsrc-2020Q1:1.3.0.114 pkgsrc-2020Q1-base:1.3 pkgsrc-2019Q4:1.3.0.136 pkgsrc-2019Q4-base:1.3 pkgsrc-2019Q3:1.3.0.132 pkgsrc-2019Q3-base:1.3 pkgsrc-2019Q2:1.3.0.130 pkgsrc-2019Q2-base:1.3 pkgsrc-2019Q1:1.3.0.128 pkgsrc-2019Q1-base:1.3 pkgsrc-2018Q4:1.3.0.126 pkgsrc-2018Q4-base:1.3 pkgsrc-2018Q3:1.3.0.124 pkgsrc-2018Q3-base:1.3 pkgsrc-2018Q2:1.3.0.122 pkgsrc-2018Q2-base:1.3 pkgsrc-2018Q1:1.3.0.120 pkgsrc-2018Q1-base:1.3 pkgsrc-2017Q4:1.3.0.118 pkgsrc-2017Q4-base:1.3 pkgsrc-2017Q3:1.3.0.116 pkgsrc-2017Q3-base:1.3 pkgsrc-2017Q2:1.3.0.112 pkgsrc-2017Q2-base:1.3 pkgsrc-2017Q1:1.3.0.110 pkgsrc-2017Q1-base:1.3 pkgsrc-2016Q4:1.3.0.108 pkgsrc-2016Q4-base:1.3 pkgsrc-2016Q3:1.3.0.106 pkgsrc-2016Q3-base:1.3 pkgsrc-2016Q2:1.3.0.104 pkgsrc-2016Q2-base:1.3 pkgsrc-2016Q1:1.3.0.102 pkgsrc-2016Q1-base:1.3 pkgsrc-2015Q4:1.3.0.100 pkgsrc-2015Q4-base:1.3 pkgsrc-2015Q3:1.3.0.98 pkgsrc-2015Q3-base:1.3 pkgsrc-2015Q2:1.3.0.96 pkgsrc-2015Q2-base:1.3 pkgsrc-2015Q1:1.3.0.94 pkgsrc-2015Q1-base:1.3 pkgsrc-2014Q4:1.3.0.92 pkgsrc-2014Q4-base:1.3 pkgsrc-2014Q3:1.3.0.90 pkgsrc-2014Q3-base:1.3 pkgsrc-2014Q2:1.3.0.88 pkgsrc-2014Q2-base:1.3 pkgsrc-2014Q1:1.3.0.86 pkgsrc-2014Q1-base:1.3 pkgsrc-2013Q4:1.3.0.84 pkgsrc-2013Q4-base:1.3 pkgsrc-2013Q3:1.3.0.82 pkgsrc-2013Q3-base:1.3 pkgsrc-2013Q2:1.3.0.80 pkgsrc-2013Q2-base:1.3 pkgsrc-2013Q1:1.3.0.78 pkgsrc-2013Q1-base:1.3 pkgsrc-2012Q4:1.3.0.76 pkgsrc-2012Q4-base:1.3 pkgsrc-2012Q3:1.3.0.74 pkgsrc-2012Q3-base:1.3 pkgsrc-2012Q2:1.3.0.72 pkgsrc-2012Q2-base:1.3 pkgsrc-2012Q1:1.3.0.70 pkgsrc-2012Q1-base:1.3 pkgsrc-2011Q4:1.3.0.68 pkgsrc-2011Q4-base:1.3 pkgsrc-2011Q3:1.3.0.66 pkgsrc-2011Q3-base:1.3 pkgsrc-2011Q2:1.3.0.64 pkgsrc-2011Q2-base:1.3 pkgsrc-2011Q1:1.3.0.62 pkgsrc-2011Q1-base:1.3 pkgsrc-2010Q4:1.3.0.60 pkgsrc-2010Q4-base:1.3 pkgsrc-2010Q3:1.3.0.58 pkgsrc-2010Q3-base:1.3 pkgsrc-2010Q2:1.3.0.56 pkgsrc-2010Q2-base:1.3 pkgsrc-2010Q1:1.3.0.54 pkgsrc-2010Q1-base:1.3 pkgsrc-2009Q4:1.3.0.52 pkgsrc-2009Q4-base:1.3 pkgsrc-2009Q3:1.3.0.50 pkgsrc-2009Q3-base:1.3 pkgsrc-2009Q2:1.3.0.48 pkgsrc-2009Q2-base:1.3 pkgsrc-2009Q1:1.3.0.46 pkgsrc-2009Q1-base:1.3 pkgsrc-2008Q4:1.3.0.44 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.42 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.40 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.38 pkgsrc-2008Q2-base:1.3 cwrapper:1.3.0.36 pkgsrc-2008Q1:1.3.0.34 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.32 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.30 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.28 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.26 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.3.0.24 pkgsrc-2006Q4-base:1.3 pkgsrc-2006Q3:1.3.0.22 pkgsrc-2006Q3-base:1.3 pkgsrc-2006Q2:1.3.0.20 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.3.0.18 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.3.0.16 pkgsrc-2005Q4-base:1.3 pkgsrc-2005Q3:1.3.0.14 pkgsrc-2005Q3-base:1.3 pkgsrc-2005Q2:1.3.0.12 pkgsrc-2005Q2-base:1.3 pkgsrc-2005Q1:1.3.0.10 pkgsrc-2005Q1-base:1.3 pkgsrc-2004Q4:1.3.0.8 pkgsrc-2004Q4-base:1.3 pkgsrc-2004Q3:1.3.0.6 pkgsrc-2004Q3-base:1.3 pkgsrc-2004Q2:1.3.0.4 pkgsrc-2004Q2-base:1.3 pkgsrc-2004Q1:1.3.0.2 pkgsrc-2004Q1-base:1.3 pkgsrc-2003Q4:1.2.0.10 pkgsrc-2003Q4-base:1.2 netbsd-1-6-1:1.2.0.6 netbsd-1-6-1-base:1.2 netbsd-1-6:1.2.0.8 netbsd-1-6-RELEASE-base:1.2 pkgviews:1.2.0.4 pkgviews-base:1.2 buildlink2:1.2.0.2 buildlink2-base:1.2 netbsd-1-5-PATCH003:1.2; locks; strict; comment @# @; 1.4 date 2021.04.24.08.42.48; author wiz; state dead; branches; next 1.3; commitid ihp8gFiOzrvguwQC; 1.3 date 2003.12.16.19.19.41; author martti; state Exp; branches; next 1.2; 1.2 date 2001.12.20.10.05.50; author martti; state Exp; branches; next 1.1; 1.1 date 2001.10.11.09.57.21; author martti; state Exp; branches; next ; desc @@ 1.4 log @radiusd-cistron: remove Upstream development stopped, recommended to switch to FreeRadius, in 2012. @ text @$NetBSD: patch-af,v 1.3 2003/12/16 19:19:41 martti Exp $ --- src/radwho.c.orig Wed Jul 2 12:39:03 2003 +++ src/radwho.c Tue Dec 16 20:20:12 2003 @@@@ -20,6 +20,7 @@@@ #include #include #include +#include #include #include #include @@@@ -40,18 +41,20 @@@@ * Header above output and format. */ char *hdr1 = -"Login Name What TTY When From Location"; -char *ufmt1 = "%-10.10s %-17.17s %-5.5s %-4.4s %-9.9s %-9.9s %-.16s%s"; +"Login Name What TTY When From Location"; +char *ufmt1 = "%-16.16s %-17.17s %-5.5s %-4.4s %-9.9s %-9.9s %-.*s%s"; char *ufmt1r = "%s,%s,%s,%s,%s,%s,%s%s"; -char *rfmt1 = "%-10.10s %-17.17s %-5.5s %s%-3d %-9.9s %-9.9s %-.19s%s"; +char *rfmt1 = "%-16.16s %-17.17s %-5.5s %s%-3d %-9.9s %-9.9s %-.*s%s"; char *rfmt1r = "%s,%s,%s,%s%u,%s,%s,%s%s"; +#define FMT1_HOST_SIZE 13 char *hdr2 = -"Login Port What When From Location"; -char *ufmt2 = "%-10.10s %-6.6d %-7.7s %-13.13s %-10.10s %-.16s%s"; +"Login Port What When From Location"; +char *ufmt2 = "%-16.16s %-6.6d %-7.7s %-13.13s %-10.10s %-.*s%s"; char *ufmt2r = "%s,%u,%s,%s,%s,%s%s"; -char *rfmt2 = "%-10.10s %s%-5d %-6.6s %-13.13s %-10.10s %-.28s%s"; +char *rfmt2 = "%-16.16s %s%-5d %-6.6s %-13.13s %-10.10s %-.*s%s"; char *rfmt2r = "%s,%s%u,%s,%s,%s,%s%s"; +#define FMT2_HOST_SIZE 19 char *eol = "\n"; NAS *naslist; @@@@ -307,7 +310,8 @@@@ return tmp; } if (strncmp(tty, "cu", 2) == 0) { - return tmp + 2; + sprintf(tmp, "%.15s", tty + 2); + return tmp; } return "??"; } @@@@ -371,6 +375,8 @@@@ */ int main(int argc, char **argv) { + struct winsize ws; + int extra_width = 0; FILE *fp; struct radutmp rt; struct utmp ut; @@@@ -389,6 +395,11 @@@@ char *p, *q, *portind; int c, portno; + ioctl(0, TIOCGWINSZ, &ws); + if (ws.ws_col >= 80) { + extra_width = ws.ws_col - 80; + } + while((c = getopt(argc, argv, "Dd:flhnsipcru:")) != EOF) switch(c) { case 'D': use_dns = 0; @@@@ -486,14 +497,17 @@@@ while(fread(&ut, sizeof(ut), 1, fp) == 1) { #ifdef USER_PROCESS if (ut.ut_user[0] && ut.ut_line[0] && - ut.ut_type == USER_PROCESS) { + ut.ut_type == USER_PROCESS) #else - if (ut.ut_user[0] && ut.ut_line[0]) { + if (ut.ut_user[0] && ut.ut_line[0]) #endif - if (showname) + { + strncpy(inbuf, ut.ut_name, UT_NAMESIZE); + inbuf[UT_NAMESIZE] = '\0'; + if (showname) printf((rawoutput == 0? ufmt1: ufmt1r), - ut.ut_name, - fullname(ut.ut_name), + inbuf, + fullname(inbuf), "shell", ttyshort(ut.ut_line), #ifdef __svr4__ @@@@ -502,10 +516,11 @@@@ dotime(ut.ut_time), #endif ut.ut_host, + FMT1_HOST_SIZE + extra_width, myname, eol); else printf((rawoutput==0? ufmt2:ufmt2r), - ut.ut_name, + inbuf, ttyshort(ut.ut_line), "shell", #ifdef __svr4__ @@@@ -514,6 +529,7 @@@@ dotime(ut.ut_time), #endif ut.ut_host, + FMT2_HOST_SIZE + extra_width, myname, eol); } } @@@@ -560,6 +576,7 @@@@ portind, portno, dotime(rt.time), nasname(ntohl(rt.nas_address)), + FMT1_HOST_SIZE + extra_width, hostname(rt.framed_address), eol); else printf((rawoutput == 0? rfmt2: rfmt2r), @@@@ -568,6 +585,7 @@@@ proto(rt.proto, rt.porttype), dotime(rt.time), nasname(ntohl(rt.nas_address)), + FMT2_HOST_SIZE + extra_width, hostname(rt.framed_address), eol); } } @ 1.3 log @radiusd-cistron (1.6.7) cistron; urgency=medium * Fix checkrad.pl::cisco_snmp and usrhiper_snmp so that communities other than "public" can be used too. * Error out on superflous command line args (optind >= argc) * Encrypt CHAP-Password in radclient so that CHAP can be tested too * Add "wildcard" option to realms - if you set this option, you can match on the entire username using shell wildcards in the realms file. * If the nastype in /etc/raddb/naslist is set to 'none' for a nas, logins on that nas will have no simultaneous use restrictions imposed and those logins will not count towards the total amount of logins. * Removed 'raduse' and manpage. * Can disable radutmp with "-u none" (likewise radwtmp with "-W none", though we already had "-w" for that). * Call checkrad with an extra argument, the framed IP address. * Fix bug where $INCLUDEing a file without any records would cause the rest of the original file to be ignored * Support for 64-bit wide integers (integer8 type). If compiled with gcc, users file can contain both hex and decimal 64-bit values, and 64-bit values are printed in decimal. With other compilers (no "long long" support) only hex 64-bit values are supported. * Change "_" to "-" in dictionary.redback and change the 64 bits values to integer8. * Moved the dictionary files to /usr/local/share/radius. Now only /etc/raddb/dictionary remains that $INCLUDES all the others. For new installs only; existing installations won't be changed * Make integer in the format string of sprintf(buf, "%03d:%.20s", ..) in make_wtmp() unsigned (%u), otherwise the sprintf could in some cases (negative NAS-Port, very long NAS-name) overrun the buffer by one byte, overwriting the least significant byte of the return address on the stack with a \0. Not sure if this is exploitable or not, but it could be a security problem. * Make sure ut.login (struct radutmp member) is treated everywhere as a NON-zero terminated string. * Make sure unsigned integers are used in all places using lvalues (32 bits radius values), especially nas_port. * radrelay: update id of packet when retransmitting. * Print an error and free the request struct if we receive an unknown packet type. * rad_check_multi: if username/NAS/port match, don't count as dup. @ text @d1 1 a1 1 $NetBSD: patch-af,v 1.2 2001/12/20 10:05:50 martti Exp $ @ 1.2 log @Updated to 1.6.5. * Bug fixes * Clean up BSD password file support again * Fixed bug in auth.c wrt decoding of short password attributes. * Server now replies to Status-Server inquiries. * Add "-v" switch to radzap (suggested by Dan Harkless). * Add "-Z" switch to radiusd, prevents logging of passwords for -y (suggested by Dan Harkless). * Change "duplicate detected" message to actually show _what_ authentication packet causes the duplicate * Wrote manualpages for radlast,radzap, radwho, radclient, radtest, radwatch and raduse. Yes, documentation! * Added -P pidfile option to radiusd and radrelay See the doc/ChangeLog file for a comple list of changes! @ text @d1 1 a1 1 $NetBSD: patch-af,v 1.1 2001/10/11 09:57:21 martti Exp $ d3 2 a4 2 --- src/radwho.c.orig Mon May 7 22:33:45 2001 +++ src/radwho.c Thu Dec 20 09:38:25 2001 d13 1 a13 1 @@@@ -40,18 +41,21 @@@@ d24 2 a25 2 char *rfmt1r = "%s,%s,%s,%s%d,%s,%s,%s%s"; +#define FMT1_HOST_SIZE 13 d32 1 a32 1 char *ufmt2r = "%s,%d,%s,%s,%s,%s%s"; d35 2 a36 3 char *rfmt2r = "%s,%s%d,%s,%s,%s,%s%s"; +#define FMT2_HOST_SIZE 19 + d40 1 a40 1 @@@@ -307,7 +311,8 @@@@ d50 1 a50 1 @@@@ -371,6 +376,8 @@@@ d59 1 a59 1 @@@@ -388,6 +395,11 @@@@ d71 1 a71 1 @@@@ -485,14 +497,17 @@@@ d94 1 a94 1 @@@@ -501,10 +516,11 @@@@ d107 1 a107 1 @@@@ -513,6 +529,7 @@@@ d115 1 a115 1 @@@@ -557,6 +574,7 @@@@ d123 1 a123 1 @@@@ -565,6 +583,7 @@@@ @ 1.1 log @Added radiusd-cistron which was submitted in pkg/13274. @ text @d1 1 a1 1 $NetBSD$ d3 3 a5 3 --- src/radwho.c.orig Wed Jul 5 12:53:20 2000 +++ src/radwho.c Wed Jan 10 23:55:49 2001 @@@@ -16,6 +16,7 @@@@ d13 1 a13 1 @@@@ -34,18 +35,21 @@@@ d41 1 a41 1 @@@@ -301,7 +305,8 @@@@ d51 1 a51 1 @@@@ -363,6 +368,8 @@@@ d60 1 a60 1 @@@@ -378,6 +385,11 @@@@ d69 1 a69 1 while((c = getopt(argc, argv, "Dflhnsipcr")) != EOF) switch(c) { d72 1 a72 1 @@@@ -469,14 +481,17 @@@@ d95 1 a95 1 @@@@ -485,10 +500,11 @@@@ d108 1 a108 1 @@@@ -497,6 +513,7 @@@@ d116 1 a116 1 @@@@ -541,6 +558,7 @@@@ d124 1 a124 1 @@@@ -549,6 +567,7 @@@@ @