www.pudn.com > cgi-web.rar > index.c, change:2007-08-31,size:1894b


#include <stdio.h> 
#include <string.h> 
#include <stdlib.h> 
#include <fcntl.h> 
#include <getopt.h> 
#include <errno.h> 
#include <sys/ioctl.h> 
#include <linux/config.h> 
#include <netinet/in.h> 
#include <arpa/inet.h> 
 
//<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\"> 
//<META HTTP-EQUIV=\"expires\" CONTENT=\"-1\"> 
 
static char adminGate[] = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3c.org/TR/1999/REC-html401-19991224/frameset.dtd\"> 
<HTML><HEAD><TITLE>IPCAMER</TITLE> 
<META http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\"> 
 
 
<META content=\"MSHTML 6.00.6000.16414\" name=GENERATOR> 
</HEAD> 
<FRAMESET border=0  
frameSpacing=0 rows=* frameBorder=NO> 
	<FRAMESET border=0  
frameSpacing=0 frameBorder=NO cols=129,*,0><FRAME name=leftFrame  
src=\"menus.htm\" noResize><FRAME name=mainFrame  
src=\"/sysinfo.cgi\"><FRAME name=msgFrame  
src=\"about:blank\"></FRAMESET></FRAMESET></HTML>\n\n"; 
 
//static char userGate[] = "Location: rt_video.cgi\n\n"; 
 
static char userGate[] = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Frameset//EN\" \"http://www.w3c.org/TR/1999/REC-html401-19991224/frameset.dtd\"> 
<HTML><HEAD><TITLE>IPCAMER</TITLE> 
<!-- 
<META http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\"> 
--> 
<META content=\"MSHTML 6.00.6000.16414\" name=GENERATOR> 
</HEAD> 
<FRAMESET border=0  
frameSpacing=0 rows=* frameBorder=NO> 
	<FRAMESET border=0  
frameSpacing=0 frameBorder=NO *,*,0><FRAME name=mainFrame  
src=\"/rt_video.cgi\"><FRAME name=msgFrame  
src=\"about:blank\"></FRAMESET></FRAMESET></HTML>\n\n 
"; 
 
int main(void) 
{ 
   char * userName = getenv("REMOTE_USER"); 
 
   if(!strcmp("admin",userName)) 
	{ 
      printf("%s\n",adminGate); 
	} 
	else if(!strcmp("user",userName)) 
	{ 
      printf("%s\n",userGate); 
	} 
 
 
    fflush(stdout); 
    exit(0); 
 
}  // end of main