Bug 29 - visudo exits with a segmentation fault when negating logfile option
visudo exits with a segmentation fault when negating logfile option
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Visudo
1.6.3
Alpha Tru64 UNIX
: normal normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2001-03-02 06:09 MST by Alan Pfeiffer-Traum
Modified: 2001-03-02 11:14 MST (History)
0 users

See Also:


Attachments
The following patch fixes this (424 bytes, patch)
2001-03-02 07:13 MST, Todd C. Miller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Pfeiffer-Traum 2001-03-02 06:09:10 MST
Using the string-valued option "logfile" in a negated boolean context "!logfile"
results in a segmentation violation. This occurs on Solaris 2.6 and Linux RH 5.2
and 7.0 as well as Tru64 4.0E. It also occurs for "mailerpath".

Here's what dbx reports:

signal Segmentation fault at   [set_default:411 +0x10,0x12000c084]        if
((cur->type & T_PATH) && *val != '/') {
(dbx) w
   406                          "%s: no value specified for `%s' on line %d\n",
Argv[0],
   407                          var, sudolineno);
   408                      return(FALSE);
   409                  }
   410              }
>* 411              if ((cur->type & T_PATH) && *val != '/') {
   412                  (void) fprintf(stderr,
   413                      "%s: values for `%s' must start with a '/'\n",
Argv[0],
   414                      var);
   415                  return(FALSE);
(dbx) where
>  0 set_default(var = 0x140009bc0 = "logfile", val = (nil), op = 0)
["defaults.c":411, 0x12000c084]
   1 yyparse() ["sudo.tab.c":1110, 0x120006048]
   2 main(argc = 0, argv = 0x11ffffb48) ["visudo.c":293, 0x120003ce8]
Comment 1 Todd C. Miller 2001-03-02 07:13:59 MST
Created attachment 3 [details]
The following patch fixes this
Comment 2 Todd C. Miller 2001-03-02 07:14:59 MST
I'm going to push out sudo 1.6.3p7 with this fix in it.