Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scapy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def _create_fifo() -> Tuple[str, Any]:
else:
f = get_temp_file()
os.unlink(f)
os.mkfifo(f)
os.mkfifo(f, 0o600)
return f, f


Expand Down
17 changes: 17 additions & 0 deletions test/regression.uts
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,23 @@ conf.prog.extcap_folders = _bkp_extcap
conf.ifaces.providers = _bkp_providers
conf.ifaces.reload()

= Extcap FIFO is accessible only by its owner

import stat
from scapy.utils import _create_fifo

if not WINDOWS:
old_umask = os.umask(0o022)
try:
fifo, _ = _create_fifo()
finally:
os.umask(old_umask)
try:
assert stat.S_IMODE(os.stat(fifo).st_mode) == 0o600
finally:
os.unlink(fifo)
conf.temp_files.remove(fifo)

= Test read_routes6() - default output

routes6 = read_routes6()
Expand Down
Loading