diff options
author | kwm <kwm@df743ca5-7f9a-e211-a948-0013205c9059> | 2011-10-17 02:52:39 +0800 |
---|---|---|
committer | kwm <kwm@df743ca5-7f9a-e211-a948-0013205c9059> | 2011-10-17 02:52:39 +0800 |
commit | a28d452defa9af6d68eaad56c49a34413f61862b (patch) | |
tree | 0a90d4d218c15f9ff1cf8581ea346167204da0b4 /sysutils | |
parent | a2715b11795bc1857751926ff147785c0e2071e7 (diff) | |
download | marcuscom-ports-a28d452defa9af6d68eaad56c49a34413f61862b.tar marcuscom-ports-a28d452defa9af6d68eaad56c49a34413f61862b.tar.gz marcuscom-ports-a28d452defa9af6d68eaad56c49a34413f61862b.tar.bz2 marcuscom-ports-a28d452defa9af6d68eaad56c49a34413f61862b.tar.lz marcuscom-ports-a28d452defa9af6d68eaad56c49a34413f61862b.tar.xz marcuscom-ports-a28d452defa9af6d68eaad56c49a34413f61862b.tar.zst marcuscom-ports-a28d452defa9af6d68eaad56c49a34413f61862b.zip |
Update patches, in particular the utmpx one. Since the code only supports
utmpx disable it on older FreeBSD versions then 9.0.
Submitted by: Ed Schouten
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@16429 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/accountsservice/Makefile | 1 | ||||
-rw-r--r-- | sysutils/accountsservice/files/patch-config.h.in | 32 | ||||
-rw-r--r-- | sysutils/accountsservice/files/patch-configure | 34 | ||||
-rw-r--r-- | sysutils/accountsservice/files/patch-src_daemon.c | 106 | ||||
-rw-r--r-- | sysutils/accountsservice/files/patch-src_user.c | 60 | ||||
-rw-r--r-- | sysutils/accountsservice/files/patch-src_util.c | 9 |
6 files changed, 132 insertions, 110 deletions
diff --git a/sysutils/accountsservice/Makefile b/sysutils/accountsservice/Makefile index 7f5df9d4f..7b56f8f58 100644 --- a/sysutils/accountsservice/Makefile +++ b/sysutils/accountsservice/Makefile @@ -7,6 +7,7 @@ PORTNAME= accountsservice PORTVERSION= 0.6.14 +PORTREVISION= 1 CATEGORIES= sysutils devel MASTER_SITES= http://www.freedesktop.org/software/${PORTNAME}/ diff --git a/sysutils/accountsservice/files/patch-config.h.in b/sysutils/accountsservice/files/patch-config.h.in new file mode 100644 index 000000000..46497bd24 --- /dev/null +++ b/sysutils/accountsservice/files/patch-config.h.in @@ -0,0 +1,32 @@ +--- config.h.in.orig 2011-09-04 22:12:01.000000000 +0200 ++++ config.h.in 2011-10-16 20:44:20.000000000 +0200 +@@ -15,6 +15,9 @@ + /* Define to 1 if you have the <dlfcn.h> header file. */ + #undef HAVE_DLFCN_H + ++/* Define to 1 if you have the `fgetpwent' function. */ ++#undef HAVE_FGETPWENT ++ + /* Define if the GNU gettext() function is already present or preinstalled. */ + #undef HAVE_GETTEXT + +@@ -30,6 +33,9 @@ + /* Define to 1 if you have the <memory.h> header file. */ + #undef HAVE_MEMORY_H + ++/* Define to 1 if you have the <shadow.h> header file. */ ++#undef HAVE_SHADOW_H ++ + /* Define to 1 if you have the <stdint.h> header file. */ + #undef HAVE_STDINT_H + +@@ -51,6 +57,9 @@ + /* Define to 1 if you have the <unistd.h> header file. */ + #undef HAVE_UNISTD_H + ++/* Define to 1 if you have the <utmpx.h> header file. */ ++#undef HAVE_UTMPX_H ++ + /* Define to the sub-directory in which libtool stores uninstalled libraries. + */ + #undef LT_OBJDIR diff --git a/sysutils/accountsservice/files/patch-configure b/sysutils/accountsservice/files/patch-configure new file mode 100644 index 000000000..8459dd1e6 --- /dev/null +++ b/sysutils/accountsservice/files/patch-configure @@ -0,0 +1,34 @@ +--- configure.orig 2011-10-16 20:43:57.000000000 +0200 ++++ configure 2011-10-16 20:44:20.000000000 +0200 +@@ -13448,6 +13448,31 @@ + WARN_CFLAGS="$accountsservice_cv_warn_cflags" + + ++for ac_header in shadow.h utmpx.h ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" ++if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++ ++done ++ ++for ac_func in fgetpwent ++do : ++ ac_fn_c_check_func "$LINENO" "fgetpwent" "ac_cv_func_fgetpwent" ++if test "x$ac_cv_func_fgetpwent" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_FGETPWENT 1 ++_ACEOF ++ ++fi ++done ++ ++ + + # Check whether --enable-docbook-docs was given. + if test "${enable_docbook_docs+set}" = set; then : diff --git a/sysutils/accountsservice/files/patch-src_daemon.c b/sysutils/accountsservice/files/patch-src_daemon.c index 34efc617a..c8f73dfce 100644 --- a/sysutils/accountsservice/files/patch-src_daemon.c +++ b/sysutils/accountsservice/files/patch-src_daemon.c @@ -1,6 +1,16 @@ ---- src/daemon.c.orig 2011-08-16 14:53:31.000000000 +0200 -+++ src/daemon.c 2011-10-05 00:17:22.000000000 +0200 -@@ -52,6 +52,9 @@ +--- src/daemon.c.orig 2011-10-16 20:25:13.000000000 +0200 ++++ src/daemon.c 2011-10-16 20:28:05.000000000 +0200 +@@ -32,7 +32,9 @@ + #include <errno.h> + #include <unistd.h> + #include <sys/types.h> ++#ifdef HAVE_UTMPX_H + #include <utmpx.h> ++#endif + + #include <glib.h> + #include <glib/gi18n.h> +@@ -52,6 +54,9 @@ #define PATH_LOGIN_DEFS "/etc/login.defs" #define PATH_GDM_CUSTOM "/etc/gdm/custom.conf" @@ -10,21 +20,40 @@ #ifndef FALLBACK_MINIMAL_UID #define FALLBACK_MINIMAL_UID 500 #endif -@@ -243,7 +246,9 @@ reload_wtmp_history (Daemon *daemon) +@@ -238,13 +243,19 @@ daemon_local_user_is_excluded (Daemon *d + static void + reload_wtmp_history (Daemon *daemon) + { ++#ifdef HAVE_UTMPX_H + struct utmpx *wtmp_entry; + GHashTable *login_frequency_hash; GHashTableIter iter; gpointer key, value; -+#ifdef __linux__ - utmpxname(_PATH_WTMPX); -+#endif +- utmpxname(_PATH_WTMPX); ++#ifdef UTXDB_LOG ++ if (setutxdb (UTXDB_LOG, NULL) != 0) ++ return; ++#else ++ utmpxname (_PATH_WTMPX); setutxent (); ++#endif login_frequency_hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL); -@@ -326,22 +331,32 @@ reload_passwd (Daemon *daemon) + +@@ -298,6 +309,7 @@ reload_wtmp_history (Daemon *daemon) + + g_hash_table_foreach (login_frequency_hash, (GHFunc) g_free, NULL); + g_hash_table_unref (login_frequency_hash); ++#endif /* HAVE_UTMPX_H */ + } + + static void +@@ -326,22 +338,32 @@ reload_passwd (Daemon *daemon) GSList *old_users; GSList *new_users; GSList *list; -+#ifndef __FreeBSD__ ++#ifdef HAVE_FGETPWENT FILE *fp; +#endif User *user = NULL; @@ -32,73 +61,38 @@ old_users = NULL; new_users = NULL; -+#ifdef __FreeBSD__ -+ setpwent(); -+#else ++#ifdef HAVE_FGETPWENT errno = 0; fp = fopen (PATH_PASSWD, "r"); if (fp == NULL) { g_warning ("Unable to open %s: %s", PATH_PASSWD, g_strerror (errno)); goto out; } ++#else ++ setpwent(); +#endif g_hash_table_foreach (daemon->priv->users, listify_hash_values_hfunc, &old_users); g_slist_foreach (old_users, (GFunc) g_object_ref, NULL); -+#ifdef __FreeBSD__ -+ for (pwent = getpwent (); pwent != NULL; pwent = getpwent ()) { +- for (pwent = fgetpwent (fp); pwent != NULL; pwent = fgetpwent (fp)) { ++#ifdef HAVE_FGETPWENT ++ while ((pwent = fgetpwent (fp)) != NULL) { +#else - for (pwent = fgetpwent (fp); pwent != NULL; pwent = fgetpwent (fp)) { ++ while ((pwent = getpwent ()) != NULL) { +#endif /* Skip users below MINIMAL_UID... */ if (daemon_local_user_is_excluded (daemon, pwent->pw_name, pwent->pw_uid)) { g_debug ("skipping user: %s", pwent->pw_name); -@@ -391,10 +406,13 @@ reload_passwd (Daemon *daemon) +@@ -391,10 +413,12 @@ reload_passwd (Daemon *daemon) } } -- out: ++#ifdef HAVE_FGETPWENT + out: /* Cleanup */ -- -- fclose (fp); -+#ifdef __FreeBSD__ -+ endpwent (); -+#else -+ out: -+ fclose (fp); + + fclose (fp); +#endif g_slist_foreach (new_users, (GFunc) g_object_thaw_notify, NULL); g_slist_foreach (new_users, (GFunc) g_object_unref, NULL); -@@ -427,8 +445,8 @@ reload_data (Daemon *daemon) - static void - reload_users (Daemon *daemon) - { -- reload_wtmp_history (daemon); - reload_passwd (daemon); -+ reload_wtmp_history (daemon); - reload_data (daemon); - } - -@@ -554,6 +572,13 @@ on_gdm_monitor_changed (GFileMonitor - queue_reload_autologin (daemon); - } - -+#ifdef __FreeBSD__ -+static uid_t -+get_minimal_uid (void) -+{ -+ return FALLBACK_MINIMAL_UID; -+} -+#else - static uid_t - get_minimal_uid (void) - { -@@ -606,6 +631,7 @@ out: - g_free (contents); - return uid; - } -+#endif - - static void - daemon_init (Daemon *daemon) diff --git a/sysutils/accountsservice/files/patch-src_user.c b/sysutils/accountsservice/files/patch-src_user.c index 7e5a04659..eb5f15524 100644 --- a/sysutils/accountsservice/files/patch-src_user.c +++ b/sysutils/accountsservice/files/patch-src_user.c @@ -1,38 +1,30 @@ ---- src/user.c.orig 2011-08-16 14:53:31.000000000 +0200 -+++ src/user.c 2011-10-05 00:20:33.000000000 +0200 -@@ -29,7 +29,11 @@ +--- src/user.c.orig 2011-10-16 20:25:22.000000000 +0200 ++++ src/user.c 2011-10-16 20:24:29.000000000 +0200 +@@ -29,7 +29,9 @@ #include <sys/wait.h> #include <unistd.h> #include <grp.h> -+#ifdef __FreeBSD__ -+#include <pwd.h> -+#else ++#ifdef HAVE_SHADOW_H #include <shadow.h> +#endif #include <glib.h> #include <glib/gi18n.h> -@@ -464,7 +468,11 @@ void +@@ -464,7 +466,9 @@ void user_local_update_from_pwent (User *user, struct passwd *pwent) { -+#ifdef __FreeBSD__ -+ struct passwd *spent; -+#else ++#ifdef HAVE_SHADOW_H struct spwd *spent; +#endif gchar *real_name; gboolean changed; const gchar *passwd; -@@ -555,9 +563,15 @@ user_local_update_from_pwent (User +@@ -555,9 +559,11 @@ user_local_update_from_pwent (User } passwd = pwent->pw_passwd; -+#ifdef __FreeBSD__ -+ spent = getpwnam (pwent->pw_name); -+ if (spent) -+ passwd = spent->pw_passwd; -+#else ++#ifdef HAVE_SHADOW_H spent = getspnam (pwent->pw_name); if (spent) passwd = spent->sp_pwdp; @@ -40,11 +32,11 @@ if (passwd && passwd[0] == '!') { locked = TRUE; -@@ -579,11 +593,13 @@ user_local_update_from_pwent (User +@@ -579,11 +585,13 @@ user_local_update_from_pwent (User mode = PASSWORD_MODE_REGULAR; } -+#ifndef __FreeBSD__ ++#ifdef HAVE_SHADOW_H if (spent) { if (spent->sp_lstchg == 0) { mode = PASSWORD_MODE_SET_AT_LOGIN; @@ -54,35 +46,3 @@ if (user->password_mode != mode) { user->password_mode = mode; -@@ -1370,6 +1386,7 @@ user_change_icon_file_authorized_cb (Dae - GFile *file; - GFileInfo *info; - guint32 mode; -+ GFileType type; - guint64 size; - - filename = g_strdup (data); -@@ -1400,14 +1417,23 @@ user_change_icon_file_authorized_cb (Dae - - file = g_file_new_for_path (filename); - info = g_file_query_info (file, G_FILE_ATTRIBUTE_UNIX_MODE "," -+ G_FILE_ATTRIBUTE_STANDARD_TYPE "," - G_FILE_ATTRIBUTE_STANDARD_SIZE, - 0, NULL, NULL); - mode = g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_UNIX_MODE); -+ type = g_file_info_get_file_type (info); - size = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_STANDARD_SIZE); - - g_object_unref (info); - g_object_unref (file); - -+ if (type != G_FILE_TYPE_REGULAR) { -+ g_debug ("not a regular file\n"); -+ throw_error (context, ERROR_FAILED, "file '%s' is not a regular file", filename); -+ g_free (filename); -+ return; -+ } -+ - if (size > 1048576) { - g_debug ("file too large\n"); - /* 1MB ought to be enough for everybody */ diff --git a/sysutils/accountsservice/files/patch-src_util.c b/sysutils/accountsservice/files/patch-src_util.c index 1281ab4e5..ab3b1310e 100644 --- a/sysutils/accountsservice/files/patch-src_util.c +++ b/sysutils/accountsservice/files/patch-src_util.c @@ -1,11 +1,12 @@ ---- src/util.c.orig 2011-03-27 20:32:32.000000000 +0200 -+++ src/util.c 2011-03-27 20:32:54.000000000 +0200 -@@ -25,7 +25,7 @@ +--- src/util.c.orig 2011-10-16 20:25:37.000000000 +0200 ++++ src/util.c 2011-10-16 20:24:33.000000000 +0200 +@@ -24,8 +24,8 @@ + #include <string.h> #include <sys/types.h> #include <sys/stat.h> ++#include <sys/wait.h> #include <fcntl.h> -#include <wait.h> -+#include <sys/wait.h> #include <grp.h> #include <syslog.h> |