summaryrefslogtreecommitdiff
path: root/sysutils/policykit/files
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2006-10-14 08:35:50 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2006-10-14 08:35:50 +0000
commitf1bb12de8e50bf76ae21f37debda60994ec7fd99 (patch)
tree1671d4beef381f12d939e34b344eb385a3af4f19 /sysutils/policykit/files
parent- Mark BROKEN on 6.x and below: this port uses posix_memalign(3) (diff)
Presenting GNOME 2.16.1 for FreeBSD. This release represents a massive
amount of work by the FreeBSD GNOME Team and our testers. On top of the usual GNOME update, we have taken this opportunity to move GNOME from X11BASE to LOCALBASE. This means roughly 600 ports NOT part of the GNOME Desktop also need to be changed. The bulk of the move was carried out by ahze, mezz, and pav, but it would not have been possible without cooperation from the FreeBSD KDE team who worked with us to make sure GNOME and KDE can still coexist happily. We would also like to send a shout out to kris and pointyhat for putting up with multiple test runs until we got something that was solid. Back to GNOME 2.16. This release brings a huge amount of new functionality to FreeBSD. The standard release notes can be read at http://www.gnome.org/start/2.16/ . But on top of what you will read there, jylefort and marcus have completed work on a port of HAL to FreeBSD. This will allow FreeBSD to take advantage of closer hardware interaction such as auto-mounting CD-ROMs, USB drives, and music players; auto-playing audio CDs; and managing laptop power consumption. But where would this all be without our loyal testers and contributors? Therefore, the FreeBSD GNOME team would like to thank the following users: Phillip Neumann <pneumann@gmail.com> tmclaugh mux Yuri Pankov <yuri.pankov@gmail.com> chinsan Thomas <freebsdlists@bsdunix.ch> Brian Gruber <knightbg@yahoo.com> Franz Klammer <klammer@webonaut.com> Dominique Goncalves <dominique.goncalves@gmail.com> Pascal Hofstee <caelian@gmail.com> Yasuda Keisuke <kysd@po.harenet.ne.jp> backyard <backyard1454-bsd@yahoo.com> Andris Raugulis <endrju@null.lv> <endrju@null.lv> Eric L. Chen <d9364104@mail.nchu.edu.tw> Pawel Worach <pawel.worach@gmail.com> QuiRK on #freebsd-gnome Shane Bell <decept0@gmail.com> luigi sajd on #freebsd-gnome sat Chris Coleman <chrisc@vmunix.com> kaeru on #freebsd-gnome crsd_ via irc.freenode.org/#FreeBSD-GNOME Joel Diaz <joeldiaz@mac.com> Enjoy! Approved by: portmgr (implicit, kris)
Diffstat (limited to 'sysutils/policykit/files')
-rw-r--r--sysutils/policykit/files/patch-Makefile.in11
-rw-r--r--sysutils/policykit/files/patch-polkitd_policy.c118
-rw-r--r--sysutils/policykit/files/patch-tools_Makefile.in14
-rw-r--r--sysutils/policykit/files/polkitd.in56
4 files changed, 199 insertions, 0 deletions
diff --git a/sysutils/policykit/files/patch-Makefile.in b/sysutils/policykit/files/patch-Makefile.in
new file mode 100644
index 000000000000..0c9552c020d6
--- /dev/null
+++ b/sysutils/policykit/files/patch-Makefile.in
@@ -0,0 +1,11 @@
+--- Makefile.in.orig Mon May 1 01:11:30 2006
++++ Makefile.in Mon May 1 01:11:43 2006
+@@ -231,7 +231,7 @@ sbindir = @sbindir@
+ sharedstatedir = @sharedstatedir@
+ sysconfdir = @sysconfdir@
+ target_alias = @target_alias@
+-SUBDIRS = libpolkit polkitd doc tools privileges
++SUBDIRS = libpolkit polkitd tools privileges
+ pamdir = $(sysconfdir)/pam.d
+ pam_DATA = policy-kit
+ pkgconfigdir = $(prefix)/libdata/pkgconfig
diff --git a/sysutils/policykit/files/patch-polkitd_policy.c b/sysutils/policykit/files/patch-polkitd_policy.c
new file mode 100644
index 000000000000..c633366a2b60
--- /dev/null
+++ b/sysutils/policykit/files/patch-polkitd_policy.c
@@ -0,0 +1,118 @@
+--- polkitd/policy.c.orig Tue Mar 14 07:14:33 2006
++++ polkitd/policy.c Tue May 2 01:53:06 2006
+@@ -537,13 +537,15 @@
+ int rc;
+ char *res;
+ char *buf = NULL;
+- unsigned int bufsize;
++ long bufsize;
+ struct passwd pwd;
+ struct passwd *pwdp;
+
+ res = NULL;
+
+ bufsize = sysconf (_SC_GETPW_R_SIZE_MAX);
++ if (bufsize < 0)
++ bufsize = 1024;
+ buf = g_new0 (char, bufsize);
+
+ rc = getpwuid_r (uid, &pwd, buf, bufsize, &pwdp);
+@@ -567,13 +569,15 @@
+ int rc;
+ char *res;
+ char *buf = NULL;
+- unsigned int bufsize;
++ long bufsize;
+ struct group gbuf;
+ struct group *gbufp;
+
+ res = NULL;
+
+ bufsize = sysconf (_SC_GETGR_R_SIZE_MAX);
++ if (bufsize < 0)
++ bufsize = 1024;
+ buf = g_new0 (char, bufsize);
+
+ rc = getgrgid_r (gid, &gbuf, buf, bufsize, &gbufp);
+@@ -597,13 +601,15 @@
+ int rc;
+ uid_t res;
+ char *buf = NULL;
+- unsigned int bufsize;
++ long bufsize;
+ struct passwd pwd;
+ struct passwd *pwdp;
+
+ res = (uid_t) -1;
+
+ bufsize = sysconf (_SC_GETPW_R_SIZE_MAX);
++ if (bufsize < 0)
++ bufsize = 1024;
+ buf = g_new0 (char, bufsize);
+
+ rc = getpwnam_r (username, &pwd, buf, bufsize, &pwdp);
+@@ -627,13 +633,15 @@
+ int rc;
+ gid_t res;
+ char *buf = NULL;
+- unsigned int bufsize;
++ long bufsize;
+ struct group gbuf;
+ struct group *gbufp;
+
+ res = (gid_t) -1;
+
+ bufsize = sysconf (_SC_GETGR_R_SIZE_MAX);
++ if (bufsize < 0)
++ bufsize = 1024;
+ buf = g_new0 (char, bufsize);
+
+ rc = getgrnam_r (groupname, &gbuf, buf, bufsize, &gbufp);
+@@ -649,6 +657,23 @@
+ return res;
+ }
+
++static int
++getgrouplist_ala_linux (const char *name,
++ gid_t basegid,
++ gid_t *groups,
++ int *ngroups)
++{
++ if (groups)
++ return getgrouplist (name, basegid, groups, ngroups);
++ else {
++ for (*ngroups = 1;; (*ngroups)++) {
++ gid_t _groups[*ngroups];
++ if (getgrouplist (name, basegid, _groups, ngroups) != -1)
++ return 0;
++ }
++ }
++}
++
+ PolicyResult
+ policy_get_allowed_resources_for_policy_for_uid (uid_t uid,
+ const char *policy,
+@@ -665,9 +690,9 @@
+ if ((username = policy_util_uid_to_name (uid, &default_gid)) == NULL)
+ goto out;
+
+- if (getgrouplist(username, default_gid, NULL, &num_groups) < 0) {
++ if (getgrouplist_ala_linux(username, default_gid, NULL, &num_groups) < 0) {
+ groups = (gid_t *) g_new0 (gid_t, num_groups);
+- if (getgrouplist(username, default_gid, groups, &num_groups) < 0) {
++ if (getgrouplist_ala_linux(username, default_gid, groups, &num_groups) < 0) {
+ g_warning ("getgrouplist() failed");
+ goto out;
+ }
+@@ -702,9 +727,9 @@
+ if ((username = policy_util_uid_to_name (uid, &default_gid)) == NULL)
+ goto out;
+
+- if (getgrouplist(username, default_gid, NULL, &num_groups) < 0) {
++ if (getgrouplist_ala_linux(username, default_gid, NULL, &num_groups) < 0) {
+ groups = (gid_t *) g_new0 (gid_t, num_groups);
+- if (getgrouplist(username, default_gid, groups, &num_groups) < 0) {
++ if (getgrouplist_ala_linux(username, default_gid, groups, &num_groups) < 0) {
+ g_warning ("getgrouplist() failed");
+ goto out;
+ }
diff --git a/sysutils/policykit/files/patch-tools_Makefile.in b/sysutils/policykit/files/patch-tools_Makefile.in
new file mode 100644
index 000000000000..9308ff774f36
--- /dev/null
+++ b/sysutils/policykit/files/patch-tools_Makefile.in
@@ -0,0 +1,14 @@
+--- tools/Makefile.in.orig Sun Oct 8 03:37:21 2006
++++ tools/Makefile.in Sun Oct 8 03:37:37 2006
+@@ -252,9 +252,9 @@ INCLUDES = \
+ @DBUS_CFLAGS@
+
+ polkit_is_privileged_SOURCES = polkit-is-privileged.c
+-polkit_is_privileged_LDADD = @DBUS_CFLAGS@ @GLIB_LIBS@ $(top_builddir)/libpolkit/libpolkit.la
++polkit_is_privileged_LDADD = @DBUS_LIBS@ @GLIB_LIBS@ $(top_builddir)/libpolkit/libpolkit.la
+ polkit_list_privileges_SOURCES = polkit-list-privileges.c
+-polkit_list_privileges_LDADD = @DBUS_CFLAGS@ @GLIB_LIBS@ $(top_builddir)/libpolkit/libpolkit.la
++polkit_list_privileges_LDADD = @DBUS_LIBS@ @GLIB_LIBS@ $(top_builddir)/libpolkit/libpolkit.la
+ polkit_grant_privilege_SOURCES = \
+ polkit-grant-privilege.c \
+ polkit-interface-manager-glue.h \
diff --git a/sysutils/policykit/files/polkitd.in b/sysutils/policykit/files/polkitd.in
new file mode 100644
index 000000000000..3ded54522dff
--- /dev/null
+++ b/sysutils/policykit/files/polkitd.in
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: polkitd
+# REQUIRE: DAEMON dbus
+#
+# Add the following line to /etc/rc.conf to enable the PolicyKit daemon:
+#
+# polkitd_enable="YES"
+#
+
+polkitd_enable=${polkitd_enable-"NO"}
+
+. %%RC_SUBR%%
+
+name=polkitd
+rcvar=`set_rcvar`
+
+command="%%PREFIX%%/sbin/polkitd"
+pidfile="/var/run/${name}/${name}.pid"
+
+start_precmd="polkitd_precmd"
+stop_postcmd="polkitd_postcmd"
+
+local_force_depend()
+{
+ _depend="$1"
+ if [ -f %%LOCALBASE%%/etc/rc.d/${_depend}.sh ]; then
+ _depend="${_depend}.sh"
+ fi
+
+ if ! %%LOCALBASE%%/etc/rc.d/${_depend} forcestatus 1>/dev/null 2>&1 &&
+ ! %%LOCALBASE%%/etc/rc.d/${_depend} forcestart; then
+ return 1
+ fi
+ return 0
+}
+
+polkitd_precmd()
+{
+ if ! checkyesno dbus_enable
+ then
+ local_force_depend dbus || return 1
+ fi
+
+ mkdir -p $(dirname $pidfile)
+}
+
+polkitd_postcmd()
+{
+ rm -f $pidfile
+}
+
+load_rc_config ${name}
+run_rc_command "$1"