File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -55,13 +55,17 @@ elif [[ "$1" == "--as-listener--" ]] ; then
5555 # remember processid to be able kill it
5656 nc_procid=$!
5757
58- # protect socket and log file from reading
59- chmod -f 0700 $listener_socket $listener_socket .log
58+ # protect log file from reading
59+ chmod -f 0700 $listener_socket .log
6060
61- # remove netcat listening on socket
61+ # cleanup netcat listening on socket at the end
6262 trap " kill -SIGINT $nc_procid >/dev/null 2>&1; rm -f $listener_socket .log" 0 1 2 3 6
6363
6464 while [[ ($flag -ne 0) && (-f $listener_socket .log) ]] ; do
65+ # protect socket from reading
66+ if [ -S $listener_socket ] ; then
67+ chmod -f 0700 $listener_socket
68+ fi
6569
6670 line=$( sed " ${NUM} q;d" $listener_socket .log)
6771
You can’t perform that action at this time.
0 commit comments