summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2016-03-10 23:09:18 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2016-03-10 23:09:18 +0000
commitfdafe0924a3ae3aaed33b087e3def90135c29e78 (patch)
tree6c6e38ee94c1957bc2de0201d6b8ed5de18b71bc
parent48c4828a08476d5eeea20f9a2fa3f866e902914e (diff)
downloads6-rc-fdafe0924a3ae3aaed33b087e3def90135c29e78.tar.xz
s6-rc-init bugfix: don't use satmp.s after cleanup(). For real this time.
-rw-r--r--src/s6-rc/s6-rc-init.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/s6-rc/s6-rc-init.c b/src/s6-rc/s6-rc-init.c
index e7ef023..98d07e5 100644
--- a/src/s6-rc/s6-rc-init.c
+++ b/src/s6-rc/s6-rc-init.c
@@ -99,8 +99,10 @@ int main (int argc, char const *const *argv)
lfn[llen] = 0 ;
if (symlink(satmp.s + dirlen, lfn) < 0)
{
+ char tmp[satmp.len - dirlen] ;
+ byte_copy(tmp, satmp.len - dirlen, satmp.s + dirlen) ;
cleanup() ;
- strerr_diefu4sys(111, "symlink ", satmp.s + dirlen, " to ", lfn) ;
+ strerr_diefu4sys(111, "symlink ", tmp, " to ", lfn) ;
}