diff options
author | Colin Watson <cjwatson@debian.org> | 2017-01-03 12:09:42 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2017-01-03 12:23:00 +0000 |
commit | cc50ca70e3b438577c33a85147e2a68666deaad9 (patch) | |
tree | 61580f79d8af26080488ad21d994fdec5af85a29 /regress/test-exec.sh | |
parent | d225c4fe44ad94a30a5033e58594f2bebaa674f2 (diff) |
Create mux socket for regress in temp directory
In some setups, creating the socket under OBJ may result in a path that
is too long for a Unix domain socket. Add a helper to let us portably
create a temporary directory instead.
Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=2660
Last-Update: 2017-01-03
Patch-Name: regress-mktemp.patch
Diffstat (limited to 'regress/test-exec.sh')
-rw-r--r-- | regress/test-exec.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/regress/test-exec.sh b/regress/test-exec.sh index bfa48803b..13a8e18f3 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh | |||
@@ -317,6 +317,14 @@ stop_sshd () | |||
317 | fi | 317 | fi |
318 | } | 318 | } |
319 | 319 | ||
320 | TMP= | ||
321 | |||
322 | make_tmpdir () | ||
323 | { | ||
324 | TMP="$($OBJ/mkdtemp openssh-regress-XXXXXXXXXXXX)" || \ | ||
325 | fatal "failed to create temporary directory" | ||
326 | } | ||
327 | |||
320 | # helper | 328 | # helper |
321 | cleanup () | 329 | cleanup () |
322 | { | 330 | { |
@@ -327,6 +335,9 @@ cleanup () | |||
327 | kill $SSH_PID | 335 | kill $SSH_PID |
328 | fi | 336 | fi |
329 | fi | 337 | fi |
338 | if [ "x$TMP" != "x" ]; then | ||
339 | rm -rf "$TMP" | ||
340 | fi | ||
330 | stop_sshd | 341 | stop_sshd |
331 | } | 342 | } |
332 | 343 | ||