The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
MANIFEST 01
META.json 031
META.yml 1119
Makefile.PL 218
README 11
Utmp.xs 259
examples/pwho 00
lib/Sys/Utmp/Utent.pm 33
lib/Sys/Utmp.pm 287
t/01pod.t 00
t/02podcoverage.t 00
t/03utmp.t 00
t/04constants.t 00
t/05fields.t 00
t/06taint.t 00
t/07utent_methods.t 00
t/08utent_types.t 00
17 files changed (This is a version diff) 7089
@@ -16,3 +16,4 @@ t/05fields.t
 t/06taint.t
 t/07utent_methods.t
 t/08utent_types.t
+META.json                                Module JSON meta-data (added by MakeMaker)
@@ -0,0 +1,31 @@
+{
+   "abstract" : "Object(ish) Interface to UTMP files.",
+   "author" : [
+      "Jonathan Stowe <jns@gellyfish.co.uk>"
+   ],
+   "dynamic_config" : 1,
+   "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120921",
+   "license" : [
+      "perl_5"
+   ],
+   "meta-spec" : {
+      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+      "version" : "2"
+   },
+   "name" : "Sys-Utmp",
+   "no_index" : {
+      "directory" : [
+         "t",
+         "inc"
+      ]
+   },
+   "release_status" : "stable",
+   "resources" : {
+      "repository" : {
+         "type" : "git",
+         "url" : "https://github.com/jonathanstowe/Sys-Utmp.git",
+         "web" : "https://github.com/jonathanstowe/Sys-Utmp"
+      }
+   },
+   "version" : "1.7"
+}
@@ -1,11 +1,19 @@
-# http://module-build.sourceforge.net/META-spec.html
-#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
-name:         Sys-Utmp
-version:      1.6
-version_from: lib/Sys/Utmp.pm
-installdirs:  site
-requires:
-    Test::More:                    0
-
-distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.17
+---
+abstract: 'Object(ish) Interface to UTMP files.'
+author:
+  - 'Jonathan Stowe <jns@gellyfish.co.uk>'
+build_requires: {}
+dynamic_config: 1
+generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120921'
+license: perl
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
+name: Sys-Utmp
+no_index:
+  directory:
+    - t
+    - inc
+resources:
+  repository: https://github.com/jonathanstowe/Sys-Utmp.git
+version: 1.7
@@ -5,7 +5,12 @@ my (
     $libs
    );
 
-if ( $^O =~ /bsd/i )
+# This may require some refinement
+if ( $^O =~ /netbsd/i )
+{
+    $defined = "";
+}
+elsif ( $^O =~ /bsd/i )
 {
    $define = '-DNOUTFUNCS';
 }
@@ -27,9 +32,20 @@ WriteMakefile(
     'NAME'		=> 'Sys::Utmp',
     'VERSION_FROM'	=> 'lib/Sys/Utmp.pm',
     'PREREQ_PM'		=> {Test::More => 0 },
+    LICENSE      => 'perl',
+    META_MERGE => {
+        'meta-spec' => { version => 2 },
+        resources => {
+            repository => {
+                type => 'git',
+                url  => 'https://github.com/jonathanstowe/Sys-Utmp.git',
+                web  => 'https://github.com/jonathanstowe/Sys-Utmp',
+            },
+        },
+    },
     ($] >= 5.005 ?    
       (ABSTRACT_FROM => 'lib/Sys/Utmp.pm',
-       AUTHOR     => 'Jonathan Stowe <jns@gellyfish>') : ()),
+       AUTHOR     => 'Jonathan Stowe <jns@gellyfish.co.uk>') : ()),
     'LIBS'		=> ['-lc'],
     'DEFINE'		=> $define,
     'INC'		=> '' 
@@ -32,7 +32,7 @@ At version 1.6 Test::More is also required for the tests.
 COPYRIGHT AND LICENCE
 
 Copyright Netscalibur UK 2001.
-Copyright Jonathan Stowe 2001 - 2006
+Copyright Jonathan Stowe 2001 - 2013
 
 This software carries no warranty either express or implied.
 
@@ -4,8 +4,11 @@
 
 #include <utmp.h>
 
-#ifdef NOUTFUNCS
+#ifdef _AIX
+#define _HAVE_UT_HOST	1
+#endif
 
+#ifdef NOUTFUNCS
 #include <stdlib.h>
 #include <unistd.h>
 #include <time.h>
@@ -15,10 +18,12 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
+
 #ifdef BSD
 #define _NO_UT_ID
 #define _NO_UT_TYPE
 #define _NO_UT_PID
+#define _HAVE_UT_HOST
 #define ut_user ut_name
 #endif
 
@@ -42,23 +47,12 @@
 #define ACCOUNTING      9
 #endif
 
-
 /*
     It is almost certain that if these are not defined the fields they are
     for are not present or this is BSD :)
 */
 
 
-#ifndef UT_LINESIZE
-# define UT_LINESIZE 32
-#endif
-#ifndef UT_NAMESIZE
-# define UT_NAMESIZE 32
-#endif 
-#ifndef UT_HOSTSIZE
-# define UT_HOSTSIZE
-#endif
-
 static int ut_fd = -1;
 
 static char _ut_name[] = _PATH_UTMP;
@@ -207,9 +201,8 @@ SV *self
      static SV *ut_ref;
      static char *_ut_id;
      static struct utmp *utent;
-     static char ut_host[UT_HOSTSIZE];
+     static char ut_host[sizeof(utent->ut_host)];
 
-     HV *self_hash;
 
      SV *sv_ut_user;
      SV *sv_ut_id;
@@ -222,7 +215,6 @@ SV *self
      if(!SvROK(self)) 
         croak("Must be called as an object method");
 
-     self_hash = (HV *)SvRV(self);
 
      utent = getutent();
 
@@ -249,9 +241,9 @@ SV *self
        ut_tv = (IV)utent->ut_time;
 #endif
 #ifdef _HAVE_UT_HOST
-       strncpy(ut_host, utent->ut_host,UT_HOSTSIZE);
+       strncpy(ut_host, utent->ut_host,sizeof(utent->ut_host));
 #else
-       strcpy(ut_host, "",1);
+       strncpy(ut_host, "",1);
 #endif
 
 
@@ -318,23 +310,19 @@ void
 setutent(self)
 SV *self
    PPCODE:
-    HV *self_hash;
 
     if(!SvROK(self)) 
         croak("Must be called as an object method");
 
-    self_hash = (HV *)SvRV(self);
     setutent();
 
 void
 endutent(self)
 SV *self
    PPCODE:
-    HV *self_hash;
 
     if(!SvROK(self)) 
         croak("Must be called as an object method");
-    self_hash = (HV *)SvRV(self);
     endutent();
 
 void
@@ -343,11 +331,9 @@ SV *self
 SV *filename
    PPCODE:
      char *ff;
-     HV *self_hash;
 
     if(!SvROK(self)) 
         croak("Must be called as an object method");
-     self_hash = (HV *)SvRV(self);
 
      ff = SvPV(filename,PL_na);
      utmpname(ff);
@@ -356,10 +342,8 @@ void
 DESTROY(self)
 SV *self
    PPCODE:
-     HV *self_hash;
 
     if(!SvROK(self)) 
         croak("Must be called as an object method");
 
-     self_hash = (HV *)SvRV(self);
      endutent();
diff --git a/var/tmp/source/JSTOWE/Sys-Utmp-1.6/Sys-Utmp-1.6/examples/pwho b/var/tmp/source/JSTOWE/Sys-Utmp-1.7/Sys-Utmp-1.7/examples/pwho
old mode 100755
new mode 100644
@@ -206,11 +206,11 @@ then please contact the author including if appropriate your /usr/include/utmp.h
 
 =head1 AUTHOR
 
-Jonathan Stowe, E<lt>jns@gellyfish.comE<gt>
+Jonathan Stowe, E<lt>jns@gellyfish.co.ukE<gt>
 
 =head1 LICENCE
 
-This Software is Copyright Jonathan Stowe 2001-2006
+This Software is Copyright Jonathan Stowe 2001-2013
 
 This Software is published as-is with no warranty express or implied.
 
@@ -219,6 +219,6 @@ Perl itself.
 
 =head1 SEE ALSO
 
-L<perl>. L<Sys::Utmp::Utent>
+L<perl>. L<Sys::Utmp>
 
 =cut
@@ -13,31 +13,6 @@
 #*                                                                           *
 #*                                                                           *
 #*****************************************************************************
-#*                                                                           *
-#*      $Log: Utmp.pm,v $
-#*      Revision 1.5  2004/03/02 20:28:08  jonathan
-#*      Put back in CVS
-#*
-#*      Revision 1.5  2001/09/14 07:28:51  gellyfish
-#*      * Fixed coredump in PL_sv_free
-#*      * Tainted ut_host
-#*      * fixed backward compatibillity problem
-#*
-#*      Revision 1.4  2001/09/10 07:16:10  gellyfish
-#*      Fixed memory leakage in getutent()
-#*
-#*      Revision 1.3  2001/03/27 06:55:36  gellyfish
-#*      Added utmpname()
-#*
-#*      Revision 1.2  2001/02/12 15:05:31  gellyfish
-#*      Added BSD support
-#*
-#*      Revision 1.1  2001/02/09 22:27:30  gellyfish
-#*      Initial revision
-#*
-#*                                                                           *
-#*                                                                           *
-#*****************************************************************************
 
 package Sys::Utmp;
 
@@ -158,7 +133,7 @@ BEGIN
    @EXPORT_OK = ( @{ $EXPORT_TAGS{'constants'} }, @{ $EXPORT_TAGS{'fields'}} );
 }
 
-$VERSION = '1.6';
+$VERSION = '1.7';
 
 sub new 
 {
@@ -249,14 +224,18 @@ Openserver and SCO UnixWare and found to work on those platforms.
 If you have difficulty building the module or it doesnt behave as expected
 then please contact the author including if appropriate your /usr/include/utmp.h
 
+Patches to make this work better on any platform are always welcome. The source
+is managed at https://github.com/jonathanstowe/Sys-Utmp so feel free to fork and
+send a pull request.
+
 =head1 AUTHOR
 
-Jonathan Stowe, E<lt>jns@gellyfish.comE<gt>
+Jonathan Stowe, E<lt>jns@gellyfish.co.ukE<gt>
 
 =head1 LICENCE
 
 This Software is Copyright Netscalibur UK 2001,  
-                           Jonathan Stowe 2001-2006
+                           Jonathan Stowe 2001-2013
 
 This Software is published as-is with no warranty express or implied.
 
diff --git a/var/tmp/source/JSTOWE/Sys-Utmp-1.6/Sys-Utmp-1.6/t/01pod.t b/var/tmp/source/JSTOWE/Sys-Utmp-1.7/Sys-Utmp-1.7/t/01pod.t
old mode 100755
new mode 100644
diff --git a/var/tmp/source/JSTOWE/Sys-Utmp-1.6/Sys-Utmp-1.6/t/02podcoverage.t b/var/tmp/source/JSTOWE/Sys-Utmp-1.7/Sys-Utmp-1.7/t/02podcoverage.t
old mode 100755
new mode 100644
diff --git a/var/tmp/source/JSTOWE/Sys-Utmp-1.6/Sys-Utmp-1.6/t/03utmp.t b/var/tmp/source/JSTOWE/Sys-Utmp-1.7/Sys-Utmp-1.7/t/03utmp.t
old mode 100755
new mode 100644
diff --git a/var/tmp/source/JSTOWE/Sys-Utmp-1.6/Sys-Utmp-1.6/t/04constants.t b/var/tmp/source/JSTOWE/Sys-Utmp-1.7/Sys-Utmp-1.7/t/04constants.t
old mode 100755
new mode 100644
diff --git a/var/tmp/source/JSTOWE/Sys-Utmp-1.6/Sys-Utmp-1.6/t/05fields.t b/var/tmp/source/JSTOWE/Sys-Utmp-1.7/Sys-Utmp-1.7/t/05fields.t
old mode 100755
new mode 100644
diff --git a/var/tmp/source/JSTOWE/Sys-Utmp-1.6/Sys-Utmp-1.6/t/06taint.t b/var/tmp/source/JSTOWE/Sys-Utmp-1.7/Sys-Utmp-1.7/t/06taint.t
old mode 100755
new mode 100644
diff --git a/var/tmp/source/JSTOWE/Sys-Utmp-1.6/Sys-Utmp-1.6/t/07utent_methods.t b/var/tmp/source/JSTOWE/Sys-Utmp-1.7/Sys-Utmp-1.7/t/07utent_methods.t
old mode 100755
new mode 100644
diff --git a/var/tmp/source/JSTOWE/Sys-Utmp-1.6/Sys-Utmp-1.6/t/08utent_types.t b/var/tmp/source/JSTOWE/Sys-Utmp-1.7/Sys-Utmp-1.7/t/08utent_types.t
old mode 100755
new mode 100644