Project

General

Profile

Actions

Bug #1078

closed

storescp leaks sockets to child process

Added by Marco Eichelberg about 2 years ago. Updated 12 months ago.

Status:
Closed
Priority:
Normal
Category:
Library and Apps
Target version:
Start date:
2023-06-07
Due date:
% Done:

100%

Estimated time:
3:00 h
Module:
dcmnet
Operating System:
Compiler:

Description

When storescp ist started with "--exec-on-reception", it leaks the open sockets (the listen socket and the association socket) to it's child process :

# storescp --exec-on-reception /tmp/showfd 1234
lrwx------ 1 root root 64 May 30 10:42 0 -> /dev/pts/4
lrwx------ 1 root root 64 May 30 10:42 1 -> /dev/pts/4
lrwx------ 1 root root 64 May 30 10:42 2 -> /dev/pts/4
lrwx------ 1 root root 64 May 30 10:42 3 -> 'socket:[160398]'
lrwx------ 1 root root 64 May 30 10:42 4 -> 'socket:[160401]'

/tmp/showfd is :

#!/bin/bash

ls -l /proc/$$/fd

the same problem occurs with the 'receiver_application' and 'spooler_application' in dviface.
You could prevent this by opening sockets with the extra flag 'SOCK_CLOEXEC' .

Reported 2023-05-30 by Christian Wetzel <>.

Actions

Also available in: Atom PDF