• Dridi Boukelmoune's avatar
    vslc: Plug mmap file descriptor leak · e3e2ef33
    Dridi Boukelmoune authored
    To be consistent with how the file cursor behaves, the close_fd field is
    duplicated in the mmap cursor. If a VUT replaces stdin's file descriptor
    with a regular file's fd using dup2(2), we don't want to close it just
    because we managed to mmap(2) it.
    
    For some reason we don't use the closefd() macro in the VSL cursor code,
    potentially to avoid its underlying assertion in libvarnishapi.
    
    On the other hand we do use it in other places:
    
        $ git grep -l closefd -- lib/libvarnishapi/
        lib/libvarnishapi/daemon.c
        lib/libvarnishapi/vsm.c
    
    So maybe in a subsequent change `(void)close(fd)` statements could turn
    into `closefd(&fd)` in vsl_cursor.c to harden those code paths as well.
    e3e2ef33
Name
Last commit
Last update
..
Makefile.am Loading commit data...
daemon.c Loading commit data...
flint.lnt Loading commit data...
flint.sh Loading commit data...
generate.py Loading commit data...
libvarnishapi.map Loading commit data...
vsc.c Loading commit data...
vsig.c Loading commit data...
vsl.c Loading commit data...
vsl2rst.c Loading commit data...
vsl_api.h Loading commit data...
vsl_arg.c Loading commit data...
vsl_cursor.c Loading commit data...
vsl_dispatch.c Loading commit data...
vsl_glob_test.c Loading commit data...
vsl_glob_test_coverage.sh Loading commit data...
vsl_query.c Loading commit data...
vsm.c Loading commit data...
vut.c Loading commit data...
vxp.c Loading commit data...
vxp.h Loading commit data...
vxp_lexer.c Loading commit data...
vxp_parse.c Loading commit data...
vxp_test.c Loading commit data...
vxp_test_coverage.sh Loading commit data...