JR Dalrymple wrote:


Fresh install of 3.7 release, one user added and nosuid pulled from fstab entry for /var filesystem before reboot:

$ uname -a
OpenBSD stacy.jrssite.com 3.7 GENERIC#50 i386
$ su
Password:
stacy# pkg_add -v ftp://ftp3.usa.openbsd.org/pub/OpenBSD/3.7/packages/i386/openwebmail-2.51.tgz
<snip>
stacy# exit
$ cd /var/www/cgi-bin/openwebmail
$ ls -lF
total 2448
drwxr-xr-x  2 root  _mail     512 Jun 21 16:44 auth/
drwxr-xr-x  6 root  _mail     512 Jun 21 16:44 misc/
drwxr-xr-x  2 root  _mail     512 Jun 21 16:44 modules/
-r-sr-xr-x  1 276   _mail  264663 Mar 17 15:04 openwebmail-abook.pl*
-r-sr-xr-x  1 276   _mail   27911 Mar 17 15:04 openwebmail-advsearch.pl*
-r-sr-xr-x  1 276   _mail  114770 Mar 17 15:04 openwebmail-cal.pl*
-r-sr-xr-x  1 276   _mail   26033 Mar 17 15:04 openwebmail-folder.pl*
-r-sr-xr-x  1 276   _mail   70560 Mar 17 15:04 openwebmail-main.pl*
-r-sr-xr-x  1 276   _mail  139617 Mar 17 15:04 openwebmail-prefs.pl*
-r-sr-xr-x  1 276   _mail   76944 Mar 17 15:04 openwebmail-read.pl*
-r-sr-xr-x  1 276   _mail   23155 Mar 17 15:04 openwebmail-saprefs.pl*
-r-sr-xr-x  1 276   _mail  114738 Mar 17 15:04 openwebmail-send.pl*
-r-sr-xr-x  1 276   _mail   25166 Mar 17 15:04 openwebmail-spell.pl*
-r-sr-xr-x  1 276   _mail   58102 Mar 17 15:04 openwebmail-tool.pl*
-r-sr-xr-x  1 276   _mail   49130 Mar 17 15:04 openwebmail-vdomain.pl*
-r-sr-xr-x  1 276   _mail   19192 Mar 17 15:04 openwebmail-viewatt.pl*
-r-sr-xr-x  1 276   _mail  118571 Mar 17 15:04 openwebmail-webdisk.pl*
-r-sr-xr-x  1 276   _mail   35830 Mar 17 15:04 openwebmail.pl*
-rwxr-xr-x  1 276   _mail    4855 Jan 28 22:11 preload.pl*
drwxr-xr-x  2 root  _mail     512 Jun 21 16:45 quota/
drwxr-xr-x  2 root  _mail     512 Jun 21 16:45 shares/
-rwxr-xr-x  1 276   _mail    4105 Jan 28 22:20 userstat.pl*
-rwxr-xr-x  1 276   _mail   19301 Jan 28 22:11 vacation.pl*
$ perl ./openwebmail.pl
Content-type: text/html

'./openwebmail.pl' must setuid to root$ su
Password:
stacy# apachectl start
stacy#

<try to log in over http, get 500 error>

cat /var/www/logs/error_log
[Tue Jun 21 17:25:38 2005] [error] (2)No such file or directory: exec of /cgi-bin/openwebmail/openwebmail.pl failed [Tue Jun 21 17:25:38 2005] [error] [client 192.168.0.4] Premature end of script headers: /cgi-bin/openwebmail/openwebmail.pl
stacy#


By default Apache is chroot'ed to /var/www
OpenWebmail needs access outside of /var/www specifically /var/mail and user home directories.
Don't run apache chroot.
see the -u option in the httpd man page and /etc/rc.conf

In the above directory listing who is user 276? The Owner should be root.

So now I rebuild perl with suidperl support, or how to make this work? I don't read on google, OpenBSD forums, or OWM forums where that anyone else has any trouble with the package so I figured it "just worked", but am really feeling like a total idiot here.

No you don't need to rebuild perl

There are user _mail problems with the 3.6 port inside of the perl scripts but these were fixed for the 3.7 port. I run OpenWebMail under 3.6 for a client, but haven't looked at upgrading thier installation to 3.7 yet. If the package is installing the files as user 276 then something is wrong with the port for 3.7.

the following is a directoy listing from the 3.6 installation.

fragile:ianm {103} ls -al /var/www/cgi-bin/openwebmail/
total 1812
drwxr-xr-x  7 root  daemon    1024 Mar 16 01:22 .
drwxr-xr-x  3 root  daemon     512 Mar 16 01:22 ..
drwxr-xr-x  2 root  daemon     512 Mar 16 01:22 auth
drwxr-xr-x  2 root  daemon     512 Mar 16 01:22 modules
-r-sr-xr-x  1 root  _mail    38190 Feb 14 22:17 openwebmail-abook.pl
-r-sr-xr-x  1 root  _mail    24199 Feb 14 22:17 openwebmail-advsearch.pl
-r-sr-xr-x  1 root  _mail   112394 Feb 14 22:17 openwebmail-cal.pl
-r-sr-xr-x  1 root  _mail    23017 Feb 14 22:17 openwebmail-folder.pl
-r-sr-xr-x  1 root  _mail    62906 Feb 14 22:17 openwebmail-main.pl
-r-sr-xr-x  1 root  _mail   127566 Feb 14 22:17 openwebmail-prefs.pl
-r-sr-xr-x  1 root  _mail    61647 Feb 14 22:17 openwebmail-read.pl
-r-sr-xr-x  1 root  _mail   105376 Feb 14 22:17 openwebmail-send.pl
-r-sr-xr-x  1 root  _mail    24732 Feb 14 22:17 openwebmail-spell.pl
-r-sr-xr-x  1 root  _mail    52307 Feb 14 22:17 openwebmail-tool.pl
-r-sr-xr-x  1 root  _mail    48638 Feb 14 22:17 openwebmail-vdomain.pl
-r-sr-xr-x  1 root  _mail    18628 Feb 14 22:17 openwebmail-viewatt.pl
-r-sr-xr-x  1 root  _mail   109783 Feb 14 22:17 openwebmail-webdisk.pl
-r-sr-xr-x  1 root  _mail    31335 Feb 14 22:17 openwebmail.pl
-rwxr-xr-x  1 root  wheel     4756 Apr 12  2004 preload.pl
drwxr-xr-x  2 root  daemon     512 Mar 16 01:22 quota
drwxr-xr-x  2 root  daemon     512 Mar 16 01:22 shares
-rwxr-xr-x  1 root  wheel     4151 May  8  2004 userstat.pl
drwxr-xr-x  2 root  daemon    1024 Mar 16 01:22 uty
-rwxr-xr-x  1 root  wheel    18228 Apr 12  2004 vacation.pl

Thanks again for your help.

Ian McWilliam

Reply via email to