Fix support for AIX-style path(module) syntax in sudo.conf Plugin lines.
This commit is contained in:
@@ -240,7 +240,7 @@ sudo_dso_load_v1(const char *path, int mode)
|
|||||||
cp = strrchr(path, '(');
|
cp = strrchr(path, '(');
|
||||||
if (cp != NULL) {
|
if (cp != NULL) {
|
||||||
size_t len = strlen(cp);
|
size_t len = strlen(cp);
|
||||||
if (len > 2 && cp[len - 1] == '\0')
|
if (len > 2 && cp[len - 1] == ')')
|
||||||
SET(flags, RTLD_MEMBER);
|
SET(flags, RTLD_MEMBER);
|
||||||
}
|
}
|
||||||
# endif /* RTLD_MEMBER */
|
# endif /* RTLD_MEMBER */
|
||||||
|
@@ -82,7 +82,21 @@ sudo_stat_plugin(struct plugin_info *info, char *fullpath,
|
|||||||
}
|
}
|
||||||
status = stat(fullpath, sb);
|
status = stat(fullpath, sb);
|
||||||
}
|
}
|
||||||
if (status == -1) {
|
#ifdef _AIX
|
||||||
|
if (status == -1 && errno == ENOENT) {
|
||||||
|
/* Check for AIX path(module) syntax. */
|
||||||
|
char *cp = strrchr(fullpath, '(');
|
||||||
|
if (cp != NULL) {
|
||||||
|
/* Only for archive files (e.g. sudoers.a). */
|
||||||
|
if (cp > fullpath + 2 && cp[-2] == '.' && cp[-1] == 'a') {
|
||||||
|
*cp = '\0';
|
||||||
|
status = stat(fullpath, sb);
|
||||||
|
*cp = '(';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* _AIX */
|
||||||
|
if (status == -1 && errno == ENOENT) {
|
||||||
char *newpath = sudo_stat_multiarch(fullpath, sb);
|
char *newpath = sudo_stat_multiarch(fullpath, sb);
|
||||||
if (newpath != NULL) {
|
if (newpath != NULL) {
|
||||||
len = strlcpy(fullpath, newpath, pathsize);
|
len = strlcpy(fullpath, newpath, pathsize);
|
||||||
|
Reference in New Issue
Block a user