Bug 199 - lecture file left open
lecture file left open
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.6.8
All All
: normal normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-10 19:18 MST by Jerry Brown
Modified: 2005-11-11 11:24 MST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerry Brown 2005-11-10 19:18:54 MST
The optional lecture file is left open and passed to the target program, at
least in the case of "sudo su" on HP-UX 11.00. This is a problem if lecture is
on a file system I later need to unmount without disturbing the program launched
by sudo. Looks like check.c needs an fclose after line 131 (1.6.8p12).

    if (def_lecture_file && (fp = fopen(def_lecture_file, "r")) != NULL) {
        while ((nread = fread(buf, sizeof(char), sizeof(buf), fp)) != 0)
            fwrite(buf, nread, 1, stderr);
# next line is proposed addition
        fclose(fp);
    } else {
Comment 1 Todd C. Miller 2005-11-11 09:24:23 MST
Thanks, I've fixed this in the sudo cvs tree