Merry Christmas Dean!
I have used chmod 755 and 777 on the signup-list1.cgi script plus chmod 755 and 777 on the cgi-bin. I think that's what you are asking me to do.
Also, I removed the /usr/bin/perl from inside the ".forward" file leaving the following "| /home/domain.net/public_html/cgi-bin/signup-list1.cgi" inside the .forward file.
A space between the pipe and the path doesn't seem to make any difference,i.e. "| /path/to/signup-list1.cgi" or "|/path/to/signup-list1.cgi" both work when selinux is turned off. Is a space between the pipe symbol and the path incorrect?
Removal of the /usr/bin/perl in forward file returns the following error message:
Command died with status 1: "
/home/domain.net/public_html/cgi-bin/signup-list1.cgi"
The error_log says the following:
local[3965]: fatal: execvp /home/domain.net/public_html/cgi-bin/signup-list1.cgi: Permission denied
postfix/smtpd[3962]: disconnect from
postfix/local[3964]: 5428E4FD: to=<support@domain.net>, relay=local, delay=1, status=bounced (Command died with status 1: " /home/domain.net/public_html/cgi-bin/signup-list1.cgi")
The
message log reveals the following message:
kernel: audit(1166996009.315:18): avc: denied { getattr } for pid=3962 comm="smtpd" name="/" dev=hda1 ino=2 scontext=system_u:system_r:postfix_smtpd_t tcontext=system_u:object_r:boot_t tclass=dir
kernel: audit(1166996009.315:19): avc: denied { getattr } for pid=3962 comm="smtpd" name="/" dev=hda2 ino=2 scontext=system_u:system_r:postfix_smtpd_t tcontext=system_u:object_r:home_root_t tclass=dir
kernel: audit(1166996009.387:20): avc: denied { search } for pid=3965 comm="local" name="domain.net" dev=hda2 ino=1505 scontext=system_u:system_r:postfix_local_t tcontext=system_u:object_r:httpd_sys_content_t tclass=dir
I think that the audit daemon in the message log reveals what's wrong,i.e. getattr for pid denied instead of granted. However, I have the correct extended attributes applied to the cgi script and the cgi-bin, ie chcon system_u:object_r:httpd_sys_script_exec_t -R cgi-bin
When I turn off selinux using setenforce=0 everything works, i.e. signup is successful and get a welcome message.
Do you know anyone who could help me with this selinux policy attribute permission problem? I am willing to pay someone to help me with this. All of the attacks have wasted precious years of hard work and the black hats will take me out of the ball game sooner or later again if I turn selinux off.
Kind regards,
Frank Eckdall
P.D. I should add that I can run a simple test.cgi from the browser that reveals the message "Success!", even with selinux turned on. I hope that helps. Here is the code for the test.cgi that works with security enhanced linux turned on. Using
http://domain.net/cgi-bin/test.cgi#!/usr/bin/perl
# CGI Script "test.cgi"
print qq(
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html">
<title>Linux Home Networking</title>
</head>
<body>
Success!
</body>
</html>