+2001-10-18 Ken Raeburn <raeburn@mit.edu>
+
+ Don't crash if .k[5]login file ownership is wrong. Patch from
+ Emily Ratliff, ratliff@austin.ibm.com.
+ * authorization.c (fowner): Don't close the file even on error.
+ (krb5_authorization): Close the file if fowner returns FALSE.
+
2001-10-09 Ken Raeburn <raeburn@mit.edu>
* authorization.c, heuristic.c, krb_auth_su.c, ksu.h, main.c: Make
* the user himself, or by root. Otherwise, don't grant access.
*/
if (fstat(fileno(fp), &sbuf)) {
- fclose(fp);
return(FALSE);
}
if ((sbuf.st_uid != uid) && sbuf.st_uid) {
- fclose(fp);
return(FALSE);
}
if (!k5login_flag){
if ((login_fp = fopen(k5login_path, "r")) == NULL)
return 0;
- if ( fowner(login_fp, pwd->pw_uid) == FALSE)
+ if ( fowner(login_fp, pwd->pw_uid) == FALSE) {
+ fclose(login_fp);
return 0;
+ }
}
if (!k5users_flag){
return 0;
}
if ( fowner(users_fp, pwd->pw_uid) == FALSE){
+ fclose(users_fp);
return 0;
}
}