r40092 - in /trunk/libauthen-tacacsplus-perl: Changes META.yml TacacsPlus.pm debian/changelog debian/compat debian/control debian/copyright debian/rules tacpluslib/tac_client.c

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Fri Jul 17 19:23:51 UTC 2009


Author: jawnsy-guest
Date: Fri Jul 17 19:23:43 2009
New Revision: 40092

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=40092
Log:
* New upstream release
  + Implement a timeout for connect()
* Added myself to Uploaders and Copyright
* Standards-Version 3.8.2
* Upgraded to the new shorter debhelper format
* d/compat 7

Modified:
    trunk/libauthen-tacacsplus-perl/Changes
    trunk/libauthen-tacacsplus-perl/META.yml
    trunk/libauthen-tacacsplus-perl/TacacsPlus.pm
    trunk/libauthen-tacacsplus-perl/debian/changelog
    trunk/libauthen-tacacsplus-perl/debian/compat
    trunk/libauthen-tacacsplus-perl/debian/control
    trunk/libauthen-tacacsplus-perl/debian/copyright
    trunk/libauthen-tacacsplus-perl/debian/rules
    trunk/libauthen-tacacsplus-perl/tacpluslib/tac_client.c

Modified: trunk/libauthen-tacacsplus-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libauthen-tacacsplus-perl/Changes?rev=40092&op=diff
==============================================================================
--- trunk/libauthen-tacacsplus-perl/Changes (original)
+++ trunk/libauthen-tacacsplus-perl/Changes Fri Jul 17 19:23:43 2009
@@ -38,3 +38,9 @@
 
 0.19 Sun Mar 16 2008, Mike McCauley
      - Fixed 'make test' failure in taclibplus due to missing pure_all target
+
+0.20 Fri July 10, 2009 Mike McCauley
+     - Fixed incorect spelling of 'Authentication' in tac_client.c
+     - implements a 
+     timeout for the connect() operation. It uses the timeout value which is
+     passed to the init_tac_session() function. Contributed by Robert Leibl

Modified: trunk/libauthen-tacacsplus-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libauthen-tacacsplus-perl/META.yml?rev=40092&op=diff
==============================================================================
--- trunk/libauthen-tacacsplus-perl/META.yml (original)
+++ trunk/libauthen-tacacsplus-perl/META.yml Fri Jul 17 19:23:43 2009
@@ -1,10 +1,18 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         Authen-TacacsPlus
-version:      0.19
-version_from: TacacsPlus.pm
-installdirs:  site
-requires:
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+--- #YAML:1.0
+name:               Authen-TacacsPlus
+version:            0.20
+abstract:           ~
+author:  []
+license:            unknown
+distribution_type:  module
+configure_requires:
+    ExtUtils::MakeMaker:  0
+requires:  {}
+no_index:
+    directory:
+        - t
+        - inc
+generated_by:       ExtUtils::MakeMaker version 6.48
+meta-spec:
+    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:  1.4

Modified: trunk/libauthen-tacacsplus-perl/TacacsPlus.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libauthen-tacacsplus-perl/TacacsPlus.pm?rev=40092&op=diff
==============================================================================
--- trunk/libauthen-tacacsplus-perl/TacacsPlus.pm (original)
+++ trunk/libauthen-tacacsplus-perl/TacacsPlus.pm Fri Jul 17 19:23:43 2009
@@ -17,7 +17,7 @@
 @EXPORT_OK = qw(
 	TACPLUS_CLIENT
 );
-$VERSION = '0.19';
+$VERSION = '0.20';
 
 sub new
 {

Modified: trunk/libauthen-tacacsplus-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libauthen-tacacsplus-perl/debian/changelog?rev=40092&op=diff
==============================================================================
--- trunk/libauthen-tacacsplus-perl/debian/changelog (original)
+++ trunk/libauthen-tacacsplus-perl/debian/changelog Fri Jul 17 19:23:43 2009
@@ -1,4 +1,11 @@
-libauthen-tacacsplus-perl (0.19-2) UNRELEASED; urgency=low
+libauthen-tacacsplus-perl (0.20-1) UNRELEASED; urgency=low
+
+  * New upstream release
+    + Implement a timeout for connect()
+  * Added myself to Uploaders and Copyright
+  * Standards-Version 3.8.2
+  * Upgraded to the new shorter debhelper format
+  * d/compat 7
 
   [ gregor herrmann ]
   * debian/control: Changed: Switched Vcs-Browser field to ViewSVN
@@ -7,7 +14,7 @@
   [ Nathan Handler ]
   * debian/watch: Update to ignore development releases.
 
- -- gregor herrmann <gregoa at debian.org>  Sun, 16 Nov 2008 20:39:54 +0100
+ -- Jonathan Yu <frequency at cpan.org>  Fri, 17 Jul 2009 11:09:42 -0400
 
 libauthen-tacacsplus-perl (0.19-1) unstable; urgency=low
 

Modified: trunk/libauthen-tacacsplus-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libauthen-tacacsplus-perl/debian/compat?rev=40092&op=diff
==============================================================================
--- trunk/libauthen-tacacsplus-perl/debian/compat (original)
+++ trunk/libauthen-tacacsplus-perl/debian/compat Fri Jul 17 19:23:43 2009
@@ -1,1 +1,1 @@
-6
+7

Modified: trunk/libauthen-tacacsplus-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libauthen-tacacsplus-perl/debian/control?rev=40092&op=diff
==============================================================================
--- trunk/libauthen-tacacsplus-perl/debian/control (original)
+++ trunk/libauthen-tacacsplus-perl/debian/control Fri Jul 17 19:23:43 2009
@@ -1,18 +1,20 @@
 Source: libauthen-tacacsplus-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 6), perl (>= 5.8)
+Build-Depends: perl (>= 5.8), debhelper (>= 7)
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: Michael Shuler <michael at pbandjelly.org>
-Standards-Version: 3.7.3
+Uploaders: Michael Shuler <michael at pbandjelly.org>,
+ Jonathan Yu <frequency at cpan.org>
+Standards-Version: 3.8.2
 Homepage: http://search.cpan.org/dist/Authen-TacacsPlus/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libauthen-tacacsplus-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libauthen-tacacsplus-perl/
 
 Package: libauthen-tacacsplus-perl
 Architecture: any
-Depends: ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends}, 
-Description:  Perl extension for authentication using tacacs+ server
- Authen::TacacsPlus allows you to authenticate using tacacs+ server.
- .
- Optional types of authentication are ASCII (default), PAP, and CHAP.
+Depends: ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends}
+Description: Perl module for authentication using TACACS+ server
+ Authen::TacacsPlus is a Perl module that provides authentication services
+ using the TACACS+ authentication protocol, optionally supporting various
+ authentication methods including plain text (ASCII), Password Authentication
+ Protocol (PAP) and Challenge-Handshake Authentication Protocol (CHAP).

Modified: trunk/libauthen-tacacsplus-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libauthen-tacacsplus-perl/debian/copyright?rev=40092&op=diff
==============================================================================
--- trunk/libauthen-tacacsplus-perl/debian/copyright (original)
+++ trunk/libauthen-tacacsplus-perl/debian/copyright Fri Jul 17 19:23:43 2009
@@ -1,65 +1,67 @@
-Upstream source location: http://search.cpan.org/dist/Authen-TacacsPlus/
+Format-Specification:
+    http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
+Upstream-Maintainer: Mike McCauley <mikem at open.com.au>
+Upstream-Source: http://search.cpan.org/dist/Authen-TacacsPlus/
+Upstream-Name: Authen-TacacsPlus
 
 Files: *
-Copyright: (C) 1998-99 Mike Shoyher <msh at corbina.net>, <msh at apache.lexa.ru>
+Copyright: 1998-99, Mike Shoyher <msh at corbina.net>
 License: GPL-1+ | Artistic
- This library is free software; you can redistribute it and/or
- modify it under the same terms as Perl itself.
 
 Files: debian/*
-Copyright: (C) 2008 Michael Shuler <michael at pbandjelly.org>
+Copyright: 2009, Jonathan Yu <frequency at cpan.org>
+ 2008 Michael Shuler <michael at pbandjelly.org>
 License: GPL-1+ | Artistic
 
-Perl license is as follows:
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of either:
-
-    a) the GNU General Public License as published by the Free Software
-       Foundation; either version 1, or (at your option) any later
-       version, or
-
-    b) the "Artistic License" which comes with Perl.
-
-On Debian GNU/Linux systems, the complete text of the GNU General Public
-License can be found in `/usr/share/common-licenses/GPL' and the Artistic
-Licence in `/usr/share/common-licenses/Artistic'.
-
 Files: tacpluslib/*
-Copyright: (c) 1995-1996 by Cisco systems, Inc.
+Copyright: 1995-1996, Cisco systems, Inc.
 License: other
  Permission to use, copy, modify, and distribute this software for
  any purpose and without fee is hereby granted, provided that this
- copyright and permission notice appear on all copies of the
- software and supporting documentation, the name of Cisco Systems,
- Inc. not be used in advertising or publicity pertaining to
- distribution of the program without specific prior permission, and
- notice be given in supporting documentation that modification,
- copying and distribution is by permission of Cisco Systems, Inc.
-
+ copyright and permission notice appear on all copies of the software
+ and supporting documentation, the name of Cisco Systems, Inc. not
+ be used in advertising or publicity pertaining to distribution of
+ the program without specific prior permission, and notice be given
+ in supporting documentation that modification, copying and
+ distribution is by permission of Cisco Systems, Inc.
+ .
  Cisco Systems, Inc. makes no representations about the suitability
  of this software for any purpose.  THIS SOFTWARE IS PROVIDED ``AS
  IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
  WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  FITNESS FOR A PARTICULAR PURPOSE.
 
-
 Files: tacpluslib/md5.*
-Copyright: (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved.
+Copyright: 1991-1992, RSA Data Security, Inc.
 License: other
  License to copy and use this software is granted provided that it
  is identified as the "RSA Data Security, Inc. MD5 Message-Digest
  Algorithm" in all material mentioning or referencing this software
  or this function.
-
+ .
  License is also granted to make and use derivative works provided
- that such works are identified as "derived from the RSA Data
- Security, Inc. MD5 Message-Digest Algorithm" in all material
- mentioning or referencing the derived work.
-
+ that such works are identified as "derived from the RSA Data Security,
+ Inc. MD5 Message-Digest Algorithm" in all material mentioning or
+ referencing the derived work.
+ .
  RSA Data Security, Inc. makes no representations concerning either
  the merchantability of this software or the suitability of this
  software for any particular purpose. It is provided "as is"
  without express or implied warranty of any kind.
-
+ .
  These notices must be retained in any copies of any part of this
  documentation and/or software.
+
+License: Artistic
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the Artistic License, which comes with Perl.
+    On Debian GNU/Linux systems, the complete text of the Artistic License
+    can be found in `/usr/share/common-licenses/Artistic'
+
+License: GPL-1+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 1, or (at your option)
+    any later version.
+    On Debian GNU/Linux systems, the complete text of the GNU General
+    Public License can be found in `/usr/share/common-licenses/GPL'

Modified: trunk/libauthen-tacacsplus-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libauthen-tacacsplus-perl/debian/rules?rev=40092&op=diff
==============================================================================
--- trunk/libauthen-tacacsplus-perl/debian/rules (original)
+++ trunk/libauthen-tacacsplus-perl/debian/rules Fri Jul 17 19:23:43 2009
@@ -1,90 +1,4 @@
 #!/usr/bin/make -f
-# This debian/rules file is provided as a template for normal perl
-# packages. It was created by Marc Brockschmidt <marc at dch-faq.de> for
-# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may
-# be used freely wherever it is useful.
 
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# If set to a true value then MakeMaker's prompt function will
-# always return the default without waiting for user input.
-export PERL_MM_USE_DEFAULT=1
-
-PACKAGE=$(shell dh_listpackages)
-
-ifndef PERL
-PERL = /usr/bin/perl
-endif
-
-TMP     =$(CURDIR)/debian/$(PACKAGE)
-
-# Allow disabling build optimation by setting noopt in
-# $DEB_BUILD_OPTIONS
-CFLAGS = -Wall -g
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-        CFLAGS += -O0
-else
-        CFLAGS += -O2
-endif
-
-build: build-stamp
-build-stamp:
-	dh_testdir
-
-	# Add commands to compile the package here
-	$(PERL) Makefile.PL INSTALLDIRS=vendor
-	$(MAKE) OPTIMIZE="$(CFLAGS)" LD_RUN_PATH=""
-
-	touch $@
-
-clean:
-	dh_testdir
-	dh_testroot
-	# Add commands to clean up after the build process here
-	[ ! -f Makefile ] || $(MAKE) realclean
-	dh_clean build-stamp install-stamp
-
-install: build install-stamp
-install-stamp:
-	dh_testdir
-	dh_testroot
-	dh_clean -k
-
-	# Add commands to install the package into debian/$PACKAGE_NAME here
-	$(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
-
-	# As this is a architecture dependent package, we are not
-	# supposed to install stuff to /usr/share. MakeMaker creates
-	# the dirs, we delete them from the deb:
-	[ ! -d $(TMP)/usr/share/perl5 ] || rmdir --ignore-fail-on-non-empty --parents --verbose $(TMP)/usr/share/perl5
-
-	touch $@
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
-	dh_testdir
-	dh_testroot
-	dh_installdocs README
-	dh_installchangelogs Changes
-	dh_link
-	dh_strip
-	dh_compress
-	dh_fixperms
-	dh_makeshlibs
-	dh_installdeb
-	dh_perl 
-	dh_shlibdeps
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-
-source diff:                                                                  
-	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary
+%:
+	dh $@

Modified: trunk/libauthen-tacacsplus-perl/tacpluslib/tac_client.c
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libauthen-tacacsplus-perl/tacpluslib/tac_client.c?rev=40092&op=diff
==============================================================================
--- trunk/libauthen-tacacsplus-perl/tacpluslib/tac_client.c (original)
+++ trunk/libauthen-tacacsplus-perl/tacpluslib/tac_client.c Fri Jul 17 19:23:43 2009
@@ -117,7 +117,7 @@
 	case TAC_PLUS_AUTHEN_STATUS_PASS:
 	    return 1;
 	case TAC_PLUS_AUTHEN_STATUS_FAIL: 
-	    tac_err="Authentification failed";
+	    tac_err="Authentication failed";
 	    return 0;                 
 	default :
 	    tac_err="Protocol error";
@@ -160,6 +160,14 @@
 
 int init_tac_session(char* host_name, char* port_name, char* key, int timeout)
 {
+
+int flags;
+int res;
+int optval;
+socklen_t len;
+fd_set wset;
+struct timeval tv;
+
 gethostname(ourhost,127);
 ourhost_len=strlen(ourhost);
 ourtty_len=strlen(ourtty);
@@ -194,8 +202,64 @@
     }
 }
 if((tac_fd = socket (AF_INET, SOCK_STREAM, 0))<0) return -1;
-if (connect (tac_fd, (struct sockaddr *) &tac_port, sizeof tac_port) < 0)
-    return -1;
+
+// get flags
+flags = fcntl(tac_fd, F_GETFL, 0);
+if( flags < 0 ) {
+	//fprintf( stderr, "fcntl: %s\n", strerror(errno) );
+	tac_err = "socket error";
+	return -1;
+}
+
+// set socket to nonblock
+res = fcntl( tac_fd, F_SETFL, flags | O_NONBLOCK );
+if( res < 0 ) {
+	//fprintf( stderr, "fcntl: %s\n", strerror(errno) );
+	tac_err = "socket error";
+	return -1;
+}
+
+// connect
+res = connect (tac_fd, (struct sockaddr *) &tac_port, sizeof tac_port);
+
+// connection not established, but in progress
+if( res < 0 && (errno != EINPROGRESS) ) {
+	tac_err = "connection failed";
+	return -1;
+}
+
+// wait for connection or timeout
+if( res != 0 ) {
+	FD_ZERO(&wset);
+	FD_SET(tac_fd, &wset);
+	tv.tv_sec  = timeout;
+	tv.tv_usec = 0;
+
+	res = select( tac_fd+1, NULL, &wset, NULL, &tv );
+	if( res < 0 ) {
+		tac_err = "select failed";
+		return -1;
+	}
+	else if( res == 0 ) {
+		tac_err = "timeout";
+		return -1;
+	}
+	if( res > 0 ) {
+		// socket is ready for writing. Check if connection was
+		// established successfully
+		len = sizeof(optval);
+		if( getsockopt( tac_fd, SOL_SOCKET, SO_ERROR, (void *)&optval, &len ) > 0 ) {
+			tac_err = "getsockopt failed";
+			return -1;
+		}
+		if( optval != 0 ) {
+			tac_err = "connection failed";
+			return -1;
+		}
+		// optval == 0 --> no error, connection established
+	}
+}
+	
 return tac_fd;
 }
 




More information about the Pkg-perl-cvs-commits mailing list