jobstart(): Fix hang on non-executable cwd #9204

* os/fs.c: add os_isdir_executable()
* eval.c: fix hang on job start caused by non-executable cwd option
* channel.c: assert cwd is an executable directory
* test: jobstart() produces error when using non-executable cwd
This commit is contained in:
Tommy Allen
2018-11-07 04:31:25 -05:00
committed by Justin M. Keyes
parent 769d164c70
commit c4c74c3883
4 changed files with 36 additions and 3 deletions

View File

@@ -284,6 +284,8 @@ Channel *channel_job_start(char **argv, CallbackReader on_stdout,
uint16_t pty_width, uint16_t pty_height,
char *term_name, varnumber_T *status_out)
{
assert(cwd == NULL || os_isdir_executable(cwd));
Channel *chan = channel_alloc(kChannelStreamProc);
chan->on_stdout = on_stdout;
chan->on_stderr = on_stderr;