summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/s6-rc-init.html4
-rw-r--r--src/s6-rc/s6-rc-init.c3
-rw-r--r--src/s6-rc/s6-rc-update.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/doc/s6-rc-init.html b/doc/s6-rc-init.html
index 0fe00ba..2e9c88c 100644
--- a/doc/s6-rc-init.html
+++ b/doc/s6-rc-init.html
@@ -32,8 +32,8 @@ invocation of the
</pre>
<ul>
- <li> <em>compiled</em> (if the <tt>-d</tt> option hasn't been given)
-and <em>scandir</em> must be absolute paths. </li>
+ <li> <em>compiled</em> (if the <tt>-d</tt> option hasn't been given),
+<em>live</em> and <em>scandir</em> must be absolute paths. </li>
<li> s6-rc-init expects to find a <em>compiled service database</em>
in <em>compiled</em>. It expects to be able to create a directory
named <em>live</em>. It also expects that an instance of
diff --git a/src/s6-rc/s6-rc-init.c b/src/s6-rc/s6-rc-init.c
index dfc7b7c..fd08e89 100644
--- a/src/s6-rc/s6-rc-init.c
+++ b/src/s6-rc/s6-rc-init.c
@@ -60,6 +60,8 @@ int main (int argc, char const *const *argv)
if (!deref && compiled[0] != '/')
strerr_dief2x(100, compiled, " is not an absolute path") ;
+ if (live[0] != '/')
+ strerr_dief2x(100, live, " is not an absolute path") ;
if (argv[0][0] != '/')
strerr_dief2x(100, argv[0], " is not an absolute path") ;
if (strchr(prefix, '/') || strchr(prefix, '\n'))
@@ -101,6 +103,7 @@ int main (int argc, char const *const *argv)
memcpy(lfn + sa.len, "/servicedirs", 13) ;
memcpy(cfn, compiled, clen) ;
memcpy(cfn + clen, "/servicedirs", 13) ;
+ sa.len++ ;
if (!hiercopy(cfn, lfn))
{
cleanup(&sa) ;
diff --git a/src/s6-rc/s6-rc-update.c b/src/s6-rc/s6-rc-update.c
index cf17eaf..2c7ba9d 100644
--- a/src/s6-rc/s6-rc-update.c
+++ b/src/s6-rc/s6-rc-update.c
@@ -589,6 +589,8 @@ int main (int argc, char const *const *argv, char const *const *envp)
else deadline = tain_infinite_relative ;
}
if (!argc) dieusage() ;
+ if (live[0] != '/')
+ strerr_dief2x(100, live, " is not an absolute path") ;
if (argv[0][0] != '/')
strerr_dief2x(100, argv[0], " is not an absolute path") ;
livelen = strlen(live) ;