pkgsrc-WIP-changes archive

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

polkit: Do not use %m in printf to show error message



Module Name:	pkgsrc-wip
Committed By:	Ryo ONODERA <ryoon%NetBSD.org@localhost>
Pushed By:	ryoon
Date:		Sun Mar 13 08:24:47 2016 +0900
Changeset:	cc55a1e3a629a521f662256ad209b1e5d5d03d78

Modified Files:
	polkit/Makefile
	polkit/distinfo
	polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c
Added Files:
	polkit/patches/patch-src_polkitbackend_polkitd.c
	polkit/patches/patch-src_programs_pkttyagent.c

Log Message:
polkit: Do not use %m in printf to show error message

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

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

diffstat:
 polkit/Makefile                                    |  1 +
 polkit/distinfo                                    |  4 +-
 ...ch-src_polkitbackend_polkitbackendjsauthority.c | 18 ++++++
 polkit/patches/patch-src_polkitbackend_polkitd.c   | 66 ++++++++++++++++++++++
 polkit/patches/patch-src_programs_pkttyagent.c     | 21 +++++++
 5 files changed, 109 insertions(+), 1 deletion(-)

diffs:
diff --git a/polkit/Makefile b/polkit/Makefile
index 8b6416d..9bd9b64 100644
--- a/polkit/Makefile
+++ b/polkit/Makefile
@@ -2,6 +2,7 @@
 #
 
 DISTNAME=	polkit-0.113
+PKGREVISION=	1
 CATEGORIES=	security
 MASTER_SITES=	http://www.freedesktop.org/software/polkit/releases/
 
diff --git a/polkit/distinfo b/polkit/distinfo
index dcd2c8f..784ca04 100644
--- a/polkit/distinfo
+++ b/polkit/distinfo
@@ -6,6 +6,8 @@ SHA512 (polkit-0.113.tar.gz) = ab177c89a20eeb2978ddbe28afb205d3619f9c5defe833eb6
 Size (polkit-0.113.tar.gz) = 1448865 bytes
 SHA1 (patch-src_polkit_polkitunixprocess.c) = 347ce2b4093a126eedb5dd2168d70cf636a30236
 SHA1 (patch-src_polkitbackend_polkitbackendinteractiveauthority.c) = d8b7cbcd0db26969bc4b83c32a731ae920c2e87b
-SHA1 (patch-src_polkitbackend_polkitbackendjsauthority.c) = 53154bd069b1e4d3d0707b6345c451865cb75cca
+SHA1 (patch-src_polkitbackend_polkitbackendjsauthority.c) = fec046c7776d81bee5641868e5ab790cb00d07ec
+SHA1 (patch-src_polkitbackend_polkitd.c) = 2f5075bcaff6b662de2aebdea31b38c7d60f50b6
+SHA1 (patch-src_programs_pkttyagent.c) = 0112c895ac0691baf31a6261e35d757e03e216c2
 SHA1 (patch-test_mocklibc_src_grp.c) = 1ad61ca043e0586ded84c3157d0271a1e3af2b9e
 SHA1 (patch-test_mocklibc_src_pwd.c) = 8f2b35cb90f96a115f7621a8751b9e64cba0a106
diff --git a/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c b/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c
index d9ff9f2..648cacb 100644
--- a/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c
+++ b/polkit/patches/patch-src_polkitbackend_polkitbackendjsauthority.c
@@ -19,6 +19,24 @@ $NetBSD: patch-src_polkitbackend_polkitbackendjsauthority.c,v 1.3 2015/04/02 14:
  #include <string.h>
  #include <glib/gstdio.h>
  #include <locale.h>
+@@ -812,7 +817,7 @@ subject_to_jsval (PolkitBackendJsAuthori
+   if (passwd == NULL)
+     {
+       user_name = g_strdup_printf ("%d", (gint) uid);
+-      g_warning ("Error looking up info for uid %d: %m", (gint) uid);
++      g_warning ("Error looking up info for uid %d: %s", (gint) uid, g_strerror(errno));
+     }
+   else
+     {
+@@ -826,7 +831,7 @@ subject_to_jsval (PolkitBackendJsAuthori
+                         gids,
+                         &num_gids) < 0)
+         {
+-          g_warning ("Error looking up groups for uid %d: %m", (gint) uid);
++          g_warning ("Error looking up groups for uid %d: %s", (gint) uid, g_strerror(errno));
+         }
+       else
+         {
 @@ -1508,8 +1513,13 @@ js_polkit_user_is_in_netgroup (JSContext
    JSBool ret = JS_FALSE;
    JSString *user_str;
diff --git a/polkit/patches/patch-src_polkitbackend_polkitd.c b/polkit/patches/patch-src_polkitbackend_polkitd.c
new file mode 100644
index 0000000..dc9debe
--- /dev/null
+++ b/polkit/patches/patch-src_polkitbackend_polkitd.c
@@ -0,0 +1,66 @@
+$NetBSD$
+
+--- src/polkitbackend/polkitd.c.orig	2015-06-18 20:20:50.000000000 +0000
++++ src/polkitbackend/polkitd.c
+@@ -22,6 +22,7 @@
+ #include "config.h"
+ 
+ #include <signal.h>
++#include <errno.h>
+ 
+ #include <glib-unix.h>
+ 
+@@ -109,20 +110,20 @@ become_user (const gchar  *user,
+   if (pw == NULL)
+     {
+       g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+-                   "Error calling getpwnam(): %m");
++                   "Error calling getpwnam(): %s", g_strerror(errno));
+       goto out;
+     }
+ 
+   if (setgroups (0, NULL) != 0)
+     {
+       g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+-                   "Error clearing groups: %m");
++                   "Error clearing groups: %s", g_strerror(errno));
+       goto out;
+     }
+   if (initgroups (pw->pw_name, pw->pw_gid) != 0)
+     {
+       g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+-                   "Error initializing groups: %m");
++                   "Error initializing groups: %s", g_strerror(errno));
+       goto out;
+     }
+ 
+@@ -132,16 +133,16 @@ become_user (const gchar  *user,
+       (getegid () != pw->pw_gid) || (getgid () != pw->pw_gid))
+     {
+       g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+-                   "Error becoming real+effective uid %d and gid %d: %m",
+-                   (int) pw->pw_uid, (int) pw->pw_gid);
++                   "Error becoming real+effective uid %d and gid %d: %s",
++                   (int) pw->pw_uid, (int) pw->pw_gid, g_strerror(errno));
+       goto out;
+     }
+ 
+   if (chdir (pw->pw_dir) != 0)
+     {
+       g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+-                   "Error changing to home directory %s: %m",
+-                   pw->pw_dir);
++                   "Error changing to home directory %s: %s",
++                   pw->pw_dir, g_strerror(errno));
+       goto out;
+     }
+ 
+@@ -196,7 +197,7 @@ main (int    argc,
+         }
+       else
+         {
+-          g_warning ("Error opening /dev/null: %m");
++          g_warning ("Error opening /dev/null: %s", g_strerror(errno));
+         }
+     }
+ 
diff --git a/polkit/patches/patch-src_programs_pkttyagent.c b/polkit/patches/patch-src_programs_pkttyagent.c
new file mode 100644
index 0000000..4d65804
--- /dev/null
+++ b/polkit/patches/patch-src_programs_pkttyagent.c
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- src/programs/pkttyagent.c.orig	2015-06-18 20:20:50.000000000 +0000
++++ src/programs/pkttyagent.c
+@@ -24,6 +24,7 @@
+ #endif
+ 
+ #include <stdio.h>
++#include <errno.h>
+ #include <glib/gi18n.h>
+ #include <polkit/polkit.h>
+ #define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE
+@@ -204,7 +205,7 @@ main (int argc, char *argv[])
+     {
+       if (close (opt_notify_fd) != 0)
+         {
+-          g_printerr ("Error closing notify-fd %d: %m\n", opt_notify_fd);
++          g_printerr ("Error closing notify-fd %d: %s\n", opt_notify_fd, g_strerror(errno));
+           goto out;
+         }
+     }


Home | Main Index | Thread Index | Old Index