Hey,
I was trying to wrap several of the Mailman CLI tools (list_lists and such) in a little PHP so I could easily integrate them into a larger web site. Using PHP's System() function and the backtick operator to exec the Mailman tools never seems to result in any output, but no errors either. However, I can drop a script of my own (a little Perl hack or whatever) in the ~mailman/bin directory with the same ownership and permissions, and it seems to exec just fine.
Any idea what I'm overlooking?
- H
--
Harold Paulson Sierra Web Design haroldp@sierraweb.com http://www.sierraweb.com VOICE: 775.833.9500 FAX: 810.314.1517
You may want to check for things such as PATH information as it could be that when executing the script it can't find python executable. One possible idea is try executing your command in a fasion like:
system("myprogram arg1 arg2 2>&1");
This may help by showing any output that gets sent to stderr on stdout.
Chris Ryan chris@greatbridge.com
Harold Paulson wrote:
Hey,
I was trying to wrap several of the Mailman CLI tools (list_lists and such) in a little PHP so I could easily integrate them into a larger web site. Using PHP's System() function and the backtick operator to exec the Mailman tools never seems to result in any output, but no errors either. However, I can drop a script of my own (a little Perl hack or whatever) in the ~mailman/bin directory with the same ownership and permissions, and it seems to exec just fine.
Any idea what I'm overlooking?
- H
--
Harold Paulson Sierra Web Design haroldp@sierraweb.com http://www.sierraweb.com VOICE: 775.833.9500 FAX: 810.314.1517
Mailman-Developers mailing list Mailman-Developers@python.org http://mail.python.org/mailman/listinfo/mailman-developers
Good suggestions,
You may want to check for things such as PATH information as it could be that when executing the script it can't find python executable. One
$PATH did include the directory where the python bin was stored, and actually specifying a full path like:
`/usr/local/bin/python /home/mailman/bin/list_lists`
still doesn't give me any output.
possible idea is try executing your command in a fasion like:
system("myprogram arg1 arg2 2>&1");
This may help by showing any output that gets sent to stderr on stdout.
Even better suggestion! This gives me:
Traceback (most recent call last): File "/usr/local/mailman/bin/list_lists", line 108, in ? main() File "/usr/local/mailman/bin/list_lists", line 86, in main mlist = MailList.MailList(n, lock=0) File "../Mailman/MailList.py", line 79, in __init__ File "../Mailman/MailList.py", line 879, in Load File "../Mailman/MailList.py", line 856, in __load IOError: [Errno 13] Permission denied: '/usr/local/mailman/lists/myfirstlist/config.db'
Which makes sense. The config.db file is 660 root.mailman. I guess that is why all the mailman CGIs run with setgid mailman. I guess that leaves me at an impasse. I probably shouldn't give the web server elevated permissions for my little hacks.
Thanks for your help in any case.
- H
Chris Ryan chris@greatbridge.com
Harold Paulson wrote:
Hey,
I was trying to wrap several of the Mailman CLI tools (list_lists and such) in a little PHP so I could easily integrate them into a larger web site. Using PHP's System() function and the backtick operator to exec the Mailman tools never seems to result in any output, but no errors either. However, I can drop a script of my own (a little Perl hack or whatever) in the ~mailman/bin directory with the same ownership and permissions, and it seems to exec just fine.
Any idea what I'm overlooking?
- H
--
Harold Paulson Sierra Web Design haroldp@sierraweb.com http://www.sierraweb.com VOICE: 775.833.9500 FAX: 810.314.1517
Mailman-Developers mailing list Mailman-Developers@python.org http://mail.python.org/mailman/listinfo/mailman-developers
--
Harold Paulson Sierra Web Design haroldp@sierraweb.com http://www.sierraweb.com VOICE: 775.833.9500 FAX: 810.314.1517
At 10:04 AM 3/14/01 -0800, Harold Paulson wrote:
IOError: [Errno 13] Permission denied: '/usr/local/mailman/lists/myfirstlist/config.db'
Which makes sense. The config.db file is 660 root.mailman. I guess that is why all the mailman CGIs run with setgid mailman. I guess that leaves me at an impasse. I probably shouldn't give the web server elevated permissions for my little hacks.
Add your www user to the mailman group...
On Wed, Mar 14, 2001 at 03:08:12PM -0500, Ron Jarrell wrote:
At 10:04 AM 3/14/01 -0800, Harold Paulson wrote:
IOError: [Errno 13] Permission denied: '/usr/local/mailman/lists/myfirstlist/config.db'
Which makes sense. The config.db file is 660 root.mailman. I guess that is why all the mailman CGIs run with setgid mailman. I guess that leaves me at an impasse. I probably shouldn't give the web server elevated permissions for my little hacks.
Add your www user to the mailman group...
You should *not* do that. That gives the normal webserver way too much permissions. You should just use a setuid mailman wrapper script that does caller-checking to see if it's called correctly, by the right user, and with 'safe' values.
-- Thomas Wouters <thomas@xs4all.net>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
At 09:49 AM 3/13/01 -0800, Harold Paulson wrote:
Hey,
I was trying to wrap several of the Mailman CLI tools (list_lists and such) in a little PHP so I could easily integrate them into a larger web site. Using PHP's System() function and the backtick operator to exec the Mailman tools never seems to result in any output, but no errors either. However, I can drop a script of my own (a little Perl hack or whatever) in the ~mailman/bin directory with the same ownership and permissions, and it seems to exec just fine.
Harold, most of those commands user env to find where python is.
If it's not in your web servers search path, you won't find it.
The scripts you wrote probably spell out the path to perl...
participants (4)
-
Chris Ryan
-
Harold Paulson
-
Ron Jarrell
-
Thomas Wouters