import of PolicyKit-0.9;
PolicyKit is a framework for defining policy for system-wide components and for desktop pieces to configure it. It is used by HAL.
This commit is contained in:
parent
e4531da486
commit
263aeffc03
36
sysutils/policykit/Makefile
Normal file
36
sysutils/policykit/Makefile
Normal file
@ -0,0 +1,36 @@
|
||||
# $OpenBSD: Makefile,v 1.1.1.1 2009/06/07 02:53:06 robert Exp $
|
||||
|
||||
COMMENT= Framework for controlling access to system-wide components
|
||||
|
||||
DISTNAME= PolicyKit-0.9
|
||||
PKGNAME= ${DISTNAME:L}
|
||||
CATEGORIES= sysutils
|
||||
|
||||
SHARED_LIBS+= polkit-dbus 2.0 \
|
||||
polkit-grant 2.0 \
|
||||
polkit 2.0
|
||||
|
||||
HOMEPAGE= http://cgit.freedesktop.org/PolicyKit/
|
||||
|
||||
# GPLv2+
|
||||
PERMIT_DISTFILES_CDROM= Yes
|
||||
PERMIT_DISTFILES_FTP= Yes
|
||||
PERMIT_PACKAGE_CDROM= Yes
|
||||
PERMIT_PACKAGE_FTP= Yes
|
||||
|
||||
WANTLIB= c
|
||||
|
||||
MASTER_SITES= http://hal.freedesktop.org/releases/
|
||||
|
||||
AUTOCONF_VERSION= 2.62
|
||||
CONFIGURE_STYLE= autoconf
|
||||
CONFIGURE_ARGS= --with-authfw=bsdauth \
|
||||
--with-os-type=openbsd
|
||||
CONFIGURE_ENV= CFLAGS="-I${LOCALBASE}/include"
|
||||
USE_GMAKE= Yes
|
||||
|
||||
USE_LIBTOOL= Yes
|
||||
|
||||
FAKE_FLAGS= sysconfdir=${TRUEPREFIX}/share/examples/policykit
|
||||
|
||||
.include <bsd.port.mk>
|
5
sysutils/policykit/distinfo
Normal file
5
sysutils/policykit/distinfo
Normal file
@ -0,0 +1,5 @@
|
||||
MD5 (PolicyKit-0.9.tar.gz) = gC/ROuQfc9eTWeXssKmHFg==
|
||||
RMD160 (PolicyKit-0.9.tar.gz) = GXJi0cSOVVWN1L1X17vYc0ZmEpw=
|
||||
SHA1 (PolicyKit-0.9.tar.gz) = rJnFgO/3L21d8mHBVfsEcwZDn4U=
|
||||
SHA256 (PolicyKit-0.9.tar.gz) = 9Ax8a+wZ19uiM1vdz/0EV0lECaDfzhHYiMdI3IkugLc=
|
||||
SIZE (PolicyKit-0.9.tar.gz) = 1254318
|
49
sysutils/policykit/patches/patch-configure_in
Normal file
49
sysutils/policykit/patches/patch-configure_in
Normal file
@ -0,0 +1,49 @@
|
||||
$OpenBSD: patch-configure_in,v 1.1.1.1 2009/06/07 02:53:06 robert Exp $
|
||||
--- configure.in.orig Mon Jun 30 21:40:59 2008
|
||||
+++ configure.in Sat May 30 20:47:45 2009
|
||||
@@ -300,7 +300,7 @@ dnl --------------------------------------------------
|
||||
|
||||
AC_ARG_WITH([authfw],
|
||||
AS_HELP_STRING([--with-authfw=<name>],
|
||||
- [Authentication framework (none/pam/shadow)]))
|
||||
+ [Authentication framework (none/pam/shadow/bsdauth)]))
|
||||
if ! test -z "$with_authfw" ; then
|
||||
if test x$with_authdb = xdummy ; then
|
||||
if ! test x$with_authfw = xnone ; then
|
||||
@@ -340,6 +340,10 @@ case $POLKIT_AUTHFW in
|
||||
AC_DEFINE(POLKIT_AUTHFW_SHADOW, 1, [If using the Shadow authentication framework])
|
||||
;;
|
||||
|
||||
+ bsdauth)
|
||||
+ need_pam=no
|
||||
+ AC_DEFINE(POLKIT_AUTHFW_BSDAUTH, 1, [If using the BSD authentication framework])
|
||||
+ ;;
|
||||
*)
|
||||
AC_MSG_ERROR([Unknown Authentication Framework: $POLKIT_AUTHFW])
|
||||
;;
|
||||
@@ -348,6 +352,7 @@ esac
|
||||
AM_CONDITIONAL(POLKIT_AUTHFW_NONE, [test x$POLKIT_AUTHFW = xnone], [Using no authfw])
|
||||
AM_CONDITIONAL(POLKIT_AUTHFW_PAM, [test x$POLKIT_AUTHFW = xpam], [Using PAM authfw])
|
||||
AM_CONDITIONAL(POLKIT_AUTHFW_SHADOW, [test x$POLKIT_AUTHFW = xshadow], [Using Shadow authfw])
|
||||
+AM_CONDITIONAL(POLKIT_AUTHFW_BSDAUTH, [test x$POLKIT_AUTHFW = xbsdauth], [Using BSD authfw])
|
||||
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
@@ -473,6 +478,7 @@ AM_CONDITIONAL(OS_TYPE_GENTOO, test x$with_os_type = x
|
||||
AM_CONDITIONAL(OS_TYPE_PARDUS, test x$with_os_type = xpardus, [Running on Pardus OS'es])
|
||||
AM_CONDITIONAL(OS_TYPE_SOLARIS, test x$with_os_type = xsolaris, [Running os Solaris OS'es])
|
||||
AM_CONDITIONAL(OS_TYPE_FREEBSD, test x$with_os_type = xfreebsd, [Running on FreeBSD OS'es])
|
||||
+AM_CONDITIONAL(OS_TYPE_OPENBSD, test x$with_os_type = xopenbsd, [Running on OpenBSD OS'es])
|
||||
|
||||
AC_ARG_WITH(pam-include, [ --with-pam-include=<file> pam file to include])
|
||||
|
||||
@@ -524,6 +530,9 @@ case "$host_os" in
|
||||
;;
|
||||
*freebsd*)
|
||||
AC_DEFINE([HAVE_FREEBSD], 1, [Is this a FreeBSD system?])
|
||||
+ ;;
|
||||
+ *openbsd*)
|
||||
+ AC_DEFINE([HAVE_OPENBSD], 1, [Is this a OpenBSD system?])
|
||||
;;
|
||||
esac
|
||||
|
@ -0,0 +1,22 @@
|
||||
$OpenBSD: patch-src_polkit-dbus_polkit-resolve-exe-helper_c,v 1.1.1.1 2009/06/07 02:53:06 robert Exp $
|
||||
--- src/polkit-dbus/polkit-resolve-exe-helper.c.orig Sat May 30 20:39:36 2009
|
||||
+++ src/polkit-dbus/polkit-resolve-exe-helper.c Sat May 30 20:45:04 2009
|
||||
@@ -43,7 +43,9 @@
|
||||
#ifdef HAVE_FREEBSD
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
+#ifndef HAVE_OPENBSD
|
||||
#include <security/pam_appl.h>
|
||||
+#endif
|
||||
#include <grp.h>
|
||||
#include <pwd.h>
|
||||
#include <syslog.h>
|
||||
@@ -56,7 +58,7 @@
|
||||
#include <polkit-dbus/polkit-dbus.h>
|
||||
#include <polkit/polkit-private.h>
|
||||
|
||||
-#ifdef HAVE_SOLARIS
|
||||
+#if defined(HAVE_SOLARIS) || defined(HAVE_OPENBSD)
|
||||
#define LOG_AUTHPRIV (10<<3)
|
||||
#define PATH_MAX 1024
|
||||
#endif
|
@ -0,0 +1,66 @@
|
||||
$OpenBSD: patch-src_polkit-grant_Makefile_in,v 1.1.1.1 2009/06/07 02:53:06 robert Exp $
|
||||
--- src/polkit-grant/Makefile.in.orig Sat May 30 22:09:35 2009
|
||||
+++ src/polkit-grant/Makefile.in Sat May 30 22:09:38 2009
|
||||
@@ -43,6 +43,7 @@ host_triplet = @host@
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@ polkit-revoke-helper$(EXEEXT)
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE@am__append_3 = polkit-grant-helper-pam
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_SHADOW_TRUE@am__append_4 = polkit-grant-helper-shadow
|
||||
+@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_BSDAUTH_TRUE@am__append_4 = polkit-grant-helper-bsdauth
|
||||
@KIT_BUILD_TESTS_TRUE@TESTS = polkit-grant-test$(EXEEXT)
|
||||
@KIT_BUILD_TESTS_TRUE@check_PROGRAMS = $(am__EXEEXT_1)
|
||||
subdir = src/polkit-grant
|
||||
@@ -83,6 +84,7 @@ libpolkit_grant_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIB
|
||||
@KIT_BUILD_TESTS_TRUE@am__EXEEXT_1 = polkit-grant-test$(EXEEXT)
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE@am__EXEEXT_2 = polkit-grant-helper-pam$(EXEEXT)
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_SHADOW_TRUE@am__EXEEXT_3 = polkit-grant-helper-shadow$(EXEEXT)
|
||||
+@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_BSDAUTH_TRUE@am__EXEEXT_3 = polkit-grant-helper-bsdauth$(EXEEXT)
|
||||
libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
PROGRAMS = $(libexec_PROGRAMS)
|
||||
am__polkit_explicit_grant_helper_SOURCES_DIST = \
|
||||
@@ -120,6 +122,12 @@ am__polkit_grant_helper_shadow_SOURCES_DIST = \
|
||||
polkit_grant_helper_shadow_OBJECTS = \
|
||||
$(am_polkit_grant_helper_shadow_OBJECTS)
|
||||
polkit_grant_helper_shadow_DEPENDENCIES =
|
||||
+am__polkit_grant_helper_bsdauth_SOURCES_DIST = \
|
||||
+ polkit-grant-helper-bsdauth.c
|
||||
+@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_BSDAUTH_TRUE@am_polkit_grant_helper_bsdauth_OBJECTS = polkit-grant-helper-bsdauth.$(OBJEXT)
|
||||
+polkit_grant_helper_bsdauth_OBJECTS = \
|
||||
+ $(am_polkit_grant_helper_bsdauth_OBJECTS)
|
||||
+polkit_grant_helper_bsdauth_DEPENDENCIES =
|
||||
am__polkit_grant_test_SOURCES_DIST = polkit-grant-test.h \
|
||||
polkit-grant-test.c
|
||||
@KIT_BUILD_TESTS_TRUE@am_polkit_grant_test_OBJECTS = \
|
||||
@@ -380,6 +388,8 @@ libpolkit_grant_la_LIBADD = @GLIB_LIBS@ @DBUS_LIBS@ $(
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE@polkit_grant_helper_pam_LDADD = @AUTH_LIBS@ $(top_builddir)/src/kit/libkit.la $(top_builddir)/src/polkit/libpolkit.la
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_SHADOW_TRUE@polkit_grant_helper_shadow_SOURCES = polkit-grant-helper-shadow.c
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_SHADOW_TRUE@polkit_grant_helper_shadow_LDADD = @AUTH_LIBS@
|
||||
+@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_BSDAUTH_TRUE@polkit_grant_helper_bsdauth_SOURCES = polkit-grant-helper-bsdauth.c
|
||||
+@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_BSDAUTH_TRUE@polkit_grant_helper_bsdauth_LDADD = @AUTH_LIBS@
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@polkit_explicit_grant_helper_SOURCES = polkit-explicit-grant-helper.c
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@polkit_explicit_grant_helper_CFLAGS = @DBUS_CFLAGS@
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@polkit_explicit_grant_helper_LDADD = $(top_builddir)/src/kit/libkit.la $(top_builddir)/src/polkit/libpolkit.la $(top_builddir)/src/polkit-dbus/libpolkit-dbus.la libpolkit-grant.la
|
||||
@@ -884,6 +894,8 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-libex
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE@ -chmod 4754 $(DESTDIR)$(libexecdir)/polkit-grant-helper-pam
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_SHADOW_TRUE@ -chgrp $(POLKIT_GROUP) $(DESTDIR)$(libexecdir)/polkit-grant-helper-shadow
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_SHADOW_TRUE@ -chmod 4750 $(DESTDIR)$(libexecdir)/polkit-grant-helper-shadow
|
||||
+@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_BSDAUTH_TRUE@ -chgrp $(POLKIT_GROUP) $(DESTDIR)$(libexecdir)/polkit-grant-helper-bsdauth
|
||||
+@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_BSDAUTH_TRUE@ -chmod 4750 $(DESTDIR)$(libexecdir)/polkit-grant-helper-bsdauth
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@ -chgrp $(POLKIT_GROUP) $(DESTDIR)$(libexecdir)/polkit-explicit-grant-helper
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@ -chmod 2755 $(DESTDIR)$(libexecdir)/polkit-explicit-grant-helper
|
||||
@POLKIT_AUTHDB_DEFAULT_TRUE@ -chgrp $(POLKIT_GROUP) $(DESTDIR)$(libexecdir)/polkit-revoke-helper
|
||||
@@ -900,6 +912,7 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-libex
|
||||
@KIT_BUILD_TESTS_TRUE@@KIT_GCOV_ENABLED_TRUE@@POLKIT_AUTHDB_DEFAULT_TRUE@ echo src/polkit-grant/polkit-grant-helper.c >> covered-files.txt
|
||||
@KIT_BUILD_TESTS_TRUE@@KIT_GCOV_ENABLED_TRUE@@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE@ echo src/polkit-grant/polkit-grant-helper-pam.c >> covered-files.txt
|
||||
@KIT_BUILD_TESTS_TRUE@@KIT_GCOV_ENABLED_TRUE@@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_SHADOW_TRUE@ echo src/polkit-grant/polkit-grant-helper-shadow.c >> covered-files.txt
|
||||
+@KIT_BUILD_TESTS_TRUE@@KIT_GCOV_ENABLED_TRUE@@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_BSDAUTH_TRUE@ echo src/polkit-grant/polkit-grant-helper-bsdauth.c >> covered-files.txt
|
||||
@KIT_BUILD_TESTS_TRUE@@KIT_GCOV_ENABLED_TRUE@@POLKIT_AUTHDB_DEFAULT_TRUE@ echo src/polkit-grant/polkit-revoke-helper.c >> covered-files.txt
|
||||
|
||||
@KIT_BUILD_TESTS_TRUE@@KIT_GCOV_ENABLED_TRUE@coverage-report.txt : covered-files.txt clean-gcov all check
|
||||
@@ -908,6 +921,7 @@ uninstall-am: uninstall-libLTLIBRARIES uninstall-libex
|
||||
@KIT_BUILD_TESTS_TRUE@@KIT_GCOV_ENABLED_TRUE@@POLKIT_AUTHDB_DEFAULT_TRUE@ gcov polkit-grant-helper.c -o .libs/ > /dev/null
|
||||
@KIT_BUILD_TESTS_TRUE@@KIT_GCOV_ENABLED_TRUE@@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_PAM_TRUE@ gcov polkit-grant-helper-pam.c -o .libs/ > /dev/null
|
||||
@KIT_BUILD_TESTS_TRUE@@KIT_GCOV_ENABLED_TRUE@@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_SHADOW_TRUE@ gcov polkit-grant-helper-shadow.c -o .libs/ > /dev/null
|
||||
+@KIT_BUILD_TESTS_TRUE@@KIT_GCOV_ENABLED_TRUE@@POLKIT_AUTHDB_DEFAULT_TRUE@@POLKIT_AUTHFW_BSDAUTH_TRUE@ gcov polkit-grant-helper-bsdauth.c -o .libs/ > /dev/null
|
||||
@KIT_BUILD_TESTS_TRUE@@KIT_GCOV_ENABLED_TRUE@@POLKIT_AUTHDB_DEFAULT_TRUE@ gcov polkit-revoke-helper.c -o .libs/ > /dev/null
|
||||
@KIT_BUILD_TESTS_TRUE@@KIT_GCOV_ENABLED_TRUE@ $(top_srcdir)/test/create-coverage-report.sh "module polkit-grant" `cat covered-files.txt` > coverage-report.txt
|
||||
|
@ -0,0 +1,164 @@
|
||||
$OpenBSD: patch-src_polkit-grant_polkit-grant-helper-bsdauth_c,v 1.1.1.1 2009/06/07 02:53:06 robert Exp $
|
||||
--- src/polkit-grant/polkit-grant-helper-bsdauth.c.orig Sat May 30 22:09:51 2009
|
||||
+++ src/polkit-grant/polkit-grant-helper-bsdauth.c Sat May 30 22:24:03 2009
|
||||
@@ -0,0 +1,160 @@
|
||||
+/***************************************************************************
|
||||
+ *
|
||||
+ * polkit-grant-helper-bsdauth.c : setuid root bsdauth helper for PolicyKit
|
||||
+ *
|
||||
+ * Copyright (C) 2009 Robert Nagy, <robert@openbsd.org>
|
||||
+ *
|
||||
+ * Based on polkit-grant-helper-pam.c :
|
||||
+ * Copyright (C) 2007 David Zeuthen, <david@fubar.dk>
|
||||
+ *
|
||||
+ * Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use, copy,
|
||||
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
+ * of the Software, and to permit persons to whom the Software is
|
||||
+ * furnished to do so, subject to the following conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
+ * DEALINGS IN THE SOFTWARE.
|
||||
+ *
|
||||
+ **************************************************************************/
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
+#include <unistd.h>
|
||||
+#include <sys/types.h>
|
||||
+#include <sys/stat.h>
|
||||
+#include <syslog.h>
|
||||
+#include <grp.h>
|
||||
+#include <pwd.h>
|
||||
+
|
||||
+/* Development aid: define PGH_DEBUG to get debugging output. Do _NOT_
|
||||
+ * enable this in production builds; it may leak passwords and other
|
||||
+ * sensitive information.
|
||||
+ */
|
||||
+#undef PGH_DEBUG
|
||||
+#define PGH_DEBUG
|
||||
+
|
||||
+extern char *crypt();
|
||||
+static int do_auth(const char *user_to_auth);
|
||||
+int clearenv(void);
|
||||
+
|
||||
+int
|
||||
+clearenv(void)
|
||||
+{
|
||||
+ extern char **environ;
|
||||
+
|
||||
+ environ[0] = NULL;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int main(int argc, char *argv[])
|
||||
+{
|
||||
+ char user_to_auth[256];
|
||||
+
|
||||
+ /* clear the entire environment to avoid attacks with
|
||||
+ * libraries honoring environment variables */
|
||||
+ if (clearenv () != 0)
|
||||
+ goto error;
|
||||
+ /* set a minimal environment */
|
||||
+ setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
|
||||
+
|
||||
+ /* check that we are setuid root */
|
||||
+ if (geteuid () != 0) {
|
||||
+ fprintf (stderr, "polkit-grant-helper-shadow: needs to be setuid root\n");
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ openlog ("polkit-grant-helper-shadow", LOG_CONS | LOG_PID, LOG_AUTHPRIV);
|
||||
+
|
||||
+ /* check for correct invocation */
|
||||
+ if (argc != 1) {
|
||||
+ syslog (LOG_NOTICE, "inappropriate use of helper, wrong number of arguments [uid=%d]", getuid ());
|
||||
+ fprintf (stderr, "polkit-grant-helper-shadow: wrong number of arguments. This incident has been logged.\n");
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ if (getuid () != 0) {
|
||||
+ /* check we're running with a non-tty stdin */
|
||||
+ if (isatty (STDIN_FILENO) != 0) {
|
||||
+ syslog (LOG_NOTICE, "inappropriate use of helper, stdin is a tty [uid=%d]", getuid ());
|
||||
+ fprintf (stderr, "polkit-grant-helper-shadow: inappropriate use of helper, stdin is a tty. This incident has been logged.\n");
|
||||
+ goto error;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* get user to auth */
|
||||
+ if (fgets (user_to_auth, sizeof (user_to_auth), stdin) == NULL)
|
||||
+ goto error;
|
||||
+ if (strlen (user_to_auth) > 0 && user_to_auth[strlen (user_to_auth) - 1] == '\n')
|
||||
+ user_to_auth[strlen(user_to_auth) - 1] = '\0';
|
||||
+
|
||||
+#ifdef PGH_DEBUG
|
||||
+ fprintf (stderr, "polkit-grant-helper-shadow: user to auth is '%s'.\n", user_to_auth);
|
||||
+#endif /* PGH_DEBUG */
|
||||
+
|
||||
+ if(!do_auth (user_to_auth)) {
|
||||
+ syslog (LOG_NOTICE, "authentication failure [uid=%d] trying to authenticate '%s'", getuid (), user_to_auth);
|
||||
+ fprintf (stderr, "polkit-grant-helper-shadow: authentication failure. This incident has been logged.\n");
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+#ifdef PGH_DEBUG
|
||||
+ fprintf (stderr, "polkit-grant-helper-shadow: successfully authenticated user '%s'.\n", user_to_auth);
|
||||
+#endif /* PGH_DEBUG */
|
||||
+
|
||||
+ fprintf (stdout, "SUCCESS\n");
|
||||
+ fflush (stdout);
|
||||
+ return 0;
|
||||
+
|
||||
+error:
|
||||
+ /* sleep (2); */ /* Discourage brute force attackers BULLSHIT */
|
||||
+ fprintf (stdout, "FAILURE\n");
|
||||
+ fflush (stdout);
|
||||
+ return 1;
|
||||
+}
|
||||
+/*
|
||||
+ * This is the bsdauth do_auth function. It receives
|
||||
+ * only the name of user (user_to_auth). Waits for
|
||||
+ * password in stdin and auth the user. It return success
|
||||
+ * if the user can be authenticated and unsuccess when
|
||||
+ * user can't be authenticated.
|
||||
+ */
|
||||
+int do_auth(const char *user_to_auth)
|
||||
+{
|
||||
+ struct passwd *pwd;
|
||||
+ size_t plen;
|
||||
+ char *salt, *password = NULL;
|
||||
+
|
||||
+ pwd = getpwnam(user_to_auth);
|
||||
+ if (pwd)
|
||||
+ salt = pwd->pw_passwd;
|
||||
+ else
|
||||
+ goto error;
|
||||
+
|
||||
+ password = getpass("");
|
||||
+
|
||||
+ salt = crypt(password, salt);
|
||||
+ plen = strlen(password);
|
||||
+ memset(password, 0, plen);
|
||||
+
|
||||
+ if (!pwd || strcmp(salt, pwd->pw_passwd) != 0 ||
|
||||
+ (*pwd->pw_passwd == '\0' && plen > 0))
|
||||
+ goto error;
|
||||
+
|
||||
+ return 1;
|
||||
+
|
||||
+error:
|
||||
+ return 0;
|
||||
+}
|
@ -0,0 +1,13 @@
|
||||
$OpenBSD: patch-src_polkit-grant_polkit-grant-helper_c,v 1.1.1.1 2009/06/07 02:53:06 robert Exp $
|
||||
--- src/polkit-grant/polkit-grant-helper.c.orig Sat May 30 21:02:40 2009
|
||||
+++ src/polkit-grant/polkit-grant-helper.c Sat May 30 21:03:09 2009
|
||||
@@ -183,6 +183,9 @@ do_auth (const char *user_to_auth, gboolean *empty_con
|
||||
#ifdef POLKIT_AUTHFW_SHADOW
|
||||
char *helper_argv[2] = {PACKAGE_LIBEXEC_DIR "/polkit-grant-helper-shadow", NULL};
|
||||
#endif
|
||||
+#ifdef POLKIT_AUTHFW_BSDAUTH
|
||||
+ char *helper_argv[2] = {PACKAGE_LIBEXEC_DIR "/polkit-grant-helper-bsdauth", NULL};
|
||||
+#endif
|
||||
char buf[256];
|
||||
FILE *child_stdin;
|
||||
FILE *child_stdout;
|
12
sysutils/policykit/patches/patch-tools_polkit-auth_c
Normal file
12
sysutils/policykit/patches/patch-tools_polkit-auth_c
Normal file
@ -0,0 +1,12 @@
|
||||
$OpenBSD: patch-tools_polkit-auth_c,v 1.1.1.1 2009/06/07 02:53:06 robert Exp $
|
||||
--- tools/polkit-auth.c.orig Sat May 30 21:54:41 2009
|
||||
+++ tools/polkit-auth.c Sat May 30 21:54:51 2009
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
-#if defined(HAVE_SOLARIS) || defined(HAVE_FREEBSD)
|
||||
+#if defined(HAVE_SOLARIS) || defined(HAVE_FREEBSD) || defined(HAVE_OPENBSD)
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
#include <pwd.h>
|
2
sysutils/policykit/pkg/DESCR
Normal file
2
sysutils/policykit/pkg/DESCR
Normal file
@ -0,0 +1,2 @@
|
||||
PolicyKit is a framework for defining policy for system-wide components and
|
||||
for desktop pieces to configure it. It is used by HAL.
|
4
sysutils/policykit/pkg/PFRAG.shared
Normal file
4
sysutils/policykit/pkg/PFRAG.shared
Normal file
@ -0,0 +1,4 @@
|
||||
@comment $OpenBSD: PFRAG.shared,v 1.1.1.1 2009/06/07 02:53:06 robert Exp $
|
||||
@lib lib/libpolkit-dbus.so.${LIBpolkit-dbus_VERSION}
|
||||
@lib lib/libpolkit-grant.so.${LIBpolkit-grant_VERSION}
|
||||
@lib lib/libpolkit.so.${LIBpolkit_VERSION}
|
156
sysutils/policykit/pkg/PLIST
Normal file
156
sysutils/policykit/pkg/PLIST
Normal file
@ -0,0 +1,156 @@
|
||||
@comment $OpenBSD: PLIST,v 1.1.1.1 2009/06/07 02:53:06 robert Exp $
|
||||
%%SHARED%%
|
||||
@bin bin/polkit-action
|
||||
@bin bin/polkit-auth
|
||||
@bin bin/polkit-config-file-validate
|
||||
@bin bin/polkit-policy-file-validate
|
||||
include/PolicyKit/
|
||||
include/PolicyKit/polkit/
|
||||
include/PolicyKit/polkit-dbus/
|
||||
include/PolicyKit/polkit-dbus/polkit-dbus.h
|
||||
include/PolicyKit/polkit-dbus/polkit-simple.h
|
||||
include/PolicyKit/polkit-grant/
|
||||
include/PolicyKit/polkit-grant/polkit-grant.h
|
||||
include/PolicyKit/polkit/polkit-action.h
|
||||
include/PolicyKit/polkit/polkit-authorization-constraint.h
|
||||
include/PolicyKit/polkit/polkit-authorization-db.h
|
||||
include/PolicyKit/polkit/polkit-authorization.h
|
||||
include/PolicyKit/polkit/polkit-caller.h
|
||||
include/PolicyKit/polkit/polkit-config.h
|
||||
include/PolicyKit/polkit/polkit-context.h
|
||||
include/PolicyKit/polkit/polkit-error.h
|
||||
include/PolicyKit/polkit/polkit-policy-cache.h
|
||||
include/PolicyKit/polkit/polkit-policy-default.h
|
||||
include/PolicyKit/polkit/polkit-policy-file-entry.h
|
||||
include/PolicyKit/polkit/polkit-policy-file.h
|
||||
include/PolicyKit/polkit/polkit-result.h
|
||||
include/PolicyKit/polkit/polkit-seat.h
|
||||
include/PolicyKit/polkit/polkit-session.h
|
||||
include/PolicyKit/polkit/polkit-sysdeps.h
|
||||
include/PolicyKit/polkit/polkit-types.h
|
||||
include/PolicyKit/polkit/polkit.h
|
||||
lib/libpolkit-dbus.a
|
||||
lib/libpolkit-dbus.la
|
||||
lib/libpolkit-grant.a
|
||||
lib/libpolkit-grant.la
|
||||
lib/libpolkit.a
|
||||
lib/libpolkit.la
|
||||
lib/locale/
|
||||
lib/pkgconfig/
|
||||
lib/pkgconfig/polkit-dbus.pc
|
||||
lib/pkgconfig/polkit-grant.pc
|
||||
lib/pkgconfig/polkit.pc
|
||||
@mode 2755
|
||||
libexec/polkit-explicit-grant-helper
|
||||
libexec/polkit-grant-helper
|
||||
@mode
|
||||
@mode 4750
|
||||
libexec/polkit-grant-helper-bsdauth
|
||||
@mode
|
||||
@mode 2755
|
||||
libexec/polkit-read-auth-helper
|
||||
@mode
|
||||
@mode 4755
|
||||
libexec/polkit-resolve-exe-helper
|
||||
@mode
|
||||
@mode 2755
|
||||
libexec/polkit-revoke-helper
|
||||
@mode
|
||||
@mode 4755
|
||||
libexec/polkit-set-default-helper
|
||||
@mode
|
||||
@bin libexec/polkitd
|
||||
@man man/man1/polkit-action.1
|
||||
@man man/man1/polkit-auth.1
|
||||
@man man/man1/polkit-config-file-validate.1
|
||||
@man man/man1/polkit-policy-file-validate.1
|
||||
@man man/man5/PolicyKit.conf.5
|
||||
@man man/man8/PolicyKit.8
|
||||
share/PolicyKit/
|
||||
share/PolicyKit/config.dtd
|
||||
share/PolicyKit/policy/
|
||||
share/PolicyKit/policy/org.freedesktop.policykit.policy
|
||||
share/dbus-1/
|
||||
share/dbus-1/interfaces/
|
||||
share/dbus-1/interfaces/org.freedesktop.PolicyKit.AuthenticationAgent.xml
|
||||
share/dbus-1/system-services/
|
||||
share/dbus-1/system-services/org.freedesktop.PolicyKit.service
|
||||
share/examples/policykit/
|
||||
share/examples/policykit/PolicyKit/
|
||||
@sample ${SYSCONFDIR}/PolicyKit/
|
||||
share/examples/policykit/PolicyKit/PolicyKit.conf
|
||||
@sample ${SYSCONFDIR}/PolicyKit/PolicyKit.conf
|
||||
share/examples/policykit/dbus-1/
|
||||
@sample ${SYSCONFDIR}/dbus-1/
|
||||
share/examples/policykit/dbus-1/system.d/
|
||||
@sample ${SYSCONFDIR}/dbus-1/system.d/
|
||||
share/examples/policykit/dbus-1/system.d/org.freedesktop.PolicyKit.conf
|
||||
@sample ${SYSCONFDIR}/dbus-1/system.d/org.freedesktop.PolicyKit.conf
|
||||
share/examples/policykit/profile.d/
|
||||
share/examples/policykit/profile.d/polkit-bash-completion.sh
|
||||
share/gtk-doc/
|
||||
share/gtk-doc/html/
|
||||
share/gtk-doc/html/polkit/
|
||||
share/gtk-doc/html/polkit/PolicyKit.8.html
|
||||
share/gtk-doc/html/polkit/PolicyKit.conf.5.html
|
||||
share/gtk-doc/html/polkit/beyond-defaults.html
|
||||
share/gtk-doc/html/polkit/diagram-bus-model.png
|
||||
share/gtk-doc/html/polkit/diagram-interaction.png
|
||||
share/gtk-doc/html/polkit/home.png
|
||||
share/gtk-doc/html/polkit/index.html
|
||||
share/gtk-doc/html/polkit/index.sgml
|
||||
share/gtk-doc/html/polkit/intro-define-problem.html
|
||||
share/gtk-doc/html/polkit/introduction.html
|
||||
share/gtk-doc/html/polkit/ix01.html
|
||||
share/gtk-doc/html/polkit/ix02.html
|
||||
share/gtk-doc/html/polkit/ix03.html
|
||||
share/gtk-doc/html/polkit/ix04.html
|
||||
share/gtk-doc/html/polkit/left.png
|
||||
share/gtk-doc/html/polkit/license.html
|
||||
share/gtk-doc/html/polkit/model-authentication-agent.html
|
||||
share/gtk-doc/html/polkit/model-concepts.html
|
||||
share/gtk-doc/html/polkit/model-theory-of-operation.html
|
||||
share/gtk-doc/html/polkit/model.html
|
||||
share/gtk-doc/html/polkit/polkit-action.1.html
|
||||
share/gtk-doc/html/polkit/polkit-auth.1.html
|
||||
share/gtk-doc/html/polkit/polkit-conf.html
|
||||
share/gtk-doc/html/polkit/polkit-config-file-validate.1.html
|
||||
share/gtk-doc/html/polkit/polkit-policy-file-validate.1.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-action.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-authorization-constraint.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-authorization-db.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-authorization.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-caller.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-config.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-context.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-dbus.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-error.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-grant.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-policy-cache.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-policy-default.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-policy-file-entry.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-policy-file.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-result.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-seat.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-session.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-simple.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-sysdeps.html
|
||||
share/gtk-doc/html/polkit/polkit-polkit-types.html
|
||||
share/gtk-doc/html/polkit/polkit-spec-history.html
|
||||
share/gtk-doc/html/polkit/polkit.devhelp
|
||||
share/gtk-doc/html/polkit/polkit.devhelp2
|
||||
share/gtk-doc/html/polkit/ref-core.html
|
||||
share/gtk-doc/html/polkit/ref-design.html
|
||||
share/gtk-doc/html/polkit/right.png
|
||||
share/gtk-doc/html/polkit/style.css
|
||||
share/gtk-doc/html/polkit/tools-fileformats.html
|
||||
share/gtk-doc/html/polkit/up.png
|
||||
var/
|
||||
var/lib/
|
||||
var/lib/PolicyKit/
|
||||
var/lib/PolicyKit-public/
|
||||
var/lib/misc/
|
||||
var/lib/misc/PolicyKit.reload
|
||||
var/run/
|
||||
var/run/PolicyKit/
|
||||
@exec ${PREFIX}/bin/dbus-uuidgen --ensure
|
Loading…
Reference in New Issue
Block a user