i had a question about forking. i haven't used foking much and i'm still very scratchy on how it works, but basically i think im in need of it. im making a basic user authentication CGI script and it has to check certain things, then ban a user if he tries to hack me. supposedly, if the TCP-IP connection between the user and the httpd on the server is killed BEFORE we can write the file for banning them, they dont get banned and they can keep hacking. this is bad. i dunno if the script continues until it is done or when the connection is killed, but i dont wanna risk it so how would i use fork() in order to continue the script and ban the user? i realize that one could flood the server with twice the amount of processes by callign the ban and fork()ing too many times, but i dont see much possibility of an alternative. the code to execute and write to file is quite small and fast so im trusting the speed in which it writes. it uses sysseek to go straight to where it should write and then syswrite to write in the data and end (possibly creating the file if necessary). so how would i use flock() to execute this code?
open IPNFO, ">$rootdir/memb/precarious/$dbfile_ip_$num" or (print "no
+ip nfo: $!<br>" and exit);
sysseek IPNFO, $startchar, 0;
syswrite (IPNFO, $badboyz) or print "could not write: $!";
close IPNFO;
if it should do -x ">$rootdir/memb/precarious/$dbfile_ip_$num" i could add that.
on a side note, im looking for a good perl algorithm for using steganography to hide a message in a BMP. i used the algorithm from the Mastering Algorithms With Perl book but it is broken (the algorithm) so i would like a new algorithm. i had one that pretty much worked to put and get the message btu could not display the image. and the code got deleted. :( . so any help is greatly appreciated.
email me at psyphreak@phreaker.net with any comments or help if you dont wanna post a reply