[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-inetutils] tests/syslogd.sh and /tmp
From: |
Simon Josefsson |
Subject: |
Re: [bug-inetutils] tests/syslogd.sh and /tmp |
Date: |
Thu, 19 Jan 2012 09:01:46 +0100 |
User-agent: |
Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.92 (gnu/linux) |
address@hidden (Ludovic Courtès) writes:
> Hello,
>
> tests/syslogd.sh requires a writable /tmp.
Looking further at that test, it seems buggy from another point of view
as well: the filenames are prone to a race condition when two or more
InetUtils instances is built at the same time. The filenames used are:
# This good name base consumes twentythree chracters.
IU_GOOD_BASE=/tmp/$(date +%y-%m-%d)_socket_iu
# Add a single character to violate the size condition.
IU_BAD_BASE=/tmp/X$(date +%y-%m-%d)_socket_iu
Further, having predictable filenames has often been used by non-root
users to mount a privilege-escalation attack (just wait until the root
user runs the script), but I haven't reviewed the script if it has this
problem as well.
Normal practice is to use 'mktemp'.
> The workaround I’ve used in Guile is to cd $TMPDIR, create ./my-socket,
> and use that.
I would prefer a mktemp+cd approach. It is the most secure, follows
best practices, and is the most portable.
/Simon
- Re: [bug-inetutils] tests/syslogd.sh and /tmp, (continued)
- Re: [bug-inetutils] tests/syslogd.sh and /tmp, Simon Josefsson, 2012/01/19
- Re: [bug-inetutils] tests/syslogd.sh and /tmp, Alfred M. Szmidt, 2012/01/21
- [bug-inetutils] Shell capabilities. (Was: tests/syslogd.sh and /tmp), Mats Erik Andersson, 2012/01/22
- Re: [bug-inetutils] Shell capabilities., Simon Josefsson, 2012/01/23
- Re: [bug-inetutils] Shell capabilities., Mats Erik Andersson, 2012/01/23
- Re: [bug-inetutils] tests/syslogd.sh and /tmp, Mats Erik Andersson, 2012/01/18
Re: [bug-inetutils] tests/syslogd.sh and /tmp, Ludovic Courtès, 2012/01/18
Re: [bug-inetutils] tests/syslogd.sh and /tmp,
Simon Josefsson <=
- Re: [bug-inetutils] tests/syslogd.sh and /tmp, Mats Erik Andersson, 2012/01/19
- Re: [bug-inetutils] tests/syslogd.sh and /tmp, Simon Josefsson, 2012/01/19
- Re: [bug-inetutils] tests/syslogd.sh and /tmp, Mats Erik Andersson, 2012/01/20
- Re: [bug-inetutils] tests/syslogd.sh and /tmp, Ludovic Courtès, 2012/01/22
- Re: [bug-inetutils] tests/syslogd.sh and /tmp, Mats Erik Andersson, 2012/01/22
- Re: [bug-inetutils] tests/syslogd.sh and /tmp, Mats Erik Andersson, 2012/01/25
- Re: [bug-inetutils] tests/syslogd.sh and /tmp, Ludovic Courtès, 2012/01/25
- Re: [bug-inetutils] tests/syslogd.sh and /tmp, Mats Erik Andersson, 2012/01/25
- Re: [bug-inetutils] tests/syslogd.sh and /tmp, Mats Erik Andersson, 2012/01/26
- Re: [bug-inetutils] tests/syslogd.sh and /tmp, Mats Erik Andersson, 2012/01/27