From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Aug 28 20:50:06 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DCFD1065670 for ; Sun, 28 Aug 2011 20:50:06 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2429A8FC16 for ; Sun, 28 Aug 2011 20:50:06 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p7SKo5RB062583 for ; Sun, 28 Aug 2011 20:50:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p7SKo5RE062582; Sun, 28 Aug 2011 20:50:05 GMT (envelope-from gnats) Resent-Date: Sun, 28 Aug 2011 20:50:05 GMT Resent-Message-Id: <201108282050.p7SKo5RE062582@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Olli Hauer Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4A6D1065677 for ; Sun, 28 Aug 2011 20:47:09 +0000 (UTC) (envelope-from ohauer@FreeBSD.org) Received: from p578be941.dip0.t-ipconnect.de (p578be941.dip0.t-ipconnect.de [87.139.233.65]) by mx1.freebsd.org (Postfix) with ESMTP id 09C4F8FC12 for ; Sun, 28 Aug 2011 20:47:09 +0000 (UTC) Received: by p578be941.dip0.t-ipconnect.de (Postfix, from userid 1100) id 5DC0820823; Sun, 28 Aug 2011 22:47:05 +0200 (CEST) Message-Id: <20110828204705.5DC0820823@p578be941.dip0.t-ipconnect.de> Date: Sun, 28 Aug 2011 22:47:05 +0200 (CEST) From: Olli Hauer To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: gremlin@portal-to-web.de Subject: ports/160264: [patch] net/tac_plus-libradius fix build on FreeBSD-9 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Olli Hauer List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Aug 2011 20:50:06 -0000 >Number: 160264 >Category: ports >Synopsis: [patch] net/tac_plus-libradius fix build on FreeBSD-9 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Aug 28 20:50:05 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Olli Hauer >Release: FreeBSD 9.0-BETA1 i386 >Organization: >Environment: >Description: "struct utmp" was replaced with "struct utmpx" on FreeBSD-9 The attached patch was tested on FreeBSD-7/8/9 against freeradius. Additional: - replace rc-script - Makefile cleanup - unbreak port - patches are generated with command "make makepatch" - cleanup pkg-plist >How-To-Repeat: >Fix: --- tac_plus-libradius.diff begins here --- Index: Makefile =================================================================== RCS file: /home/pcvs/ports/net/tac_plus-libradius/Makefile,v retrieving revision 1.9 diff -u -r1.9 Makefile --- Makefile 20 Mar 2010 14:42:00 -0000 1.9 +++ Makefile 28 Aug 2011 20:26:24 -0000 @@ -15,6 +15,10 @@ MAINTAINER= gremlin@portal-to-web.de COMMENT= The www.gazi.edu.tr tacacs+ Daemon with pam and libradius support +USE_RC_SUBR= tac_plus + +CONFLICTS= ru-tac+ia-[0-9]* tac_plus-[0-9]* + WRKPREFIX= tac_plus.F5.0.0.alpha WRKSRC= ${WRKDIR}/${WRKPREFIX}/ @@ -25,19 +29,11 @@ .include -.if ${OSVERSION} > 900007 -BROKEN= fails to build with new utmpx -.endif - do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/tac_plus ${PREFIX}/sbin - ${INSTALL_MAN} ${WRKSRC}/tac_plus.1 ${PREFIX}/man/man1/tac_plus.1 + @${INSTALL_PROGRAM} ${WRKSRC}/tac_plus ${PREFIX}/sbin + @${INSTALL_MAN} ${WRKSRC}/tac_plus.1 ${PREFIX}/man/man1/tac_plus.1 @${MKDIR} ${PREFIX}/etc/tac_plus - ${INSTALL_DATA} ${WRKSRC}/tac_plus.cfg ${PREFIX}/etc/tac_plus/ - ${INSTALL_DATA} ${WRKSRC}/radius.example ${PREFIX}/etc/tac_plus/ - @if [ ! -f ${PREFIX}/etc/rc.d/tac_plus.sh ]; then \ - ${ECHO} "Installing ${PREFIX}/etc/rc.d/tac_plus.sh startup file."; \ - ${INSTALL_SCRIPT} -m 751 ${FILESDIR}/tac_plus.sh ${PREFIX}/etc/rc.d/tac_plus.sh.sample; \ - fi + @${INSTALL_DATA} -m 640 ${WRKSRC}/tac_plus.cfg ${PREFIX}/etc/tac_plus/tac_plus.cfg.sample + @${INSTALL_DATA} -m 640 ${WRKSRC}/radius.example ${PREFIX}/etc/tac_plus/radius.cfg.sample .include Index: pkg-plist =================================================================== RCS file: /home/pcvs/ports/net/tac_plus-libradius/pkg-plist,v retrieving revision 1.2 diff -u -r1.2 pkg-plist --- pkg-plist 28 Sep 2002 22:28:04 -0000 1.2 +++ pkg-plist 28 Aug 2011 20:26:24 -0000 @@ -1,5 +1,4 @@ +etc/tac_plus/radius.cfg.sample +etc/tac_plus/tac_plus.cfg.sample sbin/tac_plus -etc/rc.d/tac_plus.sh.sample -etc/tac_plus/radius.example -etc/tac_plus/tac_plus.cfg -@dirrm etc/tac_plus +@dirrmtry etc/tac_plus Index: files/patch-Makefile =================================================================== RCS file: files/patch-Makefile diff -N files/patch-Makefile --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-Makefile 28 Aug 2011 20:26:24 -0000 @@ -0,0 +1,55 @@ +--- ./Makefile.orig 2001-03-21 09:33:15.000000000 +0100 ++++ ./Makefile 2011-08-29 00:31:55.000000000 +0200 +@@ -33,9 +33,9 @@ + CPPFLAGS = + CFLAGS = $(CPPFLAGS) -g -O2 + LDFLAGS = +-OSLIBS = -lldap -lldap -lc -lcrypt -lresolv -lnsl -llber -lcrypt -lc +-DEFINES = -DUSE_LDAP +-OS= -DLINUX -DGLIBC ++OSLIBS = -lc -lcrypt -lcrypt -lc -I/usr/local/include -L/usr/local/lib -lradius ++DEFINES = -DUSE_RADIUS ++OS= + # For AIX + # See /usr/lpp/bos/bsdport on your system for details of how to define bsdcc + # CC=bsdcc +@@ -52,7 +52,7 @@ + #OSLIBS=-lsocket -lnsl + + # For FreeBSD +-# OS=-DFREEBSD ++OS=-DFREEBSD + # You may also need to add: + # OSLIBS=-lcrypt + # NOTE: If you want your password encryption to be compatible with +@@ -108,7 +108,8 @@ + # End of customisable section of Makefile + # + +-CFLAGS = $(DEBUG) $(OPT_FLAGS) $(DEFINES) $(INCLUDES) $(FLAGS) $(OS) $(PIDFILE) $(LDFLAGS) $(DB) ++ ++CFLAGS = $(DEBUG) $(OPT_FLAGS) $(DEFINES) $(INCLUDES) $(FLAGS) $(OS) $(PIDFILE) $(LDFLAGS) $(DB) -I/usr/local/include -L/usr/local/lib + + HFILES = expire.h parse.h regmagic.h md5.h regexp.h tac_plus.h + +@@ -117,7 +118,9 @@ + packet.c report.c sendauth.c tac_plus.c utils.c pw.c hash.c \ + parse.c regexp.c programs.c enable.c pwlib.c default_fn.c \ + skey_fn.c default_v0_fn.c sendpass.c maxsess.c tac_pam.c \ +- db.c db_null.c db_mysql.c ldap.c ++ db.c db_null.c db_mysql.c radius.c ++ ++# add ldap.c and also define USE_LDAP to enable LDAP support + + OBJS = $(SRCS:.c=.o) + +@@ -154,7 +157,8 @@ + install: + cp tac_plus ${prefix}/sbin + cp tac_plus.1 ${prefix}/man/man8/tac_plus.8 +- cp tac_plus.cfg /etc ++ cp tac_plus.cfg ${prefix}/etc/tac_plus ++ cp radius.example ${prefix}/etc/tac_plus + + depend: + makedepend $(CFLAGS) $(SRCS) Index: files/patch-aa =================================================================== RCS file: files/patch-aa diff -N files/patch-aa --- files/patch-aa 20 Sep 2002 20:31:30 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,95 +0,0 @@ -*** Makefile Wed Mar 21 09:33:15 2001 ---- ../pkg/tac_plus.new/Makefile Mon Jan 21 15:51:28 2002 -*************** -*** 33,41 **** - CPPFLAGS = - CFLAGS = $(CPPFLAGS) -g -O2 - LDFLAGS = -! OSLIBS = -lldap -lldap -lc -lcrypt -lresolv -lnsl -llber -lcrypt -lc -! DEFINES = -DUSE_LDAP -! OS= -DLINUX -DGLIBC - # For AIX - # See /usr/lpp/bos/bsdport on your system for details of how to define bsdcc - # CC=bsdcc ---- 33,41 ---- - CPPFLAGS = - CFLAGS = $(CPPFLAGS) -g -O2 - LDFLAGS = -! OSLIBS = -lc -lcrypt -lcrypt -lc -I/usr/local/include -L/usr/local/lib -lradius -! DEFINES = -DUSE_RADIUS -! OS= - # For AIX - # See /usr/lpp/bos/bsdport on your system for details of how to define bsdcc - # CC=bsdcc -*************** -*** 52,58 **** - #OSLIBS=-lsocket -lnsl - - # For FreeBSD -! # OS=-DFREEBSD - # You may also need to add: - # OSLIBS=-lcrypt - # NOTE: If you want your password encryption to be compatible with ---- 52,58 ---- - #OSLIBS=-lsocket -lnsl - - # For FreeBSD -! OS=-DFREEBSD - # You may also need to add: - # OSLIBS=-lcrypt - # NOTE: If you want your password encryption to be compatible with -*************** -*** 108,114 **** - # End of customisable section of Makefile - # - -! CFLAGS = $(DEBUG) $(OPT_FLAGS) $(DEFINES) $(INCLUDES) $(FLAGS) $(OS) $(PIDFILE) $(LDFLAGS) $(DB) - - HFILES = expire.h parse.h regmagic.h md5.h regexp.h tac_plus.h - ---- 108,115 ---- - # End of customisable section of Makefile - # - -! -! CFLAGS = $(DEBUG) $(OPT_FLAGS) $(DEFINES) $(INCLUDES) $(FLAGS) $(OS) $(PIDFILE) $(LDFLAGS) $(DB) -I/usr/local/include -L/usr/local/lib - - HFILES = expire.h parse.h regmagic.h md5.h regexp.h tac_plus.h - -*************** -*** 117,123 **** - packet.c report.c sendauth.c tac_plus.c utils.c pw.c hash.c \ - parse.c regexp.c programs.c enable.c pwlib.c default_fn.c \ - skey_fn.c default_v0_fn.c sendpass.c maxsess.c tac_pam.c \ -! db.c db_null.c db_mysql.c ldap.c - - OBJS = $(SRCS:.c=.o) - ---- 118,126 ---- - packet.c report.c sendauth.c tac_plus.c utils.c pw.c hash.c \ - parse.c regexp.c programs.c enable.c pwlib.c default_fn.c \ - skey_fn.c default_v0_fn.c sendpass.c maxsess.c tac_pam.c \ -! db.c db_null.c db_mysql.c radius.c -! -! # add ldap.c and also define USE_LDAP to enable LDAP support - - OBJS = $(SRCS:.c=.o) - -*************** -*** 154,160 **** - install: - cp tac_plus ${prefix}/sbin - cp tac_plus.1 ${prefix}/man/man8/tac_plus.8 -! cp tac_plus.cfg /etc - - depend: - makedepend $(CFLAGS) $(SRCS) ---- 157,164 ---- - install: - cp tac_plus ${prefix}/sbin - cp tac_plus.1 ${prefix}/man/man8/tac_plus.8 -! cp tac_plus.cfg ${prefix}/etc/tac_plus -! cp radius.example ${prefix}/etc/tac_plus - - depend: - makedepend $(CFLAGS) $(SRCS) Index: files/patch-ab =================================================================== RCS file: files/patch-ab diff -N files/patch-ab --- files/patch-ab 4 Nov 2007 15:07:23 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,23 +0,0 @@ -Index: config.c -@@ -109,7 +109,7 @@ - static int no_user_dflt = 0; /* default if user doesn't exist */ - static char *authen_default = NULL; /* top level authentication default */ - static int authen_default_method = 0; /*For method check */ --static char *nopasswd_str = "nopassword"; -+char *nopasswd_str = "nopassword"; - - /* A host definition structure. Currently unused, but when we start - configuring host-specific information e.g. per-host keys, this is -@@ -602,6 +602,12 @@ - fprintf(stderr,"sym_code=%i, ldap\n",sym_code); - authen_default_method = sym_code; - break; -+#endif -+#ifdef USE_RADIUS -+ case S_radius: -+ fprintf(stderr,"sym_code=%i, radius\n",sym_code); -+ authen_default_method = sym_code; -+ break; - #endif - - Index: files/patch-ac =================================================================== RCS file: files/patch-ac diff -N files/patch-ac --- files/patch-ac 20 Sep 2002 20:31:30 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,19 +0,0 @@ -*** do_acct.c Mon Dec 18 17:58:02 2000 ---- do_acct.c Sat Jan 19 15:22:46 2002 -*************** -*** 159,165 **** - #endif - entry.ut_time = utime; - -! wtmpfd = open(wtmpfile, O_CREAT | O_WRONLY | O_APPEND | O_SYNC, 0644); - if (wtmpfd < 0) { - report(LOG_ERR, "Can't open wtmp file %s -- %s", - wtmpfile, sys_errlist[errno]); ---- 159,165 ---- - #endif - entry.ut_time = utime; - -! wtmpfd = open(wtmpfile, O_CREAT | O_WRONLY | O_APPEND , 0644); - if (wtmpfd < 0) { - report(LOG_ERR, "Can't open wtmp file %s -- %s", - wtmpfile, sys_errlist[errno]); Index: files/patch-ad =================================================================== RCS file: files/patch-ad diff -N files/patch-ad --- files/patch-ad 20 Sep 2002 20:31:30 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,27 +0,0 @@ -*** parse.c Fri Mar 16 09:14:21 2001 ---- ../../tac_plus.F5.0.0.alpha/parse.c Sun Jan 20 19:46:42 2002 -*************** -*** 99,104 **** ---- 99,107 ---- - #ifdef USE_LDAP - declare ("ldap", S_ldap); - #endif -+ #ifdef USE_RADIUS -+ declare ("radius",S_radius); -+ #endif - declare("member", S_member); - declare("message", S_message); - declare("name", S_name); -*************** -*** 177,182 **** ---- 180,189 ---- - #ifdef USE_LDAP - case S_ldap: - return ("ldap"); -+ #endif -+ #ifdef USE_RADIUS -+ case S_radius: -+ return ("radius"); - #endif - case S_expires: - return ("expires"); Index: files/patch-ae =================================================================== RCS file: files/patch-ae diff -N files/patch-ae --- files/patch-ae 20 Sep 2002 20:31:30 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,11 +0,0 @@ -*** parse.h Fri Mar 16 09:18:44 2001 ---- ../../tac_plus.F5.0.0.alpha/parse.h Sat Jan 19 23:55:09 2002 -*************** -*** 85,87 **** ---- 85,90 ---- - #ifdef USE_LDAP - #define S_ldap 46 - #endif /* LDAP */ -+ #ifdef USE_RADIUS -+ #define S_radius 47 -+ #endif /* radius */ Index: files/patch-af =================================================================== RCS file: files/patch-af diff -N files/patch-af --- files/patch-af 20 Sep 2002 20:31:30 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,38 +0,0 @@ -*** pwlib.c Fri Mar 16 14:42:54 2001 ---- ../../tac_plus.F5.0.0.alpha/pwlib.c Sat Jan 19 23:22:07 2002 -*************** -*** 40,45 **** ---- 40,49 ---- - #include "ldap.h" - #endif /* LDAP */ - -+ #ifdef USE_RADIUS -+ #include "radius.h" -+ #endif -+ - /* Generic password verification routines for des, file and cleartext - passwords */ - -*************** -*** 166,171 **** ---- 170,189 ---- - #ifdef USE_LDAP - case (S_ldap): - if (ldap_verify(name, passwd, file)==1) { -+ data->status = TAC_PLUS_AUTHEN_STATUS_FAIL; -+ return (0); -+ } else { -+ data->status = TAC_PLUS_AUTHEN_STATUS_PASS; -+ } -+ exp_date = NULL; -+ set_expiration_status(exp_date, data); -+ return (data->status == TAC_PLUS_AUTHEN_STATUS_PASS); -+ break; -+ #endif -+ -+ #ifdef USE_RADIUS -+ case (S_radius): -+ if (radius_verify(name,passwd,file)==1) { - data->status = TAC_PLUS_AUTHEN_STATUS_FAIL; - return (0); - } else { Index: files/patch-ag =================================================================== RCS file: files/patch-ag diff -N files/patch-ag --- files/patch-ag 27 Feb 2004 08:54:56 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,20 +0,0 @@ ---- tac_plus.h.orig Fri Feb 27 09:48:32 2004 -+++ tac_plus.h Fri Feb 27 09:49:16 2004 -@@ -70,7 +70,7 @@ - */ - /* #define REARMSIGNAL */ - --#define VERSION "F4.0.3.alpha.v7(DB&PAM support)" -+#define VERSION "F4.0.3.alpha.v7(DB,PAM&libradius support - incl. mmersbers patches!)" - - /* - * System definitions. -@@ -681,7 +681,7 @@ - extern char *cfg_get_global_secret(); - #ifdef USE_PAM - extern char *cfg_get_pam_service(); --#endif / *PAM */ -+#endif /* PAM */ - extern void cfg_clean_config(); - extern char *cfg_nodestring(); - Index: files/patch-ah =================================================================== RCS file: files/patch-ah diff -N files/patch-ah --- files/patch-ah 27 Feb 2004 08:54:56 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,13 +0,0 @@ ---- db_null.c.orig Fri Feb 27 09:49:40 2004 -+++ db_null.c Fri Feb 27 09:51:14 2004 -@@ -48,9 +48,7 @@ - char *a_username; - char *elapsed_time;char *bytes_in;char *bytes_out; - { --report(LOG_INFO,"Db accounting user=%s pass=%s host=%s --db_name=%s table=%s servern=%s clientn=%s username=%s et=%s bi=%s bo=%s",db_user,db_password,db_hostname, --db_name,db_table,s_name,c_name,a_username,elapsed_time,bytes_in,bytes_out); -+report(LOG_INFO,"Db accounting user=%s pass=%s host=%s db_name=%s table=%s servern=%s clientn=%s username=%s et=%s bi=%s bo=%s",db_user,db_password,db_hostname, db_name,db_table,s_name,c_name,a_username,elapsed_time,bytes_in,bytes_out); - return (1); - } - #endif Index: files/patch-config.c =================================================================== RCS file: files/patch-config.c diff -N files/patch-config.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-config.c 28 Aug 2011 20:26:24 -0000 @@ -0,0 +1,24 @@ +--- ./config.c.orig 2001-03-16 10:04:27.000000000 +0100 ++++ ./config.c 2011-08-29 00:31:55.000000000 +0200 +@@ -109,7 +109,7 @@ + static int no_user_dflt = 0; /* default if user doesn't exist */ + static char *authen_default = NULL; /* top level authentication default */ + static int authen_default_method = 0; /*For method check */ +-static char *nopasswd_str = "nopassword"; ++char *nopasswd_str = "nopassword"; + + /* A host definition structure. Currently unused, but when we start + configuring host-specific information e.g. per-host keys, this is +@@ -603,6 +603,12 @@ + authen_default_method = sym_code; + break; + #endif ++#ifdef USE_RADIUS ++ case S_radius: ++ fprintf(stderr,"sym_code=%i, radius\n",sym_code); ++ authen_default_method = sym_code; ++ break; ++#endif + + + default: Index: files/patch-db_null.c =================================================================== RCS file: files/patch-db_null.c diff -N files/patch-db_null.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-db_null.c 28 Aug 2011 20:26:24 -0000 @@ -0,0 +1,13 @@ +--- ./db_null.c.orig 2000-12-18 17:58:02.000000000 +0100 ++++ ./db_null.c 2011-08-29 00:31:55.000000000 +0200 +@@ -48,9 +48,7 @@ + char *a_username; + char *elapsed_time;char *bytes_in;char *bytes_out; + { +-report(LOG_INFO,"Db accounting user=%s pass=%s host=%s +-db_name=%s table=%s servern=%s clientn=%s username=%s et=%s bi=%s bo=%s",db_user,db_password,db_hostname, +-db_name,db_table,s_name,c_name,a_username,elapsed_time,bytes_in,bytes_out); ++report(LOG_INFO,"Db accounting user=%s pass=%s host=%s db_name=%s table=%s servern=%s clientn=%s username=%s et=%s bi=%s bo=%s",db_user,db_password,db_hostname, db_name,db_table,s_name,c_name,a_username,elapsed_time,bytes_in,bytes_out); + return (1); + } + #endif Index: files/patch-do_acct.c =================================================================== RCS file: files/patch-do_acct.c diff -N files/patch-do_acct.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-do_acct.c 28 Aug 2011 20:26:24 -0000 @@ -0,0 +1,25 @@ +--- ./do_acct.c.orig 2000-12-18 17:58:02.000000000 +0100 ++++ ./do_acct.c 2011-08-29 00:31:55.000000000 +0200 +@@ -21,6 +21,13 @@ + + static int acctfd = 0; + ++#if defined(__FreeBSD__) && __FreeBSD_version >= 900007 ++# define utmp utmpx ++# define ut_time ut_tv.tv_sec ++# define ut_name ut_user ++#endif ++ ++ + /* Make a acct entry into the accounting file for accounting. + Return 1 on error */ + +@@ -159,7 +166,7 @@ + #endif + entry.ut_time = utime; + +- wtmpfd = open(wtmpfile, O_CREAT | O_WRONLY | O_APPEND | O_SYNC, 0644); ++ wtmpfd = open(wtmpfile, O_CREAT | O_WRONLY | O_APPEND , 0644); + if (wtmpfd < 0) { + report(LOG_ERR, "Can't open wtmp file %s -- %s", + wtmpfile, sys_errlist[errno]); Index: files/patch-parse.c =================================================================== RCS file: files/patch-parse.c diff -N files/patch-parse.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-parse.c 28 Aug 2011 20:26:24 -0000 @@ -0,0 +1,23 @@ +--- ./parse.c.orig 2001-03-16 09:14:21.000000000 +0100 ++++ ./parse.c 2011-08-29 00:31:55.000000000 +0200 +@@ -99,6 +99,9 @@ + #ifdef USE_LDAP + declare ("ldap", S_ldap); + #endif ++#ifdef USE_RADIUS ++ declare ("radius",S_radius); ++#endif + declare("member", S_member); + declare("message", S_message); + declare("name", S_name); +@@ -178,6 +181,10 @@ + case S_ldap: + return ("ldap"); + #endif ++#ifdef USE_RADIUS ++ case S_radius: ++ return ("radius"); ++#endif + case S_expires: + return ("expires"); + case S_after: Index: files/patch-parse.h =================================================================== RCS file: files/patch-parse.h diff -N files/patch-parse.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-parse.h 28 Aug 2011 20:26:24 -0000 @@ -0,0 +1,9 @@ +--- ./parse.h.orig 2001-03-16 09:18:44.000000000 +0100 ++++ ./parse.h 2011-08-29 00:31:55.000000000 +0200 +@@ -85,3 +85,6 @@ + #ifdef USE_LDAP + #define S_ldap 46 + #endif /* LDAP */ ++#ifdef USE_RADIUS ++#define S_radius 47 ++#endif /* radius */ Index: files/patch-pwlib.c =================================================================== RCS file: files/patch-pwlib.c diff -N files/patch-pwlib.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-pwlib.c 28 Aug 2011 20:26:24 -0000 @@ -0,0 +1,34 @@ +--- ./pwlib.c.orig 2001-03-16 14:42:54.000000000 +0100 ++++ ./pwlib.c 2011-08-29 00:31:55.000000000 +0200 +@@ -40,6 +40,10 @@ + #include "ldap.h" + #endif /* LDAP */ + ++#ifdef USE_RADIUS ++#include "radius.h" ++#endif ++ + /* Generic password verification routines for des, file and cleartext + passwords */ + +@@ -177,6 +181,20 @@ + break; + #endif + ++#ifdef USE_RADIUS ++ case (S_radius): ++ if (radius_verify(name,passwd,file)==1) { ++ data->status = TAC_PLUS_AUTHEN_STATUS_FAIL; ++ return (0); ++ } else { ++ data->status = TAC_PLUS_AUTHEN_STATUS_PASS; ++ } ++ exp_date = NULL; ++ set_expiration_status(exp_date, data); ++ return (data->status == TAC_PLUS_AUTHEN_STATUS_PASS); ++ break; ++#endif ++ + + #ifdef USE_PAM + case (S_pam): Index: files/patch-tac_plus.h =================================================================== RCS file: files/patch-tac_plus.h diff -N files/patch-tac_plus.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-tac_plus.h 28 Aug 2011 20:26:24 -0000 @@ -0,0 +1,40 @@ +--- ./tac_plus.h.orig 2000-12-18 17:58:02.000000000 +0100 ++++ ./tac_plus.h 2011-08-29 00:31:55.000000000 +0200 +@@ -70,7 +70,7 @@ + */ + /* #define REARMSIGNAL */ + +-#define VERSION "F4.0.3.alpha.v7(DB&PAM support)" ++#define VERSION "F4.0.3.alpha.v7(DB,PAM&libradius support - incl. mmersbers patches!)" + + /* + * System definitions. +@@ -154,6 +154,7 @@ + #endif /* MSCHAP */ + + #include ++#include + #include + #include + #include +@@ -172,7 +173,11 @@ + #include + #endif + ++#if __FreeBSD_version >= 900000 ++#include ++#else + #include ++#endif + + #include + +@@ -681,7 +686,7 @@ + extern char *cfg_get_global_secret(); + #ifdef USE_PAM + extern char *cfg_get_pam_service(); +-#endif / *PAM */ ++#endif /* PAM */ + extern void cfg_clean_config(); + extern char *cfg_nodestring(); + Index: files/tac_plus.in =================================================================== RCS file: files/tac_plus.in diff -N files/tac_plus.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/tac_plus.in 28 Aug 2011 20:26:24 -0000 @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: tac_plus +# REQUIRE: DAEMON +# KEYWORD: shutdown + +# +# Define these tac_plus_* variables in +# /etc/rc.conf or +# /etc/rc.conf.local +# +# tac_plus_enabe="YES" +# tac_plus_cfg="%%PREFIX%%/etc/tac_plus/tac_plus.cfg" +# tac_plus_flags="-d 1" # see man (1) tac_plus +# + +. /etc/rc.subr + +name="tac_plus" +rcvar=`set_rcvar` + +command=%%PREFIX%%/sbin/tac_plus +pidfile=/var/run/tac_plus.pid +tac_plus_enable=${tac_plus_enable:-"NO"} +tac_plus_flags=${tac_plus_flags:-"-d 1"} +tac_plus_configfile=${tac_plus_configfile:-"%%PREFIX%%/etc/tac_plus/tac_plus.cfg"} + +load_rc_config $name + +required_files=${tac_plus_configfile} +tac_plus_flags="-C ${tac_plus_configfile} ${tac_plus_flags}" + +run_rc_command "$1" Index: files/tac_plus.sh =================================================================== RCS file: files/tac_plus.sh diff -N files/tac_plus.sh --- files/tac_plus.sh 20 Sep 2002 20:31:30 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,20 +0,0 @@ -#!/bin/sh - -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 -fi - -case "$1" in -start) - [ -x ${PREFIX}/sbin/tac_plus -a -f ${PREFIX}/etc/tac_plus/tac_plus.conf ] && ${PREFIX}/sbin/tac_plus -C ${PREFIX}/etc/tac_plus/tac_plus.conf -d 1 && echo -n ' tac_plus' - ;; -stop) - killall tac_plus && echo -n ' tac_plus' - ;; -*) - echo "Usage: `basename $0` {start|stop}" >&2 - ;; -esac - -exit 0 --- tac_plus-libradius.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: