Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=3b45c90149e360492307281b574b87a9c928f754

commit 3b45c90149e360492307281b574b87a9c928f754
Author: Michel Hermier <herm...@frugalware.org>
Date:   Tue Nov 19 00:05:52 2013 +0100

cmake: Add FAKEROOT_PROOF option to replace --enable-fakeroot.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c93c1ba..9c3f833 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,6 +16,7 @@ string (REPLACE ";" "" PM_VERSION ${PM_VERSION_TEMP})
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -D_GNU_SOURCE")

option(DISABLE_BINDING "disables all libpacman bindings" OFF)
+option(FAKEROOT_PROOF "enable fakeroot proof protection" OFF)

SET(ENABLE_NLS TRUE CACHE BOOL "Translation program messages to the user's 
native language ?")

diff --git a/cmake_config.h b/cmake_config.h
index 170e289..1211b39 100644
--- a/cmake_config.h
+++ b/cmake_config.h
@@ -111,3 +111,5 @@
/* Version number of package */
#define VERSION "@PACMAN_G2_VERSION@"

+/* Define fakeroot protection */
+#cmakedefine FAKEROOT_PROOF 1
diff --git a/lib/libpacman/handle.c b/lib/libpacman/handle.c
index 44a09ad..0f320d9 100644
--- a/lib/libpacman/handle.c
+++ b/lib/libpacman/handle.c
@@ -59,7 +59,7 @@ pmhandle_t *_pacman_handle_new()
#ifndef CYGWIN
/* see if we're root or not */
ph->uid = geteuid();
-#ifndef FAKEROOT
+#ifdef FAKEROOT_PROOF
if(!ph->uid && getenv("FAKEROOTKEY")) {
/* fakeroot doesn't count, we're non-root */
ph->uid = 99;
@@ -67,7 +67,7 @@ pmhandle_t *_pacman_handle_new()
#endif

/* see if we're root or not (fakeroot does not count) */
-#ifndef FAKEROOT
+#ifdef FAKEROOT_PROOF
if(ph->uid == 0 && !getenv("FAKEROOTKEY")) {
#else
if(ph->uid == 0) {
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to