Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 46772 - Added UserDir detection
Summary: Added UserDir detection
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: High minor (vote)
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-04 09:17 UTC by Jaromir Malenko
Modified: 2004-04-15 06:52 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaromir Malenko 2004-04-04 09:17:06 UTC
The UserDir must be hard-wired into suexec of apache during compile.
This is usualy predefined to public_html, but some can use another directory name (I prefer WWW). This is usualy set immediately after installing apache and never changes. Now the default value (public_html) is used in ebuild. I changed one line to detect this automaticaly from apache config.

Reproducible: Always
Steps to Reproduce:
Comment 1 Jaromir Malenko 2004-04-04 09:17:41 UTC
Here is the patch.

--- /root/apache-2.0.49-orig.ebuild     2004-04-03 09:37:46.000000000 +0200
+++ apache-2.0.49.ebuild        2004-04-04 17:21:21.000000000 +0200
@@ -168,7 +168,7 @@
                --with-suexec-safepath="/usr/local/bin:/usr/bin:/bin" \
                --with-suexec-logfile=/var/log/apache2/suexec_log \
                --with-suexec-bin=/usr/sbin/suexec2 \
-               --with-suexec-userdir=public_html \
+               --with-suexec-userdir=`sed -n 's/^[ \t]*UserDir[ \t][ \t]*//p' /etc/apache2/conf/commonapache2.conf` \
                --with-suexec-caller=apache \
                --with-suexec-docroot=/var/www \
                --with-suexec-uidmin=1000 \
Comment 2 Jaromir Malenko 2004-04-05 06:59:45 UTC
Even better implementation with a reasonable default in case we cannot detect the UserDir value.

--- /usr/portage/net-www/apache/apache-2.0.49.ebuild    2004-04-03 09:37:46.000000000 +0200
+++ apache-2.0.49.ebuild        2004-04-05 15:56:45.755564464 +0200
@@ -163,12 +163,14 @@
        CXXFLAGS="`echo ${CXXFLAGS} | xargs`"
        LDFLAGS="`echo ${LDFLAGS} | xargs`"

+       USERDIR=`sed -n 's/^[ \t]*UserDir[ \t][ \t]*//p' /etc/apache2/conf/commonapache2.conf 2>/dev/null | head -n 1`
+       echo UserDir set to ${USERDIR:=public_html}
        SSL_BASE="SYSTEM" \
        ./configure \
                --with-suexec-safepath="/usr/local/bin:/usr/bin:/bin" \
                --with-suexec-logfile=/var/log/apache2/suexec_log \
                --with-suexec-bin=/usr/sbin/suexec2 \
-               --with-suexec-userdir=public_html \
+               --with-suexec-userdir=${USERDIR} \
                --with-suexec-caller=apache \
                --with-suexec-docroot=/var/www \
                --with-suexec-uidmin=1000 \
Comment 3 Stuart Herbert (RETIRED) gentoo-dev 2004-04-05 12:55:34 UTC
I'd rather we move variables like this out into a separate configuration file, that can be shared between ebuilds at install time, and daemons at runtime.

What do you think?

Stu
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-04-05 13:15:49 UTC
I agree with stuart, take a look at my app-admin/amanda ebuilds as an interesting example of stored config.
Comment 5 Stuart Herbert (RETIRED) gentoo-dev 2004-04-05 14:16:19 UTC
It's also that some of these variables are going to overlap between the webservers (apache, ncsa, cherokee et al) and the GLEP #11 tools (webapp-config and vhost-config).  I think we should be careful, and make sure that what we do here isn't just for Apache.

Best regards,
Stu
Comment 6 Jaromir Malenko 2004-04-06 15:30:13 UTC
It is i good idea. You, as the gentoo developers, must make the decision how it will be implemented.

Until you decide you could put this workaround to the ebuild.
Comment 7 Chuck Short (RETIRED) gentoo-dev 2004-04-08 05:50:43 UTC
This will probably be integrated into -r1 this weekend.
Comment 8 Chuck Short (RETIRED) gentoo-dev 2004-04-15 06:52:24 UTC
This has been added to 2.0.49-r1. Thanks for the idea and bug report.