Fix compilation in dynamic mode.

This commit is contained in:
Todd C. Miller
2013-03-18 15:26:08 -04:00
parent 1a51a993de
commit ce502e2ae2

View File

@@ -125,10 +125,10 @@ static bool
sudo_check_plugin(struct plugin_info *info, char *fullpath, size_t pathsize) sudo_check_plugin(struct plugin_info *info, char *fullpath, size_t pathsize)
{ {
struct stat sb; struct stat sb;
int rval = false int rval = false;
debug_decl(sudo_check_plugin, SUDO_DEBUG_PLUGIN) debug_decl(sudo_check_plugin, SUDO_DEBUG_PLUGIN)
if (sudo_check_plugin(info, path, sizeof(path), &sb) != 0) { if (sudo_stat_plugin(info, fullpath, pathsize, &sb) != 0) {
warningx(_("error in %s, line %d while loading plugin `%s'"), warningx(_("error in %s, line %d while loading plugin `%s'"),
_PATH_SUDO_CONF, info->lineno, info->symbol_name); _PATH_SUDO_CONF, info->lineno, info->symbol_name);
warning("%s%s", _PATH_SUDO_PLUGIN_DIR, info->path); warning("%s%s", _PATH_SUDO_PLUGIN_DIR, info->path);
@@ -137,13 +137,13 @@ sudo_check_plugin(struct plugin_info *info, char *fullpath, size_t pathsize)
if (sb.st_uid != ROOT_UID) { if (sb.st_uid != ROOT_UID) {
warningx(_("error in %s, line %d while loading plugin `%s'"), warningx(_("error in %s, line %d while loading plugin `%s'"),
_PATH_SUDO_CONF, info->lineno, info->symbol_name); _PATH_SUDO_CONF, info->lineno, info->symbol_name);
warningx(_("%s must be owned by uid %d"), path, ROOT_UID); warningx(_("%s must be owned by uid %d"), fullpath, ROOT_UID);
goto done; goto done;
} }
if ((sb.st_mode & (S_IWGRP|S_IWOTH)) != 0) { if ((sb.st_mode & (S_IWGRP|S_IWOTH)) != 0) {
warningx(_("error in %s, line %d while loading plugin `%s'"), warningx(_("error in %s, line %d while loading plugin `%s'"),
_PATH_SUDO_CONF, info->lineno, info->symbol_name); _PATH_SUDO_CONF, info->lineno, info->symbol_name);
warningx(_("%s must be only be writable by owner"), path); warningx(_("%s must be only be writable by owner"), fullpath);
goto done; goto done;
} }
rval = true; rval = true;