PolicyKit: Branch 'master'
David Zeuthen
david at kemper.freedesktop.org
Sun Dec 16 20:04:28 PST 2007
configure.in | 9 ++++++++-
src/polkit-grant/Makefile.am | 19 +++++++++++++++++++
src/polkit-grant/polkit-grant-helper.c | 7 +++++++
3 files changed, 34 insertions(+), 1 deletion(-)
New commits:
commit ba2003a9492a7ef1fabcb6ae7997cfc8e5f15adf
Author: Carlos Corbacho <carlos at strangeworlds.co.uk>
Date: Sun Dec 16 22:59:30 2007 -0500
add Shadow authentication framework
Add Piter PUNK's polkit-grant-helper-shadow, and link against the
appropriate libraries.
For now, the Shadow framework must be explictily called - in future,
this could also be added as a fallback if PAM is not available.
diff --git a/configure.in b/configure.in
index a33767a..2fdb935 100644
--- a/configure.in
+++ b/configure.in
@@ -290,7 +290,7 @@ dnl ---------------------------------------------------------------------------
AC_ARG_WITH([authfw],
AS_HELP_STRING([--with-authfw=<name>],
- [Authentication framework (none/pam)]))
+ [Authentication framework (none/pam/shadow)]))
if ! test -z "$with_authfw" ; then
if test x$with_authdb = xdummy ; then
if ! test x$with_authfw = xnone ; then
@@ -324,6 +324,12 @@ case $POLKIT_AUTHFW in
AC_DEFINE(POLKIT_AUTHFW_PAM, 1, [If using the PAM authentication framework])
;;
+ shadow)
+ need_pam=no
+ AUTH_LIBS="${AUTH_LIBS} -lcrypt"
+ AC_DEFINE(POLKIT_AUTHFW_SHADOW, 1, [If using the Shadow authentication framework])
+ ;;
+
*)
AC_MSG_ERROR([Unknown Authentication Framework: $POLKIT_AUTHFW])
;;
@@ -331,6 +337,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])
dnl ---------------------------------------------------------------------------
diff --git a/src/polkit-grant/Makefile.am b/src/polkit-grant/Makefile.am
index 2616f7a..e786fdb 100644
--- a/src/polkit-grant/Makefile.am
+++ b/src/polkit-grant/Makefile.am
@@ -47,6 +47,10 @@ if POLKIT_AUTHFW_PAM
libexec_PROGRAMS += polkit-grant-helper-pam
endif
+if POLKIT_AUTHFW_SHADOW
+libexec_PROGRAMS += polkit-grant-helper-shadow
+endif
+
libexec_PROGRAMS += polkit-explicit-grant-helper polkit-revoke-helper
polkit_grant_helper_SOURCES = polkit-grant-helper.c
@@ -57,6 +61,11 @@ polkit_grant_helper_pam_SOURCES = polkit-grant-helper-pam.c
polkit_grant_helper_pam_LDADD = @AUTH_LIBS@
endif
+if POLKIT_AUTHFW_SHADOW
+polkit_grant_helper_shadow_SOURCES = polkit-grant-helper-shadow.c
+polkit_grant_helper_shadow_LDADD = @AUTH_LIBS@
+endif
+
polkit_explicit_grant_helper_SOURCES = polkit-explicit-grant-helper.c
polkit_explicit_grant_helper_CFLAGS = @DBUS_CFLAGS@
polkit_explicit_grant_helper_LDADD = $(top_builddir)/src/polkit/libpolkit.la $(top_builddir)/src/polkit-dbus/libpolkit-dbus.la libpolkit-grant.la
@@ -89,6 +98,10 @@ if POLKIT_AUTHFW_PAM
-chgrp $(POLKIT_GROUP) $(DESTDIR)$(libexecdir)/polkit-grant-helper-pam
-chmod 4754 $(DESTDIR)$(libexecdir)/polkit-grant-helper-pam
endif
+if POLKIT_AUTHFW_SHADOW
+ -chgrp $(POLKIT_GROUP) $(DESTDIR)$(libexecdir)/polkit-grant-helper-shadow
+ -chmod 4750 $(DESTDIR)$(libexecdir)/polkit-grant-helper-shadow
+endif
-chgrp $(POLKIT_GROUP) $(DESTDIR)$(libexecdir)/polkit-explicit-grant-helper
-chmod 2755 $(DESTDIR)$(libexecdir)/polkit-explicit-grant-helper
-chgrp $(POLKIT_GROUP) $(DESTDIR)$(libexecdir)/polkit-revoke-helper
@@ -124,6 +137,9 @@ if POLKIT_AUTHDB_DEFAULT
if POLKIT_AUTHFW_PAM
echo src/polkit-grant/polkit-grant-helper-pam.c >> covered-files.txt
endif
+if POLKIT_AUTHFW_SHADOW
+ echo src/polkit-grant/polkit-grant-helper-shadow.c >> covered-files.txt
+endif
echo src/polkit-grant/polkit-revoke-helper.c >> covered-files.txt
endif
@@ -135,6 +151,9 @@ if POLKIT_AUTHDB_DEFAULT
if POLKIT_AUTHFW_PAM
gcov polkit-grant-helper-pam.c -o .libs/ > /dev/null
endif
+if POLKIT_AUTHFW_SHADOW
+ gcov polkit-grant-helper-shadow.c -o .libs/ > /dev/null
+endif
gcov polkit-revoke-helper.c -o .libs/ > /dev/null
endif
$(top_srcdir)/test/create-coverage-report.sh "module polkit-grant" `cat covered-files.txt` > coverage-report.txt
diff --git a/src/polkit-grant/polkit-grant-helper.c b/src/polkit-grant/polkit-grant-helper.c
index 84462a9..fbf6769 100644
--- a/src/polkit-grant/polkit-grant-helper.c
+++ b/src/polkit-grant/polkit-grant-helper.c
@@ -44,6 +44,10 @@
#include <security/pam_appl.h>
#endif
+#ifdef POLKIT_AUTHFW_SHADOW
+#include <shadow.h>
+#endif
+
#include <grp.h>
#include <pwd.h>
#include <syslog.h>
@@ -170,6 +174,9 @@ do_auth (const char *user_to_auth, gboolean *empty_conversation)
#ifdef POLKIT_AUTHFW_PAM
char *helper_argv[2] = {PACKAGE_LIBEXEC_DIR "/polkit-grant-helper-pam", NULL};
#endif
+#ifdef POLKIT_AUTHFW_SHADOW
+ char *helper_argv[2] = {PACKAGE_LIBEXEC_DIR "/polkit-grant-helper-shadow", NULL};
+#endif
char buf[256];
FILE *child_stdin;
FILE *child_stdout;
More information about the hal-commit
mailing list