Page MenuHomeFreeBSD

www/obhttpd: Apply FreeBSD-specific fixes.
AbandonedPublic

Authored by jrm on Feb 17 2017, 1:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 24, 2:20 AM
Unknown Object (File)
Sun, Apr 7, 4:31 PM
Unknown Object (File)
Feb 8 2024, 11:38 PM
Unknown Object (File)
Dec 20 2023, 5:39 AM
Unknown Object (File)
Nov 26 2023, 8:25 PM
Unknown Object (File)
Nov 13 2023, 1:31 PM
Unknown Object (File)
Nov 13 2023, 11:34 AM
Unknown Object (File)
Nov 9 2023, 6:19 AM

Details

Reviewers
swills
AMDmi3
Summary

www/obhttpd: Apply FreeBSD-specific fixes.

  • The default chroot directory is the home directory of the www user. On OpenBSD, this is /var/www, but on FreeBSD the www user's home directory is nonexistent. Patch, so that the default chroot directory, when none is supplied in the configuration file, is ${WWWDIR}.
  • Patch the obhttpd.conf.5 man page so that it refers the correct default configuration file location and other file locations under ${PREFIX}, and the correct default chroot directory.
  • Since the porter renamed the FreeBSD version of OpenBSD's httpd to obhttpd and renamed the man pages to obhttpd.x, use that name in the man pages.
  • Create directories that are expected when alternatives are not specified in the configuration files: ${WWWDIR}/{cgi-bin,htdocs,logs,/run}.
  • Out of the box, obhttpd fails to start with the sample/default configuration file. Comment out non-essential parts of the sample configuration file, so the web server successfully starts by default.
Test Plan

portlint -C: OK
testport: OK (poudriere: 10.3-RELEASE-p10)
testport: OK (poudriere: 10.3-RELEASE-p10)
testport: OK (poudriere: 11.0-RELEASE-p1)
testport: OK (poudriere: 11.0-RELEASE-p1)

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 7522
Build 7680: arc lint + arc unit

Event Timeline

jrm retitled this revision from to www/obhttpd: Apply FreeBSD-specific fixes..
jrm updated this object.
jrm edited the test plan for this revision. (Show Details)
jrm added reviewers: swills, AMDmi3.
jrm added subscribers: koue_chaosophia.net, tobik.

Hi Joseph,

As I mention in the previous review I'm not agree with few changes.

  • Chroot directory can be specified in the configuration file. If its configurable then there is no need to change the source code. First is much more flexible to change the configuration file and second less changes in the original code make it easier to maintain. I think the right way is to add 'chroot "%%WWWDIR%%' in the example configuration file.
  • I'm OK with changes in the man pages and additional directories in pkg-plist
  • Configuration file is just a sample, it's not default. There is no need httpd to start out of the box without editing the configuration file. %%WWWDIR%% is default document root for other web servers too. Listing files by default for example can cause security problems. And there is no need to change the path to the configuration file. As you can see in the 'files/obhttpd.in' 'obhttpd_flags=${obhttpd_flags:-"-f %%PREFIX%%/etc/obhttpd.conf"}' already exists. Lets keep to the options avoid hardcoded changes in the source.

Regards,
Nikola

Yeah, I would rather the example configuration is installed as-is in ${EXAMPLESDIR}

No problem. I will allow you to proceed with these as you see fit.