/*************************************************** * DF C++ Miner Version 1.00 * Copyright 2001 DF dfmail@inbox.ru * DF WEB site: http://www.dfservice.com ****************************************************/ #include #include #include #include #include const float VERSION = 1.00; char *strperm(unsigned short int perm, char *line) { char string[10]; unsigned short int i; i=perm/010000; if(i == 010) line[0] = '-'; else if(i == 04) line[0] = 'd'; else if(i == 012) line[0] = 'l'; else if(i == 02) line[0] = 'c'; else if(i == 014) line[0] = 's'; else if(i == 06) line[0] = 'b'; else line[0] = '!'; line[1] = 0; sprintf(string, "%ho", (perm & 07777)); for(i=0;string[i];i++) { if(string[i] == '7') strcat(line," rwx"); else if(string[i] == '6') strcat(line," rw-"); else if(string[i] == '5') strcat(line," r-x"); else if(string[i] == '4') strcat(line," r--"); else if(string[i] == '3') strcat(line," -wx"); else if(string[i] == '2') strcat(line," -w-"); else if(string[i] == '1') strcat(line," --x"); else if(string[i] == '0') strcat(line," ---"); else strcat(line," !!!"); } return(line); } char *getlocaltime(void) { time_t timer; timer = time(NULL); return ctime(&timer); } int main(int argc, char * argv[], char * env[]) { int i; char *ptr; puts("Content-type: text/html\n\n"); printf("C++ Miner %.2f",VERSION); puts("\ "); printf("
C++ Miner %.2f", VERSION); puts("

Main Information
"); puts("

"); puts("\n"); puts("\n"); struct stat statbuf; stat(argv[0], &statbuf); puts("\n"); puts("\n"); puts("\n"); puts("
Current time:"); printf("%s\n", getlocaltime()); puts("
File path:"); printf("%s\n", argv[0]); puts("
This file Owner User:"); printf("%d\n", statbuf.st_uid); puts("
This file Owner Group:"); printf("%d\n", statbuf.st_gid); puts("
This file Permissions:"); char line[10]; printf("%s (%04lo)\n",strperm(statbuf.st_mode, line), statbuf.st_mode & 07777); puts("

\n"); puts("
Environment Variables
\

\n"); for(i=0;env[i]!= NULL;i++) { if(ptr=strstr(env[i],"=")){*ptr=0; ptr++; } else break; printf("\n", env[i], ptr); } puts("
%s%s

\n"); puts("
© 2001 DF™
\n"); puts(""); }