diff -urbB w3-msql-0/auth.c w3-msql/auth.c --- w3-msql-0/auth.c Thu Aug 19 05:33:22 1999 +++ w3-msql/auth.c Mon Dec 13 17:27:14 1999 @@ -152,7 +152,7 @@ char *fcrypt(); -void checkUser(group, area, namespace) +int checkUser(group, area, namespace) char *group, *area, *namespace; @@ -165,10 +165,10 @@ *curpw, salt[3]; if (strcmp(group,"** Public **") == 0) - return; + return 0; httpAuth(username, passwd, area, NULL); @@ -188,8 +188,9 @@ res = msqlStoreResult(); if (msqlNumRows(res) == 0) { - sendAuthHeader(area, "Bad Group Membership",NULL); - exit(1); + return 1; } } @@ -208,8 +209,9 @@ row = msqlFetchRow(res); if (!row) { - sendAuthHeader(area, "Invalid Username or Password",NULL); - exit(1); + return 1; } curpw = row[0]; @@ -219,11 +221,15 @@ cryptpw = (char *)fcrypt(passwd,salt); if (strcmp(cryptpw,row[0]) != 0) { - sendAuthHeader(area, "Invalid Username or Password",NULL); - exit(1); + return 1; } symCreateCharGlobal("$USERNAME",username); + symCreateCharGlobal("$GROUPNAME",group); symCreateCharGlobal("$NAMESPACE",namespace); + + return 0; } @@ -239,6 +245,7 @@ *cp2; int tokLen; /* ** Get the area info */ @@ -259,6 +266,7 @@ */ while(row) { cp = row[2]; while (isdigit(*cp)||*cp=='.'||*cp=='*') cp++; @@ -274,6 +282,7 @@ if (strncmp(hostAddr,row[2],(cp-row[2])) == 0) { strcpy(group,row[1]); + if (checkUser(group, area, namespace)==0) return(0); } row = msqlFetchRow(res); @@ -285,6 +294,7 @@ if (strcmp(hostAddr,row[2]) == 0) { strcpy(group,row[1]); + if (checkUser(group, area, namespace)==0) return(0); } row = msqlFetchRow(res); @@ -335,6 +345,7 @@ if (strcmp(cp2,cp) == 0) { strcpy(group,row[1]); + if (checkUser(group, area, namespace)==0) return(0); } } @@ -344,6 +355,7 @@ if (strcmp(row[2],hostName) == 0) { strcpy(group,row[1]); + if (checkUser(group, area, namespace)==0) return(0); } } @@ -364,6 +376,8 @@ *cp, *authHost; struct stat sbuf; /* ** First see if we need to do the authentication @@ -429,10 +443,11 @@ /* ** Check the access control info for this area */ - strcpy(group,"** No Group **"); if (checkAccess(area,namespace,group) < 0) { sendAuthHeader(area, "Bad Access Location",NULL); exit(0); } @@ -441,5 +456,4 @@ ** We got a match. Check out the access group info. This only ** returns if the user was OK. */ - checkUser(group, area, namespace); } Only in w3-msql: auth.c0 Only in w3-msql: auth.o Only in w3-msql: http.o Only in w3-msql: lexer.o Only in w3-msql: Makefile.full Only in w3-msql: mod_w3msql.o Only in w3-msql: modules.o Only in w3-msql: printf.c Only in w3-msql: printf.o Only in w3-msql: tests Only in w3-msql: w3-auth diff -urbB w3-msql-0/w3-auth.c w3-msql/w3-auth.c --- w3-msql-0/w3-auth.c Thu Aug 19 05:33:22 1999 +++ w3-msql/w3-auth.c Sun Dec 12 10:20:08 1999 @@ -14,14 +14,6 @@ ** */ -#if defined(_OS_OS2) -# define INCL_DOSPROCESS -# define INCL_DOSERRORS -# define INCL_NOCOMMON -# include -#endif - - #include #include #include @@ -457,6 +449,7 @@ void sendOkHeader() { + if (!headerSent) { printf("Status: 200 Output Follows\n"); printf("WWW-Authenticate: Basic\n"); printf("Server: w3-mSQL_2\n"); @@ -466,6 +459,7 @@ printf("


\n"); printf("

\n"); headerSent = 1; + } } @@ -4021,21 +4015,6 @@ *opt[5], *tok; -#if defined(_OS_OS2) - APIRET rc = NO_ERROR; -#endif - -#if defined(_OS_OS2) - /* change process priority to SERVER class */ - rc = DosSetPriority (PRTYS_PROCESSTREE, /* Change this process */ - PRTYC_FOREGROUNDSERVER, /* fixed-high class */ - 0L, /* Increase by 15 */ - 0L); /* Assume current process */ - if (rc != NO_ERROR) { - printf ("DosSetPriority error : rc = %u\n", rc); - } -#endif - chdir("/tmp"); @@ -4064,9 +4043,10 @@ else curNS = (char *)strdup("SuperUser"); urlNS = (char *)strdup(HTEscape(curNS)); - options = (char *)getenv("PATH_INFO"); + options = (char *) getenv("PATH_INFO"); if (options) { + options = strupr( options); if (*options == 0 || (*options == '/' && *(options+1)==0)) options = NULL; } @@ -4144,7 +4124,7 @@ exit(0); } sendOkHeader(); - printf("
\nDATA = '%s'\n
",options); + /*printf("
\nDATA = '%s'\n
",options);*/ sendMainMenu(); } Only in w3-msql: w3-auth.exe Only in w3-msql: w3-auth.o Only in w3-msql: w3-msql diff -urbB w3-msql-0/w3-msql.c w3-msql/w3-msql.c --- w3-msql-0/w3-msql.c Thu Aug 19 05:33:22 1999 +++ w3-msql/w3-msql.c Sun Dec 12 09:37:58 1999 @@ -14,14 +14,6 @@ ** */ -#if defined(_OS_OS2) -# define INCL_DOSPROCESS -# define INCL_DOSERRORS -# define INCL_NOCOMMON -# include -#endif - - #include #include #include @@ -686,10 +678,6 @@ privateScript[255], *cp; struct stat sbuf; -#if defined(_OS_OS2) - APIRET rc = NO_ERROR; -#endif - #if defined(_OS_OS2) || defined(_OS_WIN32) callback cb; @@ -705,19 +693,6 @@ _fsetmode(stdout, "b"); #endif -#if defined(_OS_OS2) - /* change process priority to SERVER class */ - rc = DosSetPriority (PRTYS_PROCESSTREE, /* Change this process */ - PRTYC_FOREGROUNDSERVER, /* fixed-high class */ - 0L, /* Increase by 15 */ - 0L); /* Assume current process */ - if (rc != NO_ERROR) { - printf ("DosSetPriority error : rc = %u\n", rc); - } -#endif - - - #ifdef DEBUG yydebug++; #endif @@ -776,7 +751,7 @@ fileOK; fileOK = 0; - cp = rindex(filename,'.'); + cp = (char*) rindex(filename,'.'); if (cp) { if (*suffix != '.') Only in w3-msql: w3-msql.exe Only in w3-msql: w3-msql.o