pkgsrc-Bugs archive

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

pkg/50088: security/policykit on DragonFly patch for /proc/${pid}/file not /proc/${pid}/exe



>Number:         50088
>Category:       pkg
>Synopsis:       security/policykit on DragonFly patch for /proc/${pid}/file not /proc/${pid}/exe
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 25 14:20:00 +0000 2015
>Originator:     David Shao
>Release:        pkgsrc current
>Organization:
>Environment:
DragonFly  4.3-DEVELOPMENT DragonFly v4.2.2.110.g99122-DEVELOPMENT #9: Fri Jul 24 10:04:48 PDT 2015     xxxxx@:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64
>Description:
For at least DragonFly 4.3-DEVELOPMENT, there is a missing defined(__DragonFly__) where there is an equivalent to defined(__FreeBSD__).  The current code apparently has policykit look for files of the form

/proc/${pid}/exe

which seems correct on NetBSD, but not on DragonFly, versus the correct

/proc/${pid}/file

The patch included below allows DragonFly to startx Xfce4 using exec /usr/pkg/bin/startxfce4 even without the previously submitted patches for dbus in PR/50075.  
>How-To-Repeat:

>Fix:

diff -bur policykit.orig/patches/patch-af policykit/patches/patch-af
--- policykit.orig/patches/patch-af	2012-12-27 13:04:11.000000000 -0800
+++ policykit/patches/patch-af	2015-07-25 05:54:01.100203000 -0700
@@ -1,6 +1,6 @@
-$NetBSD: patch-af,v 1.3 2012/12/27 21:04:11 bsiegert Exp $
+$NetBSD$
 
---- src/polkit/polkit-sysdeps.c.orig	2008-11-21 22:17:08.000000000 -0500
+--- src/polkit/polkit-sysdeps.c.orig	2008-05-30 21:24:44.000000000 +0000
 +++ src/polkit/polkit-sysdeps.c
 @@ -106,7 +106,7 @@ polkit_sysdeps_get_start_time_for_pid (p
          }
@@ -20,3 +20,12 @@
          tokens = kit_strsplit (contents, ' ', &num_tokens);
          if (tokens == NULL)
                  goto out;
+@@ -270,7 +270,7 @@ polkit_sysdeps_get_exe_for_pid (pid_t pi
+         ret = strlen (info.pr_psargs);
+         strncpy (out_buf, info.pr_psargs, ret);
+ #else
+-#ifdef __FreeBSD__
++#if defined(__FreeBSD__) || defined(__DragonFly__)
+ 	snprintf (proc_name, sizeof (proc_name), "/proc/%d/file", pid);
+ #else
+         snprintf (proc_name, sizeof (proc_name), "/proc/%d/exe", pid);



Home | Main Index | Thread Index | Old Index