dnl ==================================================
m4_define([LIBZYPP_MAJOR], [2])
dnl ==================================================
-m4_define([LIBZYPP_MINOR], [2])
+m4_define([LIBZYPP_MINOR], [3])
m4_define([LIBZYPP_COMPATMINOR], [2])
dnl ==================================================
-m4_define([LIBZYPP_PATCH], [3])
+m4_define([LIBZYPP_PATCH], [0])
dnl ==================================================
Group: System/Packages
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Autoreqprov: on
+PreReq: permissions
Summary: Package, Patch, Pattern, and Product Management
Version: @VERSION@
Release: 0
%post
%run_ldconfig
+%run_permissions
+
+%verifyscript
+%verify_permissions -e %{_sbindir}/zypp-checkpatches-wrapper
%postun
%run_ldconfig
%files -f zypp.lang
%defattr(-,root,root)
%{_bindir}/zypper
+%{_sbindir}/zypp-checkpatches
+%verify(not mode) %attr (4750,root,root) %{_sbindir}/zypp-checkpatches-wrapper
%dir %{_libdir}/libzypp*so.*
%dir %{prefix}/share/zypp
%{prefix}/share/zypp/*
-------------------------------------------------------------------
+Mon Oct 9 15:11:16 CEST 2006 - mvidner@suse.cz
+
+- Added zypp-checkpatches and a suid-root zypp-checkpatches-wrapper.
+
+-------------------------------------------------------------------
Fri Oct 6 13:23:32 CEST 2006 - schubi@suse.de
- select the best solution: prefering the total amount of install/update
## ##################################################
bin_PROGRAMS = zypper
-noinst_PROGRAMS = zmart zypp-checkpatches
+sbin_PROGRAMS = zypp-checkpatches zypp-checkpatches-wrapper
+noinst_PROGRAMS = zmart
## ##################################################
zmart-updates.cc \
zmart-updates.h \
checkpatches-keyring-callbacks.h
+
+zypp_checkpatches_wrapper_SOURCES = zypp-checkpatches-wrapper.c
+# empty:
+zypp_checkpatches_wrapper_LDADD =
+
#zmart_LDFLAGS = -static
.PHONY: always
--- /dev/null
+/* A setuid-root wrapper for zypp-checkpatches */
+
+/* clearenv */
+#include <stdlib.h>
+/* chdir, execl */
+#include <unistd.h>
+/* perror */
+#include <stdio.h>
+
+#define WRAPPER_ERROR 101
+
+const char *app = "/usr/sbin/zypp-checkpatches";
+
+int main (void) {
+ /* cd / to avoid NFS problems */
+ if (chdir ("/")) {
+ perror ("chdir");
+ return WRAPPER_ERROR;
+ }
+ /* do not look at argv... done */
+ /* clear environment */
+ if (clearenv ()) {
+ fprintf (stderr, "clearenv failed\n");
+ return WRAPPER_ERROR;
+ }
+ /* set minimal environment... done */
+ /* execute the real application */
+ execl (app, app, (char *) NULL);
+
+ /* if we are still here, it has failed */
+ perror ("exec");
+ return WRAPPER_ERROR;
+}