pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

accountsservice: Revamp patch for WTMPX



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Mon Dec 14 00:23:14 2015 +0100
Changeset:	68434600eabb842137ab1c3c1d06433028c25ba2

Modified Files:
	accountsservice/distinfo
	accountsservice/patches/patch-src_wtmp-helper.c
Added Files:
	accountsservice/patches/patch-configure.ac

Log Message:
accountsservice: Revamp patch for WTMPX

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=68434600eabb842137ab1c3c1d06433028c25ba2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 accountsservice/distinfo                        |  3 +-
 accountsservice/patches/patch-configure.ac      | 40 ++++++++++++++
 accountsservice/patches/patch-src_wtmp-helper.c | 71 +++++++++++++++++++------
 3 files changed, 98 insertions(+), 16 deletions(-)

diffs:
diff --git a/accountsservice/distinfo b/accountsservice/distinfo
index f9be7e1..16ad310 100644
--- a/accountsservice/distinfo
+++ b/accountsservice/distinfo
@@ -3,5 +3,6 @@ $NetBSD: distinfo,v 1.1 2015/06/06 13:52:41 krytarowski Exp $
 SHA1 (accountsservice-0.6.40.tar.xz) = 2afbcddf6e1d1a97b4cc5c4c7897201f06378ec3
 RMD160 (accountsservice-0.6.40.tar.xz) = 83c148f750058039728397b5c8d058058557d519
 Size (accountsservice-0.6.40.tar.xz) = 367772 bytes
+SHA1 (patch-configure.ac) = 106b5e515632fb7de8d53718ce1fc46887dce66b
 SHA1 (patch-data_Makefile.am) = b059cd214a346adb371e4a006f497d652c9d9234
-SHA1 (patch-src_wtmp-helper.c) = b6c626633c2cfc49c9f1953209d762770c9ff0f7
+SHA1 (patch-src_wtmp-helper.c) = f3a4a1c77cfef244391efb91fe952e45986f6235
diff --git a/accountsservice/patches/patch-configure.ac b/accountsservice/patches/patch-configure.ac
new file mode 100644
index 0000000..86327fe
--- /dev/null
+++ b/accountsservice/patches/patch-configure.ac
@@ -0,0 +1,40 @@
+$NetBSD$
+
+--- configure.ac.orig	2015-01-22 21:25:12.000000000 +0000
++++ configure.ac
+@@ -289,6 +289,29 @@ if test "x$with_systemdsystemunitdir" !=
+ fi
+ AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != "xno" ])
+ 
++dnl ---------------------------------------------------------------------------
++dnl - check OS
++dnl ---------------------------------------------------------------------------
++AC_MSG_CHECKING([checking OS type])
++case "$host_os" in
++  *freebsd*)
++        AC_MSG_RESULT([FreeBSD])
++        AC_DEFINE([HAVE_FREEBSD], 1, [Is this a FreeBSD system?])
++        ;;
++  *linux*)
++        AC_MSG_RESULT([Linux])
++        AC_DEFINE([HAVE_LINUX], 1, [Is this a Linux system?])
++        ;;
++  *netbsd*)
++        AC_MSG_RESULT([NetBSD])
++        AC_DEFINE([HAVE_NETBSD], 1, [Is this a NetBSD system?])
++        ;;
++  *solaris*)
++        AC_MSG_RESULT([Solaris])
++        AC_DEFINE([HAVE_SOLARIS], 1, [Is this a Solaris system?])
++        ;;
++esac
++
+ AC_CONFIG_HEADERS([config.h])
+ AC_CONFIG_FILES([
+ Makefile
+@@ -313,5 +336,3 @@ else
+ fi
+         AC_MSG_NOTICE([** Administrator group: $enable_admin_group])
+ echo
+-
+-
diff --git a/accountsservice/patches/patch-src_wtmp-helper.c b/accountsservice/patches/patch-src_wtmp-helper.c
index 1be31f0..eebfa13 100644
--- a/accountsservice/patches/patch-src_wtmp-helper.c
+++ b/accountsservice/patches/patch-src_wtmp-helper.c
@@ -1,28 +1,69 @@
-$NetBSD: patch-src_wtmp-helper.c,v 1.1 2015/06/06 13:52:41 krytarowski Exp $
-
-Use portable symbol _PATH_WTMPX in the place of WTMPX_FILENAME.
+$NetBSD$
 
 --- src/wtmp-helper.c.orig	2014-11-04 03:46:00.000000000 +0000
 +++ src/wtmp-helper.c
-@@ -60,8 +60,8 @@ wtmp_helper_start (void)
-                 if (setutxdb (UTXDB_LOG, NULL) != 0) {
-                         return FALSE;
-                 }
+@@ -56,21 +56,32 @@ user_previous_login_free (UserPreviousLo
+ static gboolean
+ wtmp_helper_start (void)
+ {
+-#if defined(UTXDB_LOG)
+-                if (setutxdb (UTXDB_LOG, NULL) != 0) {
+-                        return FALSE;
+-                }
 -#elif defined(WTMPX_FILENAME)
 -                if (utmpxname (WTMPX_FILENAME) != 0) {
-+#elif defined(_PATH_WTMPX)
-+                if (utmpxname (_PATH_WTMPX) != 0) {
-                         return FALSE;
-                 }
+-                        return FALSE;
+-                }
++#if HAVE_FREEBSD
++        if (setutxdb (UTXDB_LOG, NULL) != 0) {
++                return FALSE;
++        }
++#elif HAVE_LINUX
++        if (utmpxname (WTMPX_FILENAME) != 0) {
++                return FALSE;
++        }
++
++        setutxent ();
++#elif HAVE_NETBSD
++        if (utmpxname (_PATH_WTMPX) != 0) {
++                return FALSE;
++        }
+ 
+-                setutxent ();
++        setutxent ();
++#elif HAVE_SOLARIS
++        if (utmpxname (WTMPX_FILE) != 0) {
++                return FALSE;
++        }
++
++        setutxent ();
+ #else
+ #error You have utmpx.h, but no known way to use it for wtmp entries
+ #endif
+-
+-                return TRUE;
++        return TRUE;
+ }
  
-@@ -212,8 +212,8 @@ wtmp_helper_entry_generator (GHashTable 
+ struct passwd *
+@@ -212,12 +223,16 @@ wtmp_helper_entry_generator (GHashTable 
  const gchar *
  wtmp_helper_get_path_for_monitor (void)
  {
 -#if defined(WTMPX_FILENAME)
 -        return WTMPX_FILENAME;
-+#if defined(_PATH_WTMPX)
-+        return _PATH_WTMPX;
- #elif defined(__FreeBSD__)
+-#elif defined(__FreeBSD__)
++#if HAVE_FREEBSD
          return "/var/log/utx.log";
++#elif HAVE_LINUX
++        return WTMPX_FILENAME;
++#elif HAVE_NETBSD
++        return _PATH_WTMPX;
++#elif HAVE_SOLARIS
++        return WTMPX_FILE;
  #else
+-#error Do not know which filename to watch for wtmp changes
++#error You have utmpx.h, but no known way to use it for wtmp entries
+ #endif
+ }
+ 


Home | Main Index | Thread Index | Old Index