mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 09:34:24 +01:00
plugin: Ignore directories in the plugin-directory
They pass the executable test, but aren't really executable. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
committed by
Rusty Russell
parent
561a66354b
commit
83ecb61890
@@ -664,7 +664,11 @@ static const char *plugin_fullpath(const tal_t *ctx, const char *dir,
|
||||
fullname = path_join(ctx, dir, basename);
|
||||
if (stat(fullname, &st) != 0)
|
||||
return tal_free(fullname);
|
||||
if (!(st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)))
|
||||
if (!(st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) || st.st_mode & S_IFDIR)
|
||||
return tal_free(fullname);
|
||||
|
||||
/* Ignore directories, they have exec mode, but aren't executable. */
|
||||
if (st.st_mode & S_IFDIR)
|
||||
return tal_free(fullname);
|
||||
return fullname;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user