Commit 5a5e0168 authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

fix/proftpd: socket created in software

When proftpd software release is tested locally, the socket named /srv/slapgrid/slappart76/srv/runner/instance/slappart1/tmp/soft/91d420e3970a2088e648d2eb86e155ea/parts/prof is created but never removed.
First it is not an appropriated directory to create a socket and then not removing this socket leads to an error if tests are run a second time :

subprocess.CalledProcessError: Command '('ldd', '/srv/slapgrid/slappart76/srv/runner/instance/sla
ppart1/tmp/soft/91d420e3970a2088e648d2eb86e155ea/parts/prof')' returned non-zero exit status 1.

----------------------------------------------------------------------
Ran 0 tests in 9.914s

FAILED (errors=1)

This is due to code in https://github.com/proftpd/proftpd/blob/master/src/ctrls.c :

const char *socket_path = PR_RUN_DIR "/test.sock"; // socket_path="/srv/slapgrid/slappart76/srv/runner/instance/slappart1/tmp/soft/91d420e3970a2088e648d2eb86e155ea/parts/proftp/var/test.sock"
sstrncpy(sockun.sun_path, socket_path, sizeof(sockun.sun_path)); // sockun.sun_path="/srv/slapgrid/slappart76/srv/runner/instance/slappart1/tmp/soft/91d420e3970a2088e648d2eb86e155ea/parts/prof"

where `sun_path` is limited to UNIX_PATH_MAX (108 characters): char sun_path[UNIX_PATH_MAX]; https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/un.h#L9
parent ee19a181
......@@ -32,7 +32,8 @@ configure-options =
--disable-cap
--with-modules=mod_sftp:mod_ban
--prefix=${buildout:parts-directory}/${:_buildout_section_name_}
environment =
environment =
CFLAGS=-DPR_RUN_DIR=\"/proc/self/cwd/var\"
CPPFLAGS=-I${zlib:location}/include -I${openssl:location}/include
LDFLAGS=-L${zlib:location}/lib -Wl,-rpath=${zlib:location}/lib -L${openssl:location}/lib -Wl,-rpath=${openssl:location}/lib
install_user=${proftpd-environment:USER}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment