2014-08-18 15:51 GMT+02:00 Lennart Poettering <[email protected]>:
> On Sat, 16.08.14 14:24, Ronny Chevalier ([email protected]) wrote:
>
> What's the rationale here? I think it makes a lot of sense to output an
> error if people drop non-executable files in such a directory...
>
Yeah it makes sense. But it is useless to fork & exec() when we know
it will fail so maybe leave the check and add a warning ?

>> ---
>>  src/shared/util.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/src/shared/util.c b/src/shared/util.c
>> index 18d40f3..3a03470 100644
>> --- a/src/shared/util.c
>> +++ b/src/shared/util.c
>> @@ -3921,6 +3921,10 @@ void execute_directory(const char *directory, DIR *d, 
>> usec_t timeout, char *argv
>>                                  _exit(EXIT_FAILURE);
>>                          }
>>
>> +                        if (access(path, X_OK) < 0) {
>> +                                continue;
>> +                        }
>> +
>>                          pid = fork();
>>                          if (pid < 0) {
>>                                  log_error("Failed to fork: %m");
>
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to