dgaudet 99/05/12 09:50:43
Modified: src CHANGES src/main http_request.c Log: don't assume the struct stat passed to stat() is left alone when the stat fails Submitted by: Ed Korthof <[EMAIL PROTECTED]> Revision Changes Path 1.1353 +3 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.1352 retrieving revision 1.1353 diff -u -r1.1352 -r1.1353 --- CHANGES 1999/05/07 00:38:05 1.1352 +++ CHANGES 1999/05/12 16:50:40 1.1353 @@ -1,5 +1,8 @@ Changes with Apache 1.3.7 + *) When stat() fails, don't assume anything about the contents of + the struct stat. [Ed Korthof <[EMAIL PROTECTED]>] + *) It's OK for a semop to return EINTR, just loop around and try again. [Dean Gaudet] 1.148 +10 -8 apache-1.3/src/main/http_request.c Index: http_request.c =================================================================== RCS file: /home/cvs/apache-1.3/src/main/http_request.c,v retrieving revision 1.147 retrieving revision 1.148 diff -u -r1.147 -r1.148 --- http_request.c 1999/04/20 23:38:44 1.147 +++ http_request.c 1999/05/12 16:50:42 1.148 @@ -265,8 +265,12 @@ *cp = '\0'; return OK; } + /* must set this to zero, some stat()s may have corrupted it + * even if they returned an error. + */ + r->finfo.st_mode = 0; #if defined(ENOENT) && defined(ENOTDIR) - else if (errno == ENOENT || errno == ENOTDIR) { + if (errno == ENOENT || errno == ENOTDIR) { last_cp = cp; while (--cp > path && *cp != '/') @@ -299,15 +303,13 @@ * you needed to do this. Please be sure to include the operating * system you are using. */ - else { - last_cp = cp; + last_cp = cp; - while (--cp > path && *cp != '/') - continue; + while (--cp > path && *cp != '/') + continue; - while (cp > path && cp[-1] == '/') - --cp; - } + while (cp > path && cp[-1] == '/') + --cp; #endif /* ENOENT && ENOTDIR */ } return OK;