Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
  #1  
Old October 22nd, 2000, 11:34 PM
dwarf dwarf is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 300 dwarf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Is there a way to write a Perl script that would run as a different user?? To be more specific, I want to write a Perl CGI program that would change user as soon as it is executed. Of course, the user executing the program would be the user Apache runs under (nobody or www).

So, again, is there a way to do this, or will I have to write a small C program to do this?? (Please tell me no... )

Reply With Quote
  #2  
Old October 23rd, 2000, 12:43 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
This is actually an Apache question. It doesn't matter whether it's Perl or PHP or any others, you just can't change the user Apache runs as within your script.

That's why you need SuEXEC or Cgiwrap to accomplish your task.
Another way is to recompile Apache and add -DBIG_SECURITY_HOLE to the EXTRA_CFLAGS line or your src/Configuration file. That is, your Apache is capable to run as root. Be warned, you need to know what you are doing when running Apache as root.

Reply With Quote
  #3  
Old October 23rd, 2000, 03:11 PM
dwarf dwarf is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 300 dwarf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
So there is only that way?? OK, then, SuEXEC is the way, since running Apache as root is not something to be toyed with.

Another question, as a follow-up: any good tutorials or documents on SuEXEC and how to use it??

Reply With Quote
  #4  
Old October 24th, 2000, 02:07 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
1) http://www.apache.org/docs/suexec.html

2) http://apachetoday.com/news_story.php3?ltsn=2000-07-12-001-01-NW-LF-SW

3) http://www.apacheweek.com/issues/search.cgi?suexec


[This message has been edited by freebsd (edited October 24, 2000).]

Reply With Quote
  #5  
Old October 24th, 2000, 03:10 AM
dwarf dwarf is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 300 dwarf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Thanks a lot. Will read these docs and see what I came uo with...

Thanks again.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Perl and suid


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway