From de3412fa05001d14135f62699af28c934fb680b3 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Fri, 29 Nov 2013 21:23:56 +0100 Subject: www-apache/mod_ruid2: Apply patches from pull request https://github.com/mind04/mod-ruid2/pull/4 Package-Manager: portage-2.2.7 --- www-apache/mod_ruid2/ChangeLog | 14 ++ www-apache/mod_ruid2/Manifest | 16 +- ...Switch-to-default-UID-GID-when-UID-GID-is.patch | 46 ++++ ...make-RGroups-working-in-mode-stat-not-onl.patch | 57 +++++ ...dd-all-RGroups-even-when-when-group-is-no.patch | 31 +++ ...OR-Add-a-proper-Makefile-to-build-project.patch | 216 +++++++++++++++++++ www-apache/mod_ruid2/files/0.9.8-Makefile.patch | 214 ------------------- ...Switch-to-default-UID-GID-when-UID-GID-is.patch | 46 ++++ ...make-RGroups-working-in-mode-stat-not-onl.patch | 61 ++++++ ...dd-all-RGroups-even-when-when-group-is-no.patch | 31 +++ ...OR-Add-a-proper-Makefile-to-build-project.patch | 237 +++++++++++++++++++++ www-apache/mod_ruid2/files/9999-Makefile.patch | 215 ------------------- www-apache/mod_ruid2/mod_ruid2-0.9.8.ebuild | 5 +- www-apache/mod_ruid2/mod_ruid2-9999.ebuild | 5 +- 14 files changed, 758 insertions(+), 436 deletions(-) create mode 100644 www-apache/mod_ruid2/files/0.9.8-BUG-MEDIUM-Switch-to-default-UID-GID-when-UID-GID-is.patch create mode 100644 www-apache/mod_ruid2/files/0.9.8-BUG-MEDIUM-make-RGroups-working-in-mode-stat-not-onl.patch create mode 100644 www-apache/mod_ruid2/files/0.9.8-BUG-MINOR-Add-all-RGroups-even-when-when-group-is-no.patch create mode 100644 www-apache/mod_ruid2/files/0.9.8-MINOR-Add-a-proper-Makefile-to-build-project.patch delete mode 100644 www-apache/mod_ruid2/files/0.9.8-Makefile.patch create mode 100644 www-apache/mod_ruid2/files/9999-BUG-MEDIUM-Switch-to-default-UID-GID-when-UID-GID-is.patch create mode 100644 www-apache/mod_ruid2/files/9999-BUG-MEDIUM-make-RGroups-working-in-mode-stat-not-onl.patch create mode 100644 www-apache/mod_ruid2/files/9999-BUG-MINOR-Add-all-RGroups-even-when-when-group-is-no.patch create mode 100644 www-apache/mod_ruid2/files/9999-MINOR-Add-a-proper-Makefile-to-build-project.patch delete mode 100644 www-apache/mod_ruid2/files/9999-Makefile.patch (limited to 'www-apache') diff --git a/www-apache/mod_ruid2/ChangeLog b/www-apache/mod_ruid2/ChangeLog index 4a6a2406..28c9ed4b 100644 --- a/www-apache/mod_ruid2/ChangeLog +++ b/www-apache/mod_ruid2/ChangeLog @@ -2,6 +2,20 @@ # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 29 Nov 2013; Bertrand Jacquin + +files/0.9.8-BUG-MEDIUM-Switch-to-default-UID-GID-when-UID-GID-is.patch, + +files/0.9.8-BUG-MEDIUM-make-RGroups-working-in-mode-stat-not-onl.patch, + +files/0.9.8-BUG-MINOR-Add-all-RGroups-even-when-when-group-is-no.patch, + +files/0.9.8-MINOR-Add-a-proper-Makefile-to-build-project.patch, + +files/9999-BUG-MEDIUM-Switch-to-default-UID-GID-when-UID-GID-is.patch, + +files/9999-BUG-MEDIUM-make-RGroups-working-in-mode-stat-not-onl.patch, + +files/9999-BUG-MINOR-Add-all-RGroups-even-when-when-group-is-no.patch, + +files/9999-MINOR-Add-a-proper-Makefile-to-build-project.patch, + -files/0.9.8-Makefile.patch, -files/9999-Makefile.patch, + mod_ruid2-0.9.8.ebuild, mod_ruid2-9999.ebuild: + www-apache/mod_ruid2: Apply patches from pull request + https://github.com/mind04/mod-ruid2/pull/4 + 27 Nov 2013; Bertrand Jacquin +files/9999-Makefile.patch, mod_ruid2-9999.ebuild: www-apache/mod_ruid2: Use upstream URL, add patch for Makefile diff --git a/www-apache/mod_ruid2/Manifest b/www-apache/mod_ruid2/Manifest index 494f7c68..a4acd492 100644 --- a/www-apache/mod_ruid2/Manifest +++ b/www-apache/mod_ruid2/Manifest @@ -1,7 +1,13 @@ -AUX 0.9.8-Makefile.patch 4716 SHA256 755c7aeec21bf7eba8fd8bcadee091b24acf0c52288c533a63ba594535bf0dc9 WHIRLPOOL 1a7d9bcf2a9e76daa7fbd2f7673c061cf0200987583d1f61485c2f0effc78c28772c9a76f059f467aa0acadcbc09b7124e5433488f4f02f3da81d219aa190286 -AUX 9999-Makefile.patch 4752 SHA256 31e9ead1367bd92ac4f6fc6629aa75c2229bdbcde670265f6c0b809fa348d516 WHIRLPOOL 0abcbab7ed967b3bddd35b3abd23d68034145e2db7f60a6aad06127cc06cc962d7a943248bdf439d2685cb7f57d904bddb9483406f38ae5cc9a4787847828a95 +AUX 0.9.8-BUG-MEDIUM-Switch-to-default-UID-GID-when-UID-GID-is.patch 1411 SHA256 187b40043017ada89d2bff7cae05859548b1ffe65170c63a983cb698f23aa32d WHIRLPOOL 7f238d3d92269f05062f75c06d8f38f90fe2e71ea930c4be0d7139cd874b0f21f180adf8facc159b085db91830b2452e16a8a173ae66e61b32f1178c5eec3557 +AUX 0.9.8-BUG-MEDIUM-make-RGroups-working-in-mode-stat-not-onl.patch 1848 SHA256 dd772ad58b7332053c11b3006803fc66d9c1a269b77cafc67abe86242a52c106 WHIRLPOOL 86b09c72bd3a197ab94fd1fc17c4caa4f85b4fb07c378dbfd6e87a66e47e461fd64916e4c39948aa75d8fd4752083abc83a63a667a6e280cda11760ee31774d8 +AUX 0.9.8-BUG-MINOR-Add-all-RGroups-even-when-when-group-is-no.patch 955 SHA256 63da29b14fdedb30021988cff64c0a16ebe98bbf1bdc553b574fbe3ced429cbb WHIRLPOOL 56fe5d5eaffcdc46baa78dcf9428a5f259e7f09ece2dfc814bb76042c1288a22726ae48437df3990706052d20688dceeed64d3c51cda23776194810a9d3bf68e +AUX 0.9.8-MINOR-Add-a-proper-Makefile-to-build-project.patch 4777 SHA256 5fff97e3db025987a56b0fc8e52f951c163f9dae1300a3a763eb9da4f5b8abd5 WHIRLPOOL d8e28d666d81055c14d9e7fca63b204afb7f0651a96a8ecf3df4692b7d1bfd1c693bc594e683cf4666ae592c66945bc6c4cfad3f4a3dcb844134c33311c5c3c3 +AUX 9999-BUG-MEDIUM-Switch-to-default-UID-GID-when-UID-GID-is.patch 1411 SHA256 6b185e063d0f4495f3b460b36dfa766d0f7c90ddef1acf77da368b636714b933 WHIRLPOOL 7228c74bc2157b5f67a79b3c153e55917e39f5324525636ff63b8579ebcf837d22613da1871eb09ac1c7e4340f2860f55f8c2ceb2ce1eba79d3d78f3f6518662 +AUX 9999-BUG-MEDIUM-make-RGroups-working-in-mode-stat-not-onl.patch 1987 SHA256 fb108513c401008624fad56e06b9de6d0080782a61fd92016be34790d48e1e14 WHIRLPOOL 1377d2655e380ba3f8679d4a227642c4f6cfa9ad37040758775c205a9cd645261076aa432cd4b60c0963f0e5f97df611f28ba782aec08ab0729574de35da4f84 +AUX 9999-BUG-MINOR-Add-all-RGroups-even-when-when-group-is-no.patch 955 SHA256 8345e360155bcb04df448b467f6f00a762a7e711d1a89280b7fd98d5d1232d72 WHIRLPOOL f530b668f09b668f89503119a538026dc740896a927a8257e0f71605a688ed29cd82fdcba27a76bacf77113098731cb0a2abf11787be5aec16febbe1c27db0ad +AUX 9999-MINOR-Add-a-proper-Makefile-to-build-project.patch 5081 SHA256 5ff0835e7e424a53beda00fe6f82219840a0861f2f15f34c68f187cc44916e5f WHIRLPOOL 1c1dff2cd18b1c2ff2e92a75a8b662ee7facc59435f7dc932ce11c19b8478bb018e62bfd261b837d840a1dbed3132842b07bfcbad61cfff59f08d423a0ae13b6 DIST mod_ruid2-0.9.8.tar.gz 16383 SHA256 7db4e2c5edc2db1aaef20ddde11e695911d7ffb818e382989d0db39900d440d4 WHIRLPOOL d22c0f2aa9d708651f841c8c8597f74d31b168bf4f8612d429edc2539b1456ef1d35c96db15dfc377e9627aa290f51d9d41067d95f752c50e4c1ead139d4d943 -EBUILD mod_ruid2-0.9.8.ebuild 700 SHA256 292df25e74b0e153f4cc682c0fd384d458c2069695a28a39f1d10b6357535862 WHIRLPOOL 67560b28d5ee6a0d916443cdede1d75802aaa608873b2bf05c4822485ad80e05e8375ef72beeb054d93b282e174d0a2e7e2a37e5f9aaaca2937b30ef4aca0d3c -EBUILD mod_ruid2-9999.ebuild 666 SHA256 e3dcff8ec7d25d78e7a57badeed5d005568f65678e991d2448a199725befa93c WHIRLPOOL e9a18d8c472e891dda837ad8a631798bd8b7f941ee49c8b24133a702a749e499ab86c98597217f8a07e89682c96d9353338f6d09a74d0c7404b644aca43a1360 -MISC ChangeLog 1683 SHA256 7fdc4c0121ed52003cee785b16e3246f3d453b0244a9ea8c8dd2db1aa18f64f6 WHIRLPOOL af723cb18e0929acfc10411e17fcf11a393e879b5f67adadbe7cc0aa462030b42b71b375d14e167aa95fac1e87992d3cb2b05dc19fbd76d834d5b6476a1a0b37 +EBUILD mod_ruid2-0.9.8.ebuild 997 SHA256 b6337a19add45ee2b81e3043a0074d7d88dc672bebba6ab9c53b1cf0d2b44787 WHIRLPOOL 01dd16f27e7c0ec49b8d13faa91d0a10eb7a597bb153ab49f0d401d42ac5a45b971661213142d7ac32cbdb196a892470d092d26663ed3ddc7f8ef1d07d3f4a6d +EBUILD mod_ruid2-9999.ebuild 963 SHA256 99a374b626574556346af2576b5eb7f5b47829856802f83b857fa434ba2d67cb WHIRLPOOL a3c2738aa2f1b289d9e7b91825ec7956a6c4feefe4036937cf7877621d13e044282b9b4bd6b587c625aea55148d7a07f5772f0ea0242ac73d1dba243e3c773cc +MISC ChangeLog 2526 SHA256 1c5b475402a626b5357e0bd35834acde78fa4e1228c4ae3cfde80935d0753ecb WHIRLPOOL ec5e0c4114339a41b965cebc94ee3d8b42437586015e4e062bcc672cfdd77657d186dc972f14aa8d95517d7b85c8b457789bd13b17e58d6fb361aa7babc55dcd MISC metadata.xml 254 SHA256 c56bc3d6780712c960298c70bb86867aeb6661e97a317cc624516b0e16b72fcc WHIRLPOOL 2ebbfaa14ef0c1847284fe64a79f052cd7e73b25a724fba728c084aaaf2dd0692e068eedcf42ccef7e205077f00c35780ded7ec69118dc01ddb988b4802e46ae diff --git a/www-apache/mod_ruid2/files/0.9.8-BUG-MEDIUM-Switch-to-default-UID-GID-when-UID-GID-is.patch b/www-apache/mod_ruid2/files/0.9.8-BUG-MEDIUM-Switch-to-default-UID-GID-when-UID-GID-is.patch new file mode 100644 index 00000000..46edeea8 --- /dev/null +++ b/www-apache/mod_ruid2/files/0.9.8-BUG-MEDIUM-Switch-to-default-UID-GID-when-UID-GID-is.patch @@ -0,0 +1,46 @@ +From 5e4d4b1dcc02e3acdcccba86e80f8babc9e2bfd7 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Thu, 28 Nov 2013 00:06:32 +0100 +Subject: [PATCH] BUG/MEDIUM: Switch to default UID/GID when UID/GID is + inferior than RDefaultUidGid only for RMode stat + +Signed-off-by: Bertrand Jacquin +--- + mod_ruid2.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/mod_ruid2.c b/mod_ruid2.c +index 1e151aa..d9c6385 100644 +--- a/mod_ruid2.c ++++ b/mod_ruid2.c +@@ -483,19 +483,19 @@ static int ruid_set_perm (request_rec *r, const char *from_func) + */ + gid=r->finfo.group; + uid=r->finfo.user; ++ ++ /* if uid of filename is less than conf->min_uid then set to conf->default_uid */ ++ if (uid < conf->min_uid) { ++ uid=conf->default_uid; ++ } ++ if (gid < conf->min_gid) { ++ gid=conf->default_gid; ++ } + } else { + gid=(dconf->ruid_gid == UNSET) ? ap_unixd_config.group_id : dconf->ruid_gid; + uid=(dconf->ruid_uid == UNSET) ? ap_unixd_config.user_id : dconf->ruid_uid; + } + +- /* if uid of filename is less than conf->min_uid then set to conf->default_uid */ +- if (uid < conf->min_uid) { +- uid=conf->default_uid; +- } +- if (gid < conf->min_gid) { +- gid=conf->default_gid; +- } +- + /* set supplementary groups */ + if ((dconf->groupsnr == UNSET) && (startup_groupsnr > 0)) { + memcpy(groups, startup_groups, sizeof(groups)); +-- +1.8.4.4 + diff --git a/www-apache/mod_ruid2/files/0.9.8-BUG-MEDIUM-make-RGroups-working-in-mode-stat-not-onl.patch b/www-apache/mod_ruid2/files/0.9.8-BUG-MEDIUM-make-RGroups-working-in-mode-stat-not-onl.patch new file mode 100644 index 00000000..d57f2e15 --- /dev/null +++ b/www-apache/mod_ruid2/files/0.9.8-BUG-MEDIUM-make-RGroups-working-in-mode-stat-not-onl.patch @@ -0,0 +1,57 @@ +From 2eb8bec2045211e954a7cf879c91099c0c63916a Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Wed, 27 Nov 2013 22:36:21 +0100 +Subject: [PATCH] BUG/MEDIUM: make RGroups working in mode stat, not only + config mode + +Also copy the Rgroups from parent to child when merging configurations. + +That kind of configuration was broken : + + + DocumentRoot /var/www/localhost/htdocs + + RMode stat + RGroups nogroup + RMinUidGid #1000 #1000 + RDefaultUidGid apache apache + + +Signed-off-by: Bertrand Jacquin +--- + mod_ruid2.c | 19 ++++++++++--------- + 1 file changed, 10 insertions(+), 9 deletions(-) + +diff --git a/mod_ruid2.c b/mod_ruid2.c +index 9b72370..b510f73 100644 +--- a/mod_ruid2.c ++++ b/mod_ruid2.c +@@ -144,15 +144,16 @@ static void *merge_dir_config(apr_pool_t *p, void *base, void *overrides) + } else { + conf->ruid_uid = (child->ruid_uid == UNSET) ? parent->ruid_uid : child->ruid_uid; + conf->ruid_gid = (child->ruid_gid == UNSET) ? parent->ruid_gid : child->ruid_gid; +- if (child->groupsnr > 0) { +- memcpy(conf->groups, child->groups, sizeof(child->groups)); +- conf->groupsnr = child->groupsnr; +- } else if (parent->groupsnr > 0) { +- memcpy(conf->groups, parent->groups, sizeof(parent->groups)); +- conf->groupsnr = parent->groupsnr; +- } else { +- conf->groupsnr = (child->groupsnr == UNSET) ? parent->groupsnr : child->groupsnr; +- } ++ } ++ ++ if (child->groupsnr > 0) { ++ memcpy(conf->groups, child->groups, sizeof(child->groups)); ++ conf->groupsnr = child->groupsnr; ++ } else if (parent->groupsnr > 0) { ++ memcpy(conf->groups, parent->groups, sizeof(parent->groups)); ++ conf->groupsnr = parent->groupsnr; ++ } else { ++ conf->groupsnr = (child->groupsnr == UNSET) ? parent->groupsnr : child->groupsnr; + } + + return conf; +-- +1.8.4.4 + diff --git a/www-apache/mod_ruid2/files/0.9.8-BUG-MINOR-Add-all-RGroups-even-when-when-group-is-no.patch b/www-apache/mod_ruid2/files/0.9.8-BUG-MINOR-Add-all-RGroups-even-when-when-group-is-no.patch new file mode 100644 index 00000000..02afb4bc --- /dev/null +++ b/www-apache/mod_ruid2/files/0.9.8-BUG-MINOR-Add-all-RGroups-even-when-when-group-is-no.patch @@ -0,0 +1,31 @@ +From 613cc77a173fd10ce9fab15543667382f079f6f5 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Wed, 27 Nov 2013 22:36:21 +0100 +Subject: [PATCH] BUG/MINOR: Add all RGroups, even when when group is not + matching MIN_GID + +Signed-off-by: Bertrand Jacquin +--- + mod_ruid2.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/mod_ruid2.c b/mod_ruid2.c +index b510f73..1e151aa 100644 +--- a/mod_ruid2.c ++++ b/mod_ruid2.c +@@ -502,11 +502,7 @@ static int ruid_set_perm (request_rec *r, const char *from_func) + groupsnr = startup_groupsnr; + } else if (dconf->groupsnr > 0) { + for (groupsnr = 0; groupsnr < dconf->groupsnr; groupsnr++) { +- if (dconf->groups[groupsnr] >= conf->min_gid) { +- groups[groupsnr] = dconf->groups[groupsnr]; +- } else { +- groups[groupsnr] = conf->default_gid; +- } ++ groups[groupsnr] = dconf->groups[groupsnr]; + } + } else { + groupsnr = 0; +-- +1.8.4.4 + diff --git a/www-apache/mod_ruid2/files/0.9.8-MINOR-Add-a-proper-Makefile-to-build-project.patch b/www-apache/mod_ruid2/files/0.9.8-MINOR-Add-a-proper-Makefile-to-build-project.patch new file mode 100644 index 00000000..215633ca --- /dev/null +++ b/www-apache/mod_ruid2/files/0.9.8-MINOR-Add-a-proper-Makefile-to-build-project.patch @@ -0,0 +1,216 @@ +From 792f553b2be8769790f8734e2ac8310afeadf9ab Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Wed, 19 Dec 2012 15:01:45 +0100 +Subject: [PATCH] MINOR: Add a proper Makefile to build project. + +Inspired from mod_virtualvalue + +Also, don't make reference to any version in code or elsewhere, this now +come from git describe and CFLAGS definition + +Build the project (one of) : + $ make + $ make shared + $ make all + CC mod_ruid2.o + CC mod_ruid2.so + +Build with verbose output : + $ make V=1 +cc -c -DMODULE_NAME='"mod_ruid2"' -DMODULE_VERSION='"v0.9.8-6-g20ec6cc-dev"' -fPIC -I/usr/include/apache2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apr-1 -W -Wall -o mod_ruid2.o mod_ruid2.c +ld -shared -o mod_ruid2.so mod_ruid2.o -lapr-1 -luuid -lrt -lcrypt -lpthread -ldl -lcap + +Build with specific CFLAGS and CC : + $ make CC=i586-pc-linux-gnu-gcc CFLAGS='-march=geode -Os -mmmx -m3dnow -I/data/cross/alix3-i586/firmware/usr/include' + +In this case default one (-fPIC is alway applied). + +Strip library : + $ make strip + STRIP mod_ruid2.so + +Build a tar for public release : + $ make dist + TAR mod_ruid2-v0.9.8-6-g20ec6cc-dev.tar + XZ mod_ruid2-v0.9.8-6-g20ec6cc-dev.txz + +Signed-off-by: Bertrand Jacquin +--- + Makefile | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + mod_ruid2.c | 7 +--- + 2 files changed, 135 insertions(+), 6 deletions(-) + create mode 100644 Makefile + +diff --git a/Makefile b/Makefile +new file mode 100644 +index 0000000..98413a6 +--- /dev/null ++++ b/Makefile +@@ -0,0 +1,134 @@ ++#!/usr/bin/make -f < ++# ++# Copyright (C) 2013 Bertrand Jacquin ++ ++NAME = mod_ruid2 ++VERSION = $(shell git describe --tags --dirty=-dev 2> /dev/null) ++ ++SRC = \ ++ mod_ruid2.c ++ ++DOC_FILES = \ ++ README \ ++ ruid2.conf ++ ++EXTRA_FILES = \ ++ LICENSE \ ++ Makefile ++ ++PKG_CONFIG ?= pkg-config ++ ++APR_CFLAGS = \ ++ $(shell $(PKG_CONFIG) --cflags apr-1) ++ ++APR_LDFLAGS = \ ++ $(shell $(PKG_CONFIG) --libs apr-1) ++ ++HTTPD_CFLAGS = \ ++ -I/usr/include/apache2 ++ ++CAP_LDFLAGS = \ ++ -lcap ++ ++CFLAGS ?= \ ++ -W -Wall ++ ++SPEC_CFLAGS = \ ++ -DMODULE_NAME='"$(NAME)"' \ ++ -DMODULE_VERSION='"$(VERSION)"' \ ++ -fPIC \ ++ $(HTTPD_CFLAGS) \ ++ $(APR_CFLAGS) \ ++ $(CAP_CFLAGS) ++ ++SPEC_LDFLAGS = \ ++ $(HTTPD_LDFLAGS) \ ++ $(APR_LDFLAGS) \ ++ $(CAP_LDFLAGS) ++ ++ifdef DEBUG ++SPEC_CFLAGS +=\ ++ -DDEBUG \ ++ -g -ggdb ++endif # DEBUG ++ ++CC ?= cc ++ ++STRIP ?= strip ++STRIP_FLAGS ?= --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.build-id ++ ++INSTALL ?= install ++ ++RM ?= rm -f ++ ++TAR = tar ++XZ = xz ++ ++DESTDIR ?= ++PREFIX ?= /usr/local ++MODDIR ?= $(PREFIX)/lib/apache2/modules ++DOCDIR ?= $(PREFIX)/share/doc/$(NAME) ++ ++ifeq ($(V),) ++ Q = @ ++ ++ quiet_cmd = @printf " %-6s %s\n" "$(1)" "$(2)"; ++endif # $(V) ++ ++all: shared ++ ++shared: $(NAME).so ++dist: $(NAME)-$(VERSION).txz ++ ++# Build rules ++%.o: %.c ++ $(call quiet_cmd,CC,$@) ++ $(Q)$(CC) -c $(SPEC_CFLAGS) $(CFLAGS) -o $@ $< ++ ++$(NAME).so: $(SRC:c=o) ++ $(call quiet_cmd,CC,$@) ++ $(Q)$(CC) -shared -o $@ $^ $(SPEC_LDFLAGS) $(LDFLAGS) ++ ++strip: $(NAME).so ++ $(call quiet_cmd,STRIP,$<) ++ $(Q)$(STRIP) $(STRIP_FLAGS) $< ++ ++# Archiving rules ++$(NAME)-$(VERSION).tar: $(SRC) $(EXTRA_FILES) $(DOC_FILES) ++ $(call quiet_cmd,TAR,$@) ++ $(Q)$(TAR) cf $@ \ ++ --transform "s,^,$(NAME)-$(VERSION)/," \ ++ --force-local --numeric-owner \ ++ $^ ++ ++%.txz: %.tar ++ $(call quiet_cmd,XZ,$@) ++ $(Q)$(XZ) -c > $@ < $< ++ ++# Install rules ++install: \ ++ $(DESTDIR)$(MODDIR)/$(NAME).so \ ++ $(addprefix $(DESTDIR)$(DOCDIR)/,$(DOC_FILES)) ++ ++$(DESTDIR)$(MODDIR)/$(NAME).so: $(NAME).so ++ $(call quiet_cmd,INSTALL,$@) ++ $(Q)$(INSTALL) -D -m 444 $< $@ ++ ++$(DESTDIR)$(DOCDIR)/%: % ++ $(call quiet_cmd,INSTALL,$@) ++ $(Q)$(INSTALL) -D -m 444 $< $@ ++ ++# Cleanup rules ++clean: ++ $(call quiet_cmd,RM,$(SRC:c=o)) ++ $(Q)$(RM) $(SRC:c=o) ++ $(call quiet_cmd,RM,$(NAME).so) ++ $(Q)$(RM) $(NAME).so ++ ++distclean: clean ++ $(call quiet_cmd,RM,$(NAME)-$(VERSION).tar) ++ $(Q)$(RM) $(NAME)-$(VERSION).tar ++ $(call quiet_cmd,RM,$(NAME)-$(VERSION).txz) ++ $(Q)$(RM) $(NAME)-$(VERSION).txz ++ ++.PHONY: strip +diff --git a/mod_ruid2.c b/mod_ruid2.c +index ad1ae8f..9b72370 100644 +--- a/mod_ruid2.c ++++ b/mod_ruid2.c +@@ -1,5 +1,5 @@ + /* +- mod_ruid2 0.9.8 ++ mod_ruid2 + Copyright (C) 2009-2013 Monshouwer Internet Diensten + + Author: Kees Monshouwer +@@ -22,8 +22,6 @@ + - mod_ruid - http://websupport.sk/~stanojr/projects/mod_ruid/ + Copyright 2004 by Pavel Stano. All rights reserved + +- Instalation: +- - /usr/apache/bin/apxs -a -i -l cap -c mod_ruid2.c + */ + + #include "ap_release.h" +@@ -47,9 +45,6 @@ + #include + #include + +-#define MODULE_NAME "mod_ruid2" +-#define MODULE_VERSION "0.9.8" +- + #define RUID_MIN_UID 100 + #define RUID_MIN_GID 100 + +-- +1.8.4.4 + diff --git a/www-apache/mod_ruid2/files/0.9.8-Makefile.patch b/www-apache/mod_ruid2/files/0.9.8-Makefile.patch deleted file mode 100644 index 8b9e89cd..00000000 --- a/www-apache/mod_ruid2/files/0.9.8-Makefile.patch +++ /dev/null @@ -1,214 +0,0 @@ -From 80dc741c052a2d4d05220c85de583c31d6ec518a Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Wed, 19 Dec 2012 15:01:45 +0100 -Subject: [PATCH] Add a proper Makefile to build project. - -Inspired from mod_virtualvalue - -Also, don't make reference to any version in code or elsewhere, this now -come from git describe and CFLAGS definition - -Build the project (one of) : - $ make - $ make shared - $ make all - CC mod_ruid2.o - CC mod_ruid2.so - -Build with verbose output : - $ make V=1 -cc -c -DMODULE_NAME='"mod_ruid2"' -DMODULE_VERSION='"v0.9.8-6-g20ec6cc-dev"' -fPIC -I/usr/include/apache2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apr-1 -W -Wall -o mod_ruid2.o mod_ruid2.c -ld -shared -o mod_ruid2.so mod_ruid2.o -lapr-1 -luuid -lrt -lcrypt -lpthread -ldl -lcap - -Build with specific CFLAGS and CC : - $ make CC=i586-pc-linux-gnu-gcc CFLAGS='-march=geode -Os -mmmx -m3dnow -I/data/cross/alix3-i586/firmware/usr/include' - -In this case default one (-fPIC is alway applied). - -Strip library : - $ make strip - STRIP mod_ruid2.so - -Build a tar for public release : - $ make dist - TAR mod_ruid2-v0.9.8-6-g20ec6cc-dev.tar - XZ mod_ruid2-v0.9.8-6-g20ec6cc-dev.txz ---- - Makefile | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - mod_ruid2.c | 7 +--- - 2 files changed, 135 insertions(+), 6 deletions(-) - create mode 100644 Makefile - -diff --git a/Makefile b/Makefile -new file mode 100644 -index 0000000..98413a6 ---- /dev/null -+++ b/Makefile -@@ -0,0 +1,134 @@ -+#!/usr/bin/make -f < -+# -+# Copyright (C) 2013 Bertrand Jacquin -+ -+NAME = mod_ruid2 -+VERSION = $(shell git describe --tags --dirty=-dev 2> /dev/null) -+ -+SRC = \ -+ mod_ruid2.c -+ -+DOC_FILES = \ -+ README \ -+ ruid2.conf -+ -+EXTRA_FILES = \ -+ LICENSE \ -+ Makefile -+ -+PKG_CONFIG ?= pkg-config -+ -+APR_CFLAGS = \ -+ $(shell $(PKG_CONFIG) --cflags apr-1) -+ -+APR_LDFLAGS = \ -+ $(shell $(PKG_CONFIG) --libs apr-1) -+ -+HTTPD_CFLAGS = \ -+ -I/usr/include/apache2 -+ -+CAP_LDFLAGS = \ -+ -lcap -+ -+CFLAGS ?= \ -+ -W -Wall -+ -+SPEC_CFLAGS = \ -+ -DMODULE_NAME='"$(NAME)"' \ -+ -DMODULE_VERSION='"$(VERSION)"' \ -+ -fPIC \ -+ $(HTTPD_CFLAGS) \ -+ $(APR_CFLAGS) \ -+ $(CAP_CFLAGS) -+ -+SPEC_LDFLAGS = \ -+ $(HTTPD_LDFLAGS) \ -+ $(APR_LDFLAGS) \ -+ $(CAP_LDFLAGS) -+ -+ifdef DEBUG -+SPEC_CFLAGS +=\ -+ -DDEBUG \ -+ -g -ggdb -+endif # DEBUG -+ -+CC ?= cc -+ -+STRIP ?= strip -+STRIP_FLAGS ?= --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.build-id -+ -+INSTALL ?= install -+ -+RM ?= rm -f -+ -+TAR = tar -+XZ = xz -+ -+DESTDIR ?= -+PREFIX ?= /usr/local -+MODDIR ?= $(PREFIX)/lib/apache2/modules -+DOCDIR ?= $(PREFIX)/share/doc/$(NAME) -+ -+ifeq ($(V),) -+ Q = @ -+ -+ quiet_cmd = @printf " %-6s %s\n" "$(1)" "$(2)"; -+endif # $(V) -+ -+all: shared -+ -+shared: $(NAME).so -+dist: $(NAME)-$(VERSION).txz -+ -+# Build rules -+%.o: %.c -+ $(call quiet_cmd,CC,$@) -+ $(Q)$(CC) -c $(SPEC_CFLAGS) $(CFLAGS) -o $@ $< -+ -+$(NAME).so: $(SRC:c=o) -+ $(call quiet_cmd,CC,$@) -+ $(Q)$(CC) -shared -o $@ $^ $(SPEC_LDFLAGS) $(LDFLAGS) -+ -+strip: $(NAME).so -+ $(call quiet_cmd,STRIP,$<) -+ $(Q)$(STRIP) $(STRIP_FLAGS) $< -+ -+# Archiving rules -+$(NAME)-$(VERSION).tar: $(SRC) $(EXTRA_FILES) $(DOC_FILES) -+ $(call quiet_cmd,TAR,$@) -+ $(Q)$(TAR) cf $@ \ -+ --transform "s,^,$(NAME)-$(VERSION)/," \ -+ --force-local --numeric-owner \ -+ $^ -+ -+%.txz: %.tar -+ $(call quiet_cmd,XZ,$@) -+ $(Q)$(XZ) -c > $@ < $< -+ -+# Install rules -+install: \ -+ $(DESTDIR)$(MODDIR)/$(NAME).so \ -+ $(addprefix $(DESTDIR)$(DOCDIR)/,$(DOC_FILES)) -+ -+$(DESTDIR)$(MODDIR)/$(NAME).so: $(NAME).so -+ $(call quiet_cmd,INSTALL,$@) -+ $(Q)$(INSTALL) -D -m 444 $< $@ -+ -+$(DESTDIR)$(DOCDIR)/%: % -+ $(call quiet_cmd,INSTALL,$@) -+ $(Q)$(INSTALL) -D -m 444 $< $@ -+ -+# Cleanup rules -+clean: -+ $(call quiet_cmd,RM,$(SRC:c=o)) -+ $(Q)$(RM) $(SRC:c=o) -+ $(call quiet_cmd,RM,$(NAME).so) -+ $(Q)$(RM) $(NAME).so -+ -+distclean: clean -+ $(call quiet_cmd,RM,$(NAME)-$(VERSION).tar) -+ $(Q)$(RM) $(NAME)-$(VERSION).tar -+ $(call quiet_cmd,RM,$(NAME)-$(VERSION).txz) -+ $(Q)$(RM) $(NAME)-$(VERSION).txz -+ -+.PHONY: strip -diff --git a/mod_ruid2.c b/mod_ruid2.c -index ad1ae8f..9b72370 100644 ---- a/mod_ruid2.c -+++ b/mod_ruid2.c -@@ -1,5 +1,5 @@ - /* -- mod_ruid2 0.9.8 -+ mod_ruid2 - Copyright (C) 2009-2013 Monshouwer Internet Diensten - - Author: Kees Monshouwer -@@ -22,8 +22,6 @@ - - mod_ruid - http://websupport.sk/~stanojr/projects/mod_ruid/ - Copyright 2004 by Pavel Stano. All rights reserved - -- Instalation: -- - /usr/apache/bin/apxs -a -i -l cap -c mod_ruid2.c - */ - - #include "ap_release.h" -@@ -47,9 +45,6 @@ - #include - #include - --#define MODULE_NAME "mod_ruid2" --#define MODULE_VERSION "0.9.8" -- - #define RUID_MIN_UID 100 - #define RUID_MIN_GID 100 - --- -1.8.4.4 - diff --git a/www-apache/mod_ruid2/files/9999-BUG-MEDIUM-Switch-to-default-UID-GID-when-UID-GID-is.patch b/www-apache/mod_ruid2/files/9999-BUG-MEDIUM-Switch-to-default-UID-GID-when-UID-GID-is.patch new file mode 100644 index 00000000..5acc09b1 --- /dev/null +++ b/www-apache/mod_ruid2/files/9999-BUG-MEDIUM-Switch-to-default-UID-GID-when-UID-GID-is.patch @@ -0,0 +1,46 @@ +From 41c97df6fe3e25a8683852c7ae440e58fd51ca04 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Thu, 28 Nov 2013 00:06:32 +0100 +Subject: [PATCH] BUG/MEDIUM: Switch to default UID/GID when UID/GID is + inferior than RDefaultUidGid only for RMode stat + +Signed-off-by: Bertrand Jacquin +--- + mod_ruid2.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/mod_ruid2.c b/mod_ruid2.c +index 6767f55..7b10cee 100644 +--- a/mod_ruid2.c ++++ b/mod_ruid2.c +@@ -503,19 +503,19 @@ static int ruid_set_perm (request_rec *r, const char *from_func) + */ + gid=r->finfo.group; + uid=r->finfo.user; ++ ++ /* if uid of filename is less than conf->min_uid then set to conf->default_uid */ ++ if (uid < conf->min_uid) { ++ uid=conf->default_uid; ++ } ++ if (gid < conf->min_gid) { ++ gid=conf->default_gid; ++ } + } else { + gid=(dconf->ruid_gid == UNSET) ? ap_unixd_config.group_id : dconf->ruid_gid; + uid=(dconf->ruid_uid == UNSET) ? ap_unixd_config.user_id : dconf->ruid_uid; + } + +- /* if uid of filename is less than conf->min_uid then set to conf->default_uid */ +- if (uid < conf->min_uid) { +- uid=conf->default_uid; +- } +- if (gid < conf->min_gid) { +- gid=conf->default_gid; +- } +- + /* set supplementary groups */ + if ((dconf->groupsnr == UNSET) && (startup_groupsnr > 0)) { + memcpy(groups, startup_groups, sizeof(groups)); +-- +1.8.3.2 + diff --git a/www-apache/mod_ruid2/files/9999-BUG-MEDIUM-make-RGroups-working-in-mode-stat-not-onl.patch b/www-apache/mod_ruid2/files/9999-BUG-MEDIUM-make-RGroups-working-in-mode-stat-not-onl.patch new file mode 100644 index 00000000..b7f025c7 --- /dev/null +++ b/www-apache/mod_ruid2/files/9999-BUG-MEDIUM-make-RGroups-working-in-mode-stat-not-onl.patch @@ -0,0 +1,61 @@ +From f9e4934189a28ca8aee24868dbc59b4311c62af1 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Wed, 27 Nov 2013 22:11:42 +0100 +Subject: [PATCH] BUG/MEDIUM: make RGroups working in mode stat, not only + config mode + +Also copy the Rgroups from parent to child when merging configurations. + +That kind of configuration was broken : + + + DocumentRoot /var/www/localhost/htdocs + + RMode stat + RGroups nogroup + RMinUidGid #1000 #1000 + RDefaultUidGid apache apache + + +Signed-off-by: Bertrand Jacquin +--- + mod_ruid2.c | 23 ++++++++++++----------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +diff --git a/mod_ruid2.c b/mod_ruid2.c +index 96f7bcb..b374f3a 100644 +--- a/mod_ruid2.c ++++ b/mod_ruid2.c +@@ -148,17 +148,18 @@ static void *merge_dir_config(apr_pool_t *p, void *base, void *overrides) + } else { + conf->ruid_uid = (child->ruid_uid == UNSET) ? parent->ruid_uid : child->ruid_uid; + conf->ruid_gid = (child->ruid_gid == UNSET) ? parent->ruid_gid : child->ruid_gid; +- if (child->groupsnr == NONE) { +- conf->groupsnr = NONE; +- } else if (child->groupsnr > 0) { +- memcpy(conf->groups, child->groups, sizeof(child->groups)); +- conf->groupsnr = child->groupsnr; +- } else if (parent->groupsnr > 0) { +- memcpy(conf->groups, parent->groups, sizeof(parent->groups)); +- conf->groupsnr = parent->groupsnr; +- } else { +- conf->groupsnr = (child->groupsnr == UNSET) ? parent->groupsnr : child->groupsnr; +- } ++ } ++ ++ if (child->groupsnr == NONE) { ++ conf->groupsnr = NONE; ++ } else if (child->groupsnr > 0) { ++ memcpy(conf->groups, child->groups, sizeof(child->groups)); ++ conf->groupsnr = child->groupsnr; ++ } else if (parent->groupsnr > 0) { ++ memcpy(conf->groups, parent->groups, sizeof(parent->groups)); ++ conf->groupsnr = parent->groupsnr; ++ } else { ++ conf->groupsnr = (child->groupsnr == UNSET) ? parent->groupsnr : child->groupsnr; + } + + return conf; +-- +1.8.3.2 + diff --git a/www-apache/mod_ruid2/files/9999-BUG-MINOR-Add-all-RGroups-even-when-when-group-is-no.patch b/www-apache/mod_ruid2/files/9999-BUG-MINOR-Add-all-RGroups-even-when-when-group-is-no.patch new file mode 100644 index 00000000..f17f9977 --- /dev/null +++ b/www-apache/mod_ruid2/files/9999-BUG-MINOR-Add-all-RGroups-even-when-when-group-is-no.patch @@ -0,0 +1,31 @@ +From b32823c5844215886dc8f8f75d6d075fa3779c2c Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Wed, 27 Nov 2013 22:36:21 +0100 +Subject: [PATCH] BUG/MINOR: Add all RGroups, even when when group is not + matching MIN_GID + +Signed-off-by: Bertrand Jacquin +--- + mod_ruid2.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/mod_ruid2.c b/mod_ruid2.c +index b374f3a..6767f55 100644 +--- a/mod_ruid2.c ++++ b/mod_ruid2.c +@@ -522,11 +522,7 @@ static int ruid_set_perm (request_rec *r, const char *from_func) + groupsnr = startup_groupsnr; + } else if (dconf->groupsnr > 0) { + for (groupsnr = 0; groupsnr < dconf->groupsnr; groupsnr++) { +- if (dconf->groups[groupsnr] >= conf->min_gid) { +- groups[groupsnr] = dconf->groups[groupsnr]; +- } else { +- groups[groupsnr] = conf->default_gid; +- } ++ groups[groupsnr] = dconf->groups[groupsnr]; + } + } else { + groupsnr = 0; +-- +1.8.3.2 + diff --git a/www-apache/mod_ruid2/files/9999-MINOR-Add-a-proper-Makefile-to-build-project.patch b/www-apache/mod_ruid2/files/9999-MINOR-Add-a-proper-Makefile-to-build-project.patch new file mode 100644 index 00000000..ebcbe11f --- /dev/null +++ b/www-apache/mod_ruid2/files/9999-MINOR-Add-a-proper-Makefile-to-build-project.patch @@ -0,0 +1,237 @@ +From 2dfd5c93ca8df0c1c6e7d6b1e297aad0d033018d Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin +Date: Wed, 19 Dec 2012 15:01:45 +0100 +Subject: [PATCH] MINOR: Add a proper Makefile to build project. + +Inspired from mod_virtualvalue + +Also, don't make reference to any version in code or elsewhere, this now +come from git describe and CFLAGS definition + +Build the project (one of) : + $ make + $ make shared + $ make all + CC mod_ruid2.o + CC mod_ruid2.so + +Build with verbose output : + $ make V=1 +cc -c -DMODULE_NAME='"mod_ruid2"' -DMODULE_VERSION='"v0.9.8-6-g20ec6cc-dev"' -fPIC -I/usr/include/apache2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apr-1 -W -Wall -o mod_ruid2.o mod_ruid2.c +ld -shared -o mod_ruid2.so mod_ruid2.o -lapr-1 -luuid -lrt -lcrypt -lpthread -ldl -lcap + +Build with specific CFLAGS and CC : + $ make CC=i586-pc-linux-gnu-gcc CFLAGS='-march=geode -Os -mmmx -m3dnow -I/data/cross/alix3-i586/firmware/usr/include' + +In this case default one (-fPIC is alway applied). + +Strip library : + $ make strip + STRIP mod_ruid2.so + +Build a tar for public release : + $ make dist + TAR mod_ruid2-v0.9.8-6-g20ec6cc-dev.tar + XZ mod_ruid2-v0.9.8-6-g20ec6cc-dev.txz + +Signed-off-by: Bertrand Jacquin +--- + .gitignore | 13 ++++-- + Makefile | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + mod_ruid2.c | 8 +--- + 3 files changed, 144 insertions(+), 11 deletions(-) + create mode 100644 Makefile + +diff --git a/.gitignore b/.gitignore +index 6e04ee5..9257bbc 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -1,5 +1,10 @@ +-.libs/ +-*.la +-*.lo ++# Compilation results + *.o +-*.slo ++*.so ++ ++# Dist results ++*.tar ++*.txz ++ ++# Hacking results ++*.patch +diff --git a/Makefile b/Makefile +new file mode 100644 +index 0000000..98413a6 +--- /dev/null ++++ b/Makefile +@@ -0,0 +1,134 @@ ++#!/usr/bin/make -f < ++# ++# Copyright (C) 2013 Bertrand Jacquin ++ ++NAME = mod_ruid2 ++VERSION = $(shell git describe --tags --dirty=-dev 2> /dev/null) ++ ++SRC = \ ++ mod_ruid2.c ++ ++DOC_FILES = \ ++ README \ ++ ruid2.conf ++ ++EXTRA_FILES = \ ++ LICENSE \ ++ Makefile ++ ++PKG_CONFIG ?= pkg-config ++ ++APR_CFLAGS = \ ++ $(shell $(PKG_CONFIG) --cflags apr-1) ++ ++APR_LDFLAGS = \ ++ $(shell $(PKG_CONFIG) --libs apr-1) ++ ++HTTPD_CFLAGS = \ ++ -I/usr/include/apache2 ++ ++CAP_LDFLAGS = \ ++ -lcap ++ ++CFLAGS ?= \ ++ -W -Wall ++ ++SPEC_CFLAGS = \ ++ -DMODULE_NAME='"$(NAME)"' \ ++ -DMODULE_VERSION='"$(VERSION)"' \ ++ -fPIC \ ++ $(HTTPD_CFLAGS) \ ++ $(APR_CFLAGS) \ ++ $(CAP_CFLAGS) ++ ++SPEC_LDFLAGS = \ ++ $(HTTPD_LDFLAGS) \ ++ $(APR_LDFLAGS) \ ++ $(CAP_LDFLAGS) ++ ++ifdef DEBUG ++SPEC_CFLAGS +=\ ++ -DDEBUG \ ++ -g -ggdb ++endif # DEBUG ++ ++CC ?= cc ++ ++STRIP ?= strip ++STRIP_FLAGS ?= --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.build-id ++ ++INSTALL ?= install ++ ++RM ?= rm -f ++ ++TAR = tar ++XZ = xz ++ ++DESTDIR ?= ++PREFIX ?= /usr/local ++MODDIR ?= $(PREFIX)/lib/apache2/modules ++DOCDIR ?= $(PREFIX)/share/doc/$(NAME) ++ ++ifeq ($(V),) ++ Q = @ ++ ++ quiet_cmd = @printf " %-6s %s\n" "$(1)" "$(2)"; ++endif # $(V) ++ ++all: shared ++ ++shared: $(NAME).so ++dist: $(NAME)-$(VERSION).txz ++ ++# Build rules ++%.o: %.c ++ $(call quiet_cmd,CC,$@) ++ $(Q)$(CC) -c $(SPEC_CFLAGS) $(CFLAGS) -o $@ $< ++ ++$(NAME).so: $(SRC:c=o) ++ $(call quiet_cmd,CC,$@) ++ $(Q)$(CC) -shared -o $@ $^ $(SPEC_LDFLAGS) $(LDFLAGS) ++ ++strip: $(NAME).so ++ $(call quiet_cmd,STRIP,$<) ++ $(Q)$(STRIP) $(STRIP_FLAGS) $< ++ ++# Archiving rules ++$(NAME)-$(VERSION).tar: $(SRC) $(EXTRA_FILES) $(DOC_FILES) ++ $(call quiet_cmd,TAR,$@) ++ $(Q)$(TAR) cf $@ \ ++ --transform "s,^,$(NAME)-$(VERSION)/," \ ++ --force-local --numeric-owner \ ++ $^ ++ ++%.txz: %.tar ++ $(call quiet_cmd,XZ,$@) ++ $(Q)$(XZ) -c > $@ < $< ++ ++# Install rules ++install: \ ++ $(DESTDIR)$(MODDIR)/$(NAME).so \ ++ $(addprefix $(DESTDIR)$(DOCDIR)/,$(DOC_FILES)) ++ ++$(DESTDIR)$(MODDIR)/$(NAME).so: $(NAME).so ++ $(call quiet_cmd,INSTALL,$@) ++ $(Q)$(INSTALL) -D -m 444 $< $@ ++ ++$(DESTDIR)$(DOCDIR)/%: % ++ $(call quiet_cmd,INSTALL,$@) ++ $(Q)$(INSTALL) -D -m 444 $< $@ ++ ++# Cleanup rules ++clean: ++ $(call quiet_cmd,RM,$(SRC:c=o)) ++ $(Q)$(RM) $(SRC:c=o) ++ $(call quiet_cmd,RM,$(NAME).so) ++ $(Q)$(RM) $(NAME).so ++ ++distclean: clean ++ $(call quiet_cmd,RM,$(NAME)-$(VERSION).tar) ++ $(Q)$(RM) $(NAME)-$(VERSION).tar ++ $(call quiet_cmd,RM,$(NAME)-$(VERSION).txz) ++ $(Q)$(RM) $(NAME)-$(VERSION).txz ++ ++.PHONY: strip +diff --git a/mod_ruid2.c b/mod_ruid2.c +index 30d81b2..96f7bcb 100644 +--- a/mod_ruid2.c ++++ b/mod_ruid2.c +@@ -1,5 +1,5 @@ + /* +- mod_ruid2 0.9.8 ++ mod_ruid2 + Copyright (C) 2009-2013 Monshouwer Internet Diensten + + Author: Kees Monshouwer +@@ -22,9 +22,6 @@ + - mod_ruid - http://websupport.sk/~stanojr/projects/mod_ruid/ + Copyright 2004 by Pavel Stano. All rights reserved + +- Instalation: +- - /usr/apache/bin/apxs -a -i -l cap -c mod_ruid2.c +- + Issues: + - https://github.com/mind04/mod-ruid2/issues + */ +@@ -50,9 +47,6 @@ + #include + #include + +-#define MODULE_NAME "mod_ruid2" +-#define MODULE_VERSION "0.9.8" +- + #define RUID_MIN_UID 100 + #define RUID_MIN_GID 100 + +-- +1.8.3.2 + diff --git a/www-apache/mod_ruid2/files/9999-Makefile.patch b/www-apache/mod_ruid2/files/9999-Makefile.patch deleted file mode 100644 index d95005f2..00000000 --- a/www-apache/mod_ruid2/files/9999-Makefile.patch +++ /dev/null @@ -1,215 +0,0 @@ -From bdf2787529a18f9c9090335011e232eeb0bc616d Mon Sep 17 00:00:00 2001 -From: Bertrand Jacquin -Date: Wed, 19 Dec 2012 15:01:45 +0100 -Subject: [PATCH] Add a proper Makefile to build project. - -Inspired from mod_virtualvalue - -Also, don't make reference to any version in code or elsewhere, this now -come from git describe and CFLAGS definition - -Build the project (one of) : - $ make - $ make shared - $ make all - CC mod_ruid2.o - CC mod_ruid2.so - -Build with verbose output : - $ make V=1 -cc -c -DMODULE_NAME='"mod_ruid2"' -DMODULE_VERSION='"v0.9.8-6-g20ec6cc-dev"' -fPIC -I/usr/include/apache2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apr-1 -W -Wall -o mod_ruid2.o mod_ruid2.c -ld -shared -o mod_ruid2.so mod_ruid2.o -lapr-1 -luuid -lrt -lcrypt -lpthread -ldl -lcap - -Build with specific CFLAGS and CC : - $ make CC=i586-pc-linux-gnu-gcc CFLAGS='-march=geode -Os -mmmx -m3dnow -I/data/cross/alix3-i586/firmware/usr/include' - -In this case default one (-fPIC is alway applied). - -Strip library : - $ make strip - STRIP mod_ruid2.so - -Build a tar for public release : - $ make dist - TAR mod_ruid2-v0.9.8-6-g20ec6cc-dev.tar - XZ mod_ruid2-v0.9.8-6-g20ec6cc-dev.txz ---- - Makefile | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - mod_ruid2.c | 8 +--- - 2 files changed, 135 insertions(+), 7 deletions(-) - create mode 100644 Makefile - -diff --git a/Makefile b/Makefile -new file mode 100644 -index 0000000..98413a6 ---- /dev/null -+++ b/Makefile -@@ -0,0 +1,134 @@ -+#!/usr/bin/make -f < -+# -+# Copyright (C) 2013 Bertrand Jacquin -+ -+NAME = mod_ruid2 -+VERSION = $(shell git describe --tags --dirty=-dev 2> /dev/null) -+ -+SRC = \ -+ mod_ruid2.c -+ -+DOC_FILES = \ -+ README \ -+ ruid2.conf -+ -+EXTRA_FILES = \ -+ LICENSE \ -+ Makefile -+ -+PKG_CONFIG ?= pkg-config -+ -+APR_CFLAGS = \ -+ $(shell $(PKG_CONFIG) --cflags apr-1) -+ -+APR_LDFLAGS = \ -+ $(shell $(PKG_CONFIG) --libs apr-1) -+ -+HTTPD_CFLAGS = \ -+ -I/usr/include/apache2 -+ -+CAP_LDFLAGS = \ -+ -lcap -+ -+CFLAGS ?= \ -+ -W -Wall -+ -+SPEC_CFLAGS = \ -+ -DMODULE_NAME='"$(NAME)"' \ -+ -DMODULE_VERSION='"$(VERSION)"' \ -+ -fPIC \ -+ $(HTTPD_CFLAGS) \ -+ $(APR_CFLAGS) \ -+ $(CAP_CFLAGS) -+ -+SPEC_LDFLAGS = \ -+ $(HTTPD_LDFLAGS) \ -+ $(APR_LDFLAGS) \ -+ $(CAP_LDFLAGS) -+ -+ifdef DEBUG -+SPEC_CFLAGS +=\ -+ -DDEBUG \ -+ -g -ggdb -+endif # DEBUG -+ -+CC ?= cc -+ -+STRIP ?= strip -+STRIP_FLAGS ?= --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.build-id -+ -+INSTALL ?= install -+ -+RM ?= rm -f -+ -+TAR = tar -+XZ = xz -+ -+DESTDIR ?= -+PREFIX ?= /usr/local -+MODDIR ?= $(PREFIX)/lib/apache2/modules -+DOCDIR ?= $(PREFIX)/share/doc/$(NAME) -+ -+ifeq ($(V),) -+ Q = @ -+ -+ quiet_cmd = @printf " %-6s %s\n" "$(1)" "$(2)"; -+endif # $(V) -+ -+all: shared -+ -+shared: $(NAME).so -+dist: $(NAME)-$(VERSION).txz -+ -+# Build rules -+%.o: %.c -+ $(call quiet_cmd,CC,$@) -+ $(Q)$(CC) -c $(SPEC_CFLAGS) $(CFLAGS) -o $@ $< -+ -+$(NAME).so: $(SRC:c=o) -+ $(call quiet_cmd,CC,$@) -+ $(Q)$(CC) -shared -o $@ $^ $(SPEC_LDFLAGS) $(LDFLAGS) -+ -+strip: $(NAME).so -+ $(call quiet_cmd,STRIP,$<) -+ $(Q)$(STRIP) $(STRIP_FLAGS) $< -+ -+# Archiving rules -+$(NAME)-$(VERSION).tar: $(SRC) $(EXTRA_FILES) $(DOC_FILES) -+ $(call quiet_cmd,TAR,$@) -+ $(Q)$(TAR) cf $@ \ -+ --transform "s,^,$(NAME)-$(VERSION)/," \ -+ --force-local --numeric-owner \ -+ $^ -+ -+%.txz: %.tar -+ $(call quiet_cmd,XZ,$@) -+ $(Q)$(XZ) -c > $@ < $< -+ -+# Install rules -+install: \ -+ $(DESTDIR)$(MODDIR)/$(NAME).so \ -+ $(addprefix $(DESTDIR)$(DOCDIR)/,$(DOC_FILES)) -+ -+$(DESTDIR)$(MODDIR)/$(NAME).so: $(NAME).so -+ $(call quiet_cmd,INSTALL,$@) -+ $(Q)$(INSTALL) -D -m 444 $< $@ -+ -+$(DESTDIR)$(DOCDIR)/%: % -+ $(call quiet_cmd,INSTALL,$@) -+ $(Q)$(INSTALL) -D -m 444 $< $@ -+ -+# Cleanup rules -+clean: -+ $(call quiet_cmd,RM,$(SRC:c=o)) -+ $(Q)$(RM) $(SRC:c=o) -+ $(call quiet_cmd,RM,$(NAME).so) -+ $(Q)$(RM) $(NAME).so -+ -+distclean: clean -+ $(call quiet_cmd,RM,$(NAME)-$(VERSION).tar) -+ $(Q)$(RM) $(NAME)-$(VERSION).tar -+ $(call quiet_cmd,RM,$(NAME)-$(VERSION).txz) -+ $(Q)$(RM) $(NAME)-$(VERSION).txz -+ -+.PHONY: strip -diff --git a/mod_ruid2.c b/mod_ruid2.c -index 30d81b2..96f7bcb 100644 ---- a/mod_ruid2.c -+++ b/mod_ruid2.c -@@ -1,5 +1,5 @@ - /* -- mod_ruid2 0.9.8 -+ mod_ruid2 - Copyright (C) 2009-2013 Monshouwer Internet Diensten - - Author: Kees Monshouwer -@@ -22,9 +22,6 @@ - - mod_ruid - http://websupport.sk/~stanojr/projects/mod_ruid/ - Copyright 2004 by Pavel Stano. All rights reserved - -- Instalation: -- - /usr/apache/bin/apxs -a -i -l cap -c mod_ruid2.c -- - Issues: - - https://github.com/mind04/mod-ruid2/issues - */ -@@ -50,9 +47,6 @@ - #include - #include - --#define MODULE_NAME "mod_ruid2" --#define MODULE_VERSION "0.9.8" -- - #define RUID_MIN_UID 100 - #define RUID_MIN_GID 100 - --- -1.8.4.4 - diff --git a/www-apache/mod_ruid2/mod_ruid2-0.9.8.ebuild b/www-apache/mod_ruid2/mod_ruid2-0.9.8.ebuild index 15715605..4a837efd 100644 --- a/www-apache/mod_ruid2/mod_ruid2-0.9.8.ebuild +++ b/www-apache/mod_ruid2/mod_ruid2-0.9.8.ebuild @@ -26,7 +26,10 @@ DOCFILES="README ruid2.conf" need_apache2 src_prepare() { - epatch "${FILESDIR}/${PV}-Makefile.patch" + epatch "${FILESDIR}/${PV}-MINOR-Add-a-proper-Makefile-to-build-project.patch" + epatch "${FILESDIR}/${PV}-BUG-MEDIUM-make-RGroups-working-in-mode-stat-not-onl.patch" + epatch "${FILESDIR}/${PV}-BUG-MINOR-Add-all-RGroups-even-when-when-group-is-no.patch" + epatch "${FILESDIR}/${PV}-BUG-MEDIUM-Switch-to-default-UID-GID-when-UID-GID-is.patch" } src_compile() { diff --git a/www-apache/mod_ruid2/mod_ruid2-9999.ebuild b/www-apache/mod_ruid2/mod_ruid2-9999.ebuild index 5edf93ea..af4131f0 100644 --- a/www-apache/mod_ruid2/mod_ruid2-9999.ebuild +++ b/www-apache/mod_ruid2/mod_ruid2-9999.ebuild @@ -24,7 +24,10 @@ DOCFILES="README ruid2.conf" need_apache2 src_prepare() { - epatch "${FILESDIR}/${PV}-Makefile.patch" + epatch "${FILESDIR}/${PV}-MINOR-Add-a-proper-Makefile-to-build-project.patch" + epatch "${FILESDIR}/${PV}-BUG-MEDIUM-make-RGroups-working-in-mode-stat-not-onl.patch" + epatch "${FILESDIR}/${PV}-BUG-MINOR-Add-all-RGroups-even-when-when-group-is-no.patch" + epatch "${FILESDIR}/${PV}-BUG-MEDIUM-Switch-to-default-UID-GID-when-UID-GID-is.patch" } src_compile() { -- cgit v1.2.3