Trim trailing slashes of plug-in paths
This commit is contained in:
@@ -201,6 +201,21 @@ is_valid_plugin_filename(const char * n)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
trim_trailing_slash(char * path)
|
||||||
|
{
|
||||||
|
size_t l;
|
||||||
|
|
||||||
|
l = strlen(path);
|
||||||
|
while (l > 0 && (path[l - 1] == '/'
|
||||||
|
#ifdef BACKSLASH_PATH_DELIM
|
||||||
|
|| path[l - 1] == '\\'
|
||||||
|
#endif
|
||||||
|
)) {
|
||||||
|
path[--l] = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static krb5_error_code
|
static krb5_error_code
|
||||||
load_plugins(krb5_context context)
|
load_plugins(krb5_context context)
|
||||||
{
|
{
|
||||||
@@ -230,6 +245,8 @@ load_plugins(krb5_context context)
|
|||||||
goto next_dir;
|
goto next_dir;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
trim_trailing_slash(dir);
|
||||||
|
|
||||||
d = opendir(dir);
|
d = opendir(dir);
|
||||||
|
|
||||||
if (d == NULL)
|
if (d == NULL)
|
||||||
|
Reference in New Issue
Block a user