RES: Segmentation fault
Hello Stas, I will look for those information. Anyway, it does not works under pure mod_perl too. Regards, Vitor -Mensagem original- De: Stas Bekman [mailto:[EMAIL PROTECTED]] Enviada em: terca-feira, 30 de julho de 2002 06:04 Para: Vitor Cc: [EMAIL PROTECTED] Assunto: Re: Segmentation fault Vitor wrote: Hello Folks, I am having a big problem here. While i try to open a new Mail::CClient connection, i get these message : [Fri Jul 19 17:56:28 2002] [notice] child pid 6146 exit signal Segmentation fault (11) I am using Perl 5.6.1, Apache/1.3.23 , PHP/4.1.1 mod_perl/1.26, without shared libraries, and HTML::Mason templating system. I don't know if is a callback problem, because to login, Mail::CClient uses a login callback. It works well as a cgi, but under mod_perl/Mason, i get those message. You need to send a backtrace and other info as explained at: http://perl.apache.org/docs/1.0/guide/help.html#How_to_Report_Problems and probably post it to the mason list and not here if this happens only under mason. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
RES: apache mod_perl + suid question
Insecure dependency in `` while running with -T switch at /usr/sbin/usermod_wrapper.pl line 27 These means that you can't use ``. You need to use system command. $command = /path/you/need; system($command); All the additional vars need to be passed through vars : $var1 = login; $var2 = password: system($command,$var1,$var2); If it does not run under -T switch, will not run in mod_perl. So to get over this problem, I should chown apachectl to the Apache group ? No. And secondly, if I am running Apache as non-root, then I will have to use the system command ? I cannot use the $ret = `$wrapper` command. Is this true ? Even running apache as root, you need to follow the tainted mode rules. Regards, Vitor -Original Message- From: Vitor [mailto:[EMAIL PROTECTED]] Sent: Friday, July 26, 2002 8:31 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RES: apache mod_perl + suid question Tushar, It's not recommeded to run apache as root. (Security issues). I have some applications that uses system command under mod_perl without problems. Try to execute you wrapper script in command line. Execute it with /usr/bin/perl -T (tainted mode), that checks if your script is safe. If you got error results, you will know why it's not working. $ret = `$wrapper` , also should work in you configuration (running apache as root). Regards, Vitor -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviada em: sexta-feira, 26 de julho de 2002 20:13 Para: [EMAIL PROTECTED]; [EMAIL PROTECTED] Assunto: RE: apache mod_perl + suid question Thanks Vitor... I have something very similar to what you mention below..only that I am taking the username and passwd from the apache gui. Then I encrypt the passwd and send that to wrapper(i.e. suid_file) script. So I have something like system($wrapper), where $wrapper = suid_file.pl encrupted passwd username. I changed the suid_file to 4750 and have the ownership and group as root,root. I am also runing Apache as root. I don't have httpd as a user or group. Do I need to ? Also do I need to use the ystem command, can't I just do $ret = `$wrapper` ? thanks. -Tushar -Original Message- From: Vitor [mailto:[EMAIL PROTECTED]] Sent: Friday, July 26, 2002 7:04 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RES: apache mod_perl + suid question Hello Tushar, Try this : $suid_file = file_path/suidfile.pl; $user = nobody; $passwd = kdsak; (system($suid_file,$user,$$passwd)) or die Error in suid operation $! ; Note that suid_file need the following commands : - chmod 4750 - chown root:httpd Regards, Vitor -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviada em: sexta-feira, 26 de julho de 2002 19:41 Para: [EMAIL PROTECTED] Assunto: apache mod_perl + suid question Hello, I am trying to write a password changing program. For this I have a mod_perl subroutine from where I am trying to execute a perl script(with suid permissions 4711), which is a wrapper and in turn calls the usermod command on linux with the old and new passwords. The problem I am having: 1: The usermod command doesn't get executed. I have tried debugging this...by having a log file(/usr/local/apache/logs) and the mod_perl process does open the wrapper script..but then does nothing. It does not execute the command. What am I doing wrong ? I know there might be some quirks with suid permissons and I would like to know how can I overcome this. I have something like below from mod_perl subroutine: my $ret_val = `$wrapper`; Within the wrapper perl script, I call usermond with the passwds by doing: $ret = `$usermondcmd 21` Any help would be much appreciated. thanks a lot. -Tushar
RES: apache mod_perl + suid question
I think you can't get out of tainted mode under mod_perl. You will have a big security role if you quit tainted mode. Regards, Vitor -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviada em: sábado, 27 de julho de 2002 12:06 Para: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Assunto: RE: apache mod_perl + suid question Vitor, The thing is also that I can run the wrapper from the command line without the -T switch, and I do succeed, i.e. the password does get changed. Seems like mod_perl by default has the taint mode on. How do I get rid of this taint mode from mod_perl. At present I have the following use calls in mod_perl: use Apache::Constants qw(:common); use Apache::Debug(); use CGI '-autoload'; Do I need to add something here or take out something from here to get rid of the tainted mode ? thanks. -Tushar -Original Message- From: Vitor [mailto:[EMAIL PROTECTED]] Sent: Friday, July 26, 2002 8:31 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RES: apache mod_perl + suid question Tushar, It's not recommeded to run apache as root. (Security issues). I have some applications that uses system command under mod_perl without problems. Try to execute you wrapper script in command line. Execute it with /usr/bin/perl -T (tainted mode), that checks if your script is safe. If you got error results, you will know why it's not working. $ret = `$wrapper` , also should work in you configuration (running apache as root). Regards, Vitor -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviada em: sexta-feira, 26 de julho de 2002 20:13 Para: [EMAIL PROTECTED]; [EMAIL PROTECTED] Assunto: RE: apache mod_perl + suid question Thanks Vitor... I have something very similar to what you mention below..only that I am taking the username and passwd from the apache gui. Then I encrypt the passwd and send that to wrapper(i.e. suid_file) script. So I have something like system($wrapper), where $wrapper = suid_file.pl encrupted passwd username. I changed the suid_file to 4750 and have the ownership and group as root,root. I am also runing Apache as root. I don't have httpd as a user or group. Do I need to ? Also do I need to use the ystem command, can't I just do $ret = `$wrapper` ? thanks. -Tushar -Original Message- From: Vitor [mailto:[EMAIL PROTECTED]] Sent: Friday, July 26, 2002 7:04 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RES: apache mod_perl + suid question Hello Tushar, Try this : $suid_file = file_path/suidfile.pl; $user = nobody; $passwd = kdsak; (system($suid_file,$user,$$passwd)) or die Error in suid operation $! ; Note that suid_file need the following commands : - chmod 4750 - chown root:httpd Regards, Vitor -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviada em: sexta-feira, 26 de julho de 2002 19:41 Para: [EMAIL PROTECTED] Assunto: apache mod_perl + suid question Hello, I am trying to write a password changing program. For this I have a mod_perl subroutine from where I am trying to execute a perl script(with suid permissions 4711), which is a wrapper and in turn calls the usermod command on linux with the old and new passwords. The problem I am having: 1: The usermod command doesn't get executed. I have tried debugging this...by having a log file(/usr/local/apache/logs) and the mod_perl process does open the wrapper script..but then does nothing. It does not execute the command. What am I doing wrong ? I know there might be some quirks with suid permissons and I would like to know how can I overcome this. I have something like below from mod_perl subroutine: my $ret_val = `$wrapper`; Within the wrapper perl script, I call usermond with the passwds by doing: $ret = `$usermondcmd 21` Any help would be much appreciated. thanks a lot. -Tushar
RES: apache mod_perl + suid question
Tushar, It's not recommeded to run apache as root. (Security issues). I have some applications that uses system command under mod_perl without problems. Try to execute you wrapper script in command line. Execute it with /usr/bin/perl -T (tainted mode), that checks if your script is safe. If you got error results, you will know why it's not working. $ret = `$wrapper` , also should work in you configuration (running apache as root). Regards, Vitor -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviada em: sexta-feira, 26 de julho de 2002 20:13 Para: [EMAIL PROTECTED]; [EMAIL PROTECTED] Assunto: RE: apache mod_perl + suid question Thanks Vitor... I have something very similar to what you mention below..only that I am taking the username and passwd from the apache gui. Then I encrypt the passwd and send that to wrapper(i.e. suid_file) script. So I have something like system($wrapper), where $wrapper = suid_file.pl encrupted passwd username. I changed the suid_file to 4750 and have the ownership and group as root,root. I am also runing Apache as root. I don't have httpd as a user or group. Do I need to ? Also do I need to use the ystem command, can't I just do $ret = `$wrapper` ? thanks. -Tushar -Original Message- From: Vitor [mailto:[EMAIL PROTECTED]] Sent: Friday, July 26, 2002 7:04 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RES: apache mod_perl + suid question Hello Tushar, Try this : $suid_file = file_path/suidfile.pl; $user = nobody; $passwd = kdsak; (system($suid_file,$user,$$passwd)) or die Error in suid operation $! ; Note that suid_file need the following commands : - chmod 4750 - chown root:httpd Regards, Vitor -Mensagem original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Enviada em: sexta-feira, 26 de julho de 2002 19:41 Para: [EMAIL PROTECTED] Assunto: apache mod_perl + suid question Hello, I am trying to write a password changing program. For this I have a mod_perl subroutine from where I am trying to execute a perl script(with suid permissions 4711), which is a wrapper and in turn calls the usermod command on linux with the old and new passwords. The problem I am having: 1: The usermod command doesn't get executed. I have tried debugging this...by having a log file(/usr/local/apache/logs) and the mod_perl process does open the wrapper script..but then does nothing. It does not execute the command. What am I doing wrong ? I know there might be some quirks with suid permissons and I would like to know how can I overcome this. I have something like below from mod_perl subroutine: my $ret_val = `$wrapper`; Within the wrapper perl script, I call usermond with the passwds by doing: $ret = `$usermondcmd 21` Any help would be much appreciated. thanks a lot. -Tushar
Embed Apache+Mod_perl into a application
Hello Folks, Does anybody tried to embed mod_perl and apache inside an windows application ? Thanks, Vitor
RES: RES: Windows mod_perl build
Ok ! Thanks! Vitor -Mensagem original- De: Per Einar Ellefsen [mailto:[EMAIL PROTECTED]] Enviada em: sabado, 11 de maio de 2002 19:17 Para: Vitor Cc: Mod-perl list Assunto: Re: RES: Windows mod_perl build Please Cc the list when replying. At 23:52 11.05.2002, Vitor wrote: Excellent resource. Just one more question : I want to have mod_perl running in my application as a thread. All requests to mod_perl will occur inside the application through piped I/O. Do you know a resource where i can find more information about this ? Hmm, that's pretty much above my head :) But I think it seems a little complicated... Maybe you should just be starting up Apache on a non-standard port and use standard sockets to communicate with Apache/mod_perl? That's all I can say. Best regards, Vitor -Mensagem original- De: Per Einar Ellefsen [mailto:[EMAIL PROTECTED]] Enviada em: sabado, 11 de maio de 2002 17:18 Para: Vitor Cc: [EMAIL PROTECTED] Assunto: Re: Windows mod_perl build At 22:21 11.05.2002, Vitor wrote: Hello, I am searching for windows mod_perl compilations resources. Any suggestions ? Randy Kobes has kindly written instructions for you to compile mod_perl on Windows and other Win32-related issues. http://perl.apache.org/preview/modperl-docs/dst_html/docs/1.0/win32/index.h t ml -- Per Einar Ellefsen [EMAIL PROTECTED]
Windows mod_perl build
Hello, I am searching for windows mod_perl compilations resources. Any suggestions ? Thanks. Vitor
RES: Perl Callbacks not working
Mark, First, thanks for you reply. I know that Acmemail runs fine under mod_perl. I think the reason for this is that their script runs as an common CGI, and not as a cached bytecode. About you second suggestion, i just changed the values of login and password that i use. Best Regards, Vitor -Mensagem original- De: Mark Fowler [mailto:[EMAIL PROTECTED]]Em nome de Mark Fowler Enviada em: quarta-feira, 1 de maio de 2002 06:27 Para: Vitor Cc: [EMAIL PROTECTED] Assunto: Re: Perl Callbacks not working On Tue, 30 Apr 2002, Vitor wrote: use strict; use Mail::CClient qw(set_callback); set_callback (login= sub { return (login,password); } ) I don't see any reason why this shouldn't work. Acmemail (which runs fine under mod_perl) uses Mail::CClient with callbacks without problem. I think this is related with the cacching feature of mod_perl that need to be disabled for pages that uses these callbacks. What are you expecting to happen here? When Mail::CClient needs a login it will call the anonymous subroutine passed on login which will simply return the two values login and password. These need to be set to the login and password of your POP/IMAP/Whatever account. You could be getting things confused with closures here, it's reasonably easy to do. sub init { my $login,$password; set_callback (login= sub { return ($login,$password); } ) } Will not login no matter what you set $login or $password to be later as the anonymous subroutine will be bound to the particular $login and $password created in init. Hope this is helpful (and the problem isn't more serious) Mark. -- s'' Mark Fowler London.pm Bath.pm http://www.twoshortplanks.com/ [EMAIL PROTECTED] ';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/ +/ ){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}
Perl Callbacks not working
Hello, I am trying to use a Perl Module that is an interface to a C Library. These module use some callbacks , like these perl Code: use strict; use Mail::CClient qw(set_callback); set_callback (login= sub { return (login,password); } ) I think this is related with the cacching feature of mod_perl that need to be disabled for pages that uses these callbacks. Thanks in advance, Vitor