|
Bugzilla – Full Text Bug Listing |
| Summary: | character ranges regression | ||
|---|---|---|---|
| Product: | Sudo | Reporter: | Martin Pitt <martin.pitt> |
| Component: | Sudo | Assignee: | Todd C. Miller <Todd.Miller> |
| Status: | RESOLVED FIXED | ||
| Severity: | high | ||
| Priority: | low | ||
| Version: | 1.6.9 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| URL: | https://bugs.launchpad.net/ubuntu/+source/sudo/+bug/228046 | ||
| Attachments: | Diff to restrict sudo to the C loale | ||
|
Description
Martin Pitt
2008-07-31 04:05:14 MDT
I can reproduce this on Linux (though not on BSD). It is probably related to the switch to using glob(3) instead of fnmatch(3) for matching. Actually, the behavior I am seeing is different than you describe, though the issues may be related. In my case, the user is found in sudoers but is not allowed to run "ls foo". The problem appears to be related to locales. With LANG=en_US.UTF-8 the fnmatch() routine in glibc does not match "foo" against "[A-z]*", but if LANG is not defined (or if it is defined to "C") the matching happens as expected. The problem is that [A-z] is fundamentally non-portable when locales are taken into account. You should either use [[\:alpha\:]] or [A-Za-z]. I'll update the sudo documentation accordingly. In older sudo revisions, LANG was not preserved during command matching, which is why 1.6.8 doesn't show this behavior. Created attachment 229 [details]
Diff to restrict sudo to the C loale
I have committed the attached diff which restricts sudo to the C locale, like older versions did. It seems that this didn't make it into 1.7? It's not really a bug, the correct range to use is [A-Za-z]. In 1.7 there is now a sudoers_locale Defaults setting that can be used to specify the locale to use when evaluating sudoers globs. |