Don’t forget, Scotto!!

 
	# procedure to check if the setuid bit is on 
	sub checkSUID { 
		return( -u $_[0] ); 
	} 

Some file test operators
-r readable
-x executable
-e exists
-d is a directory
-t is a tty
-T text file

Example

 
################################################################ 
# Check Security 
################################################################ 
# Users who wish to use this program must 
# put the file ".allowmailform" in their home directory on the  
# machine running this script.  We don't want people creating 
# forms that are abused to send "anonymous" mail. 
$homedir = (getpwnam($recipient))[7]; 
if (! -e "$homedir/.allowmailform") { 
	# this user does not permit the server to send mail to him.  Quit. 
	&error("The recipient of the form has not enabled access for this form");    exit(0); 
} 

Related Posts

  • 9653- WednesdayMarch 18, 2009 9653- Wednesday Bro's girlfriend / possible mother to his kid Shannon has been found, and she and her […]
  • 9638 – Thursday – repairing internet connection on the eeeMarch 5, 2009 9638 – Thursday – repairing internet connection on the eee See entry comments for mysql code snips in use. Saving on j:/uiia/qmysql/ --"modem […]
  • Wednesday – 9396 –August 13, 2008 Wednesday – 9396 – I officially know more about Rsync than I ever thought I would. It's a mighty handy […]
  • 9335 – ThursJune 26, 2008 9335 – Thurs That Meme - Post 3 things you've done in your lifetime that you don't think anybody else […]
  • 9268 – Sunday –May 4, 2008 9268 – Sunday – Bagel, cream cheese, strawberries and pineapple for breakfast - BHK and I slowly worked […]

Leave a Reply