Add a trailing slash to _PATH_SUDO_PLUGIN_DIR to simplify usage.

This commit is contained in:
Todd C. Miller
2010-07-02 10:53:47 -04:00
parent 454534eff2
commit 66eafd0994
3 changed files with 4 additions and 4 deletions

2
configure vendored
View File

@@ -18302,7 +18302,7 @@ _ACEOF
fi fi
eval PLUGINDIR="$with_plugindir" eval PLUGINDIR="$with_plugindir"
cat >>confdefs.h <<EOF cat >>confdefs.h <<EOF
#define _PATH_SUDO_PLUGIN_DIR "$PLUGINDIR" #define _PATH_SUDO_PLUGIN_DIR "$PLUGINDIR/"
EOF EOF
cat >>confdefs.h <<EOF cat >>confdefs.h <<EOF

View File

@@ -2770,7 +2770,7 @@ if test X"$with_noexec" != X"no" -o X"$with_selinux" != X"no"; then
AC_DEFINE_UNQUOTED(_PATH_SUDO_SESH, "$sesh_file", [The fully qualified pathname of sesh]) AC_DEFINE_UNQUOTED(_PATH_SUDO_SESH, "$sesh_file", [The fully qualified pathname of sesh])
fi fi
eval PLUGINDIR="$with_plugindir" eval PLUGINDIR="$with_plugindir"
SUDO_DEFINE_UNQUOTED(_PATH_SUDO_PLUGIN_DIR, "$PLUGINDIR") SUDO_DEFINE_UNQUOTED(_PATH_SUDO_PLUGIN_DIR, "$PLUGINDIR/")
SUDO_DEFINE_UNQUOTED(SUDOERS_PLUGIN, "sudoers$_shrext2") SUDO_DEFINE_UNQUOTED(SUDOERS_PLUGIN, "sudoers$_shrext2")
exec_prefix="$oexec_prefix" exec_prefix="$oexec_prefix"
fi fi

View File

@@ -143,9 +143,9 @@ sudo_load_plugins(const char *conf_file,
if (strlcpy(path, info->path, sizeof(path)) >= sizeof(path)) if (strlcpy(path, info->path, sizeof(path)) >= sizeof(path))
errorx(1, "%s: %s", info->path, strerror(ENAMETOOLONG)); errorx(1, "%s: %s", info->path, strerror(ENAMETOOLONG));
} else { } else {
if (snprintf(path, sizeof(path), "%s/%s", _PATH_SUDO_PLUGIN_DIR, if (snprintf(path, sizeof(path), "%s%s", _PATH_SUDO_PLUGIN_DIR,
info->path) >= sizeof(path)) { info->path) >= sizeof(path)) {
errorx(1, "%s/%s: %s", _PATH_SUDO_PLUGIN_DIR, info->path, errorx(1, "%s%s: %s", _PATH_SUDO_PLUGIN_DIR, info->path,
strerror(ENAMETOOLONG)); strerror(ENAMETOOLONG));
} }
} }