C
callmetimmay
Well... i admit, I am very new to this but i don't know what's going
on. I made a very UNSECURE login script and when I finised it, it
worked fine. But now, 5 days later, It does NOT list any of my realms.
Here's my index.cgi code:
-------------------------
#!/usr/bin/perl
print "Content-type:text/html\n\n";
$path="/var/www/cgi-bin/maint";
$files="$path/files";
$realm="$files/.realm.tmp";
#$login="$files/$location/login";
$command=("/bin/rm -rf $realm;/bin/ls -w1 $files > $realm");
system($command) or print "Error: $!";
print "<HTML><BR><BR><BR><BR><BR><body bgcolor=black><P
align=center><form name=login action=\"/cgi-bin/maint/login.cgi\"
method=post><Table border=1 bgcolor=aqua><tr><td width=300
height=100><B><p align=center>Please enter Login Info:<table
border=0><tr><td>Login:<td><Input type=text
name=\"user\"><Tr><td>Password:<td><input type=password
name=\"pass\"><tr><td>Realm:<td><select width=90 name=realm>";
open(INF,$realm) or print "Error: $!";
@realms=<INF>;
close INF;
foreach $entry (@realms) {
print "<option>$entry</option>";
}
print "</select></table><Center><input type=submit
value=\"Login\"></table></form>";
print "<p align=left><font color=white>Realms: @realms<BR>Last Entry in
Realms: $entry<BR><BR>Vars:<BR>Files: $files<BR>Realm File:
$realm<BR>Login: $login <BR><BR>Get Realm Command:
$command<BR><BR>Errors: $!";
-------------------------------------------------------------------
I put that last print in there to try to figure out what's goin on.
-----------------------------------
Realms:
Last Entry in Realms:
Vars:
Files: /var/www/cgi-bin/maint/files
Realm File: /var/www/cgi-bin/maint/files/.realm.tmp
Login:
Get Realm Command: /bin/rm -rf
/var/www/cgi-bin/maint/files/.realm.tmp;/bin/ls
/var/www/cgi-bin/maint/files > /var/www/cgi-bin/maint/files/.realm.tmp
Errors: Inappropriate ioctl for device
-------------------------------------------------------------------
All the directories in the /var/www/cgi-bin/maint/files should be
listed in Realms when the page loads. Now here's the kicker... When I
run the script from the linux prompt... IT WORKS!!! Why won't apache
run this anymore for me?!?! And yes, I've restarted httpd. What's goin
on here?!?!? Any Ideas?!?! Suggestions in code?!? Self taught, so very
open to new ways of doing things!
Thanks in advance!
-Tim
on. I made a very UNSECURE login script and when I finised it, it
worked fine. But now, 5 days later, It does NOT list any of my realms.
Here's my index.cgi code:
-------------------------
#!/usr/bin/perl
print "Content-type:text/html\n\n";
$path="/var/www/cgi-bin/maint";
$files="$path/files";
$realm="$files/.realm.tmp";
#$login="$files/$location/login";
$command=("/bin/rm -rf $realm;/bin/ls -w1 $files > $realm");
system($command) or print "Error: $!";
print "<HTML><BR><BR><BR><BR><BR><body bgcolor=black><P
align=center><form name=login action=\"/cgi-bin/maint/login.cgi\"
method=post><Table border=1 bgcolor=aqua><tr><td width=300
height=100><B><p align=center>Please enter Login Info:<table
border=0><tr><td>Login:<td><Input type=text
name=\"user\"><Tr><td>Password:<td><input type=password
name=\"pass\"><tr><td>Realm:<td><select width=90 name=realm>";
open(INF,$realm) or print "Error: $!";
@realms=<INF>;
close INF;
foreach $entry (@realms) {
print "<option>$entry</option>";
}
print "</select></table><Center><input type=submit
value=\"Login\"></table></form>";
print "<p align=left><font color=white>Realms: @realms<BR>Last Entry in
Realms: $entry<BR><BR>Vars:<BR>Files: $files<BR>Realm File:
$realm<BR>Login: $login <BR><BR>Get Realm Command:
$command<BR><BR>Errors: $!";
-------------------------------------------------------------------
I put that last print in there to try to figure out what's goin on.
output from that error checking print line:From what I can tell, it cannot do the directory listing... here is the
-----------------------------------
Realms:
Last Entry in Realms:
Vars:
Files: /var/www/cgi-bin/maint/files
Realm File: /var/www/cgi-bin/maint/files/.realm.tmp
Login:
Get Realm Command: /bin/rm -rf
/var/www/cgi-bin/maint/files/.realm.tmp;/bin/ls
/var/www/cgi-bin/maint/files > /var/www/cgi-bin/maint/files/.realm.tmp
Errors: Inappropriate ioctl for device
-------------------------------------------------------------------
All the directories in the /var/www/cgi-bin/maint/files should be
listed in Realms when the page loads. Now here's the kicker... When I
run the script from the linux prompt... IT WORKS!!! Why won't apache
run this anymore for me?!?! And yes, I've restarted httpd. What's goin
on here?!?!? Any Ideas?!?! Suggestions in code?!? Self taught, so very
open to new ways of doing things!
Thanks in advance!
-Tim