diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-12-23 10:49:12 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-12-23 10:49:12 +0000 |
commit | 5ae06a9a14c43fd36425f1c280158608948be303 (patch) | |
tree | a4f14b1ef71310df1b7fe9a3a7515355d22681e1 /src | |
parent | 611b1b713b2ae19dc633c3fdaab2accbaa9f32a4 (diff) | |
download | s6-rc-5ae06a9a14c43fd36425f1c280158608948be303.tar.xz |
live actually needs to be an absolute path for s6-rc-init and s6-rc-update
Diffstat (limited to 'src')
-rw-r--r-- | src/s6-rc/s6-rc-init.c | 3 | ||||
-rw-r--r-- | src/s6-rc/s6-rc-update.c | 2 |
2 files changed, 5 insertions, 0 deletions
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) ; |