From 1719a60278cf36558b568349c0c9f9b5eb91c999 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 28 Aug 2021 23:56:14 +0000 Subject: s6-svdir-(un)link fixes Signed-off-by: Laurent Bercot --- src/supervision/s6-svdir-link.c | 3 ++- src/supervision/s6-svdir-unlink.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/supervision') diff --git a/src/supervision/s6-svdir-link.c b/src/supervision/s6-svdir-link.c index 6eeb0a2..8329197 100644 --- a/src/supervision/s6-svdir-link.c +++ b/src/supervision/s6-svdir-link.c @@ -91,7 +91,8 @@ int main (int argc, char const *const *argv) if (argc < 3) dieusage() ; if (!argv[0][0]) strerr_dief1x(100, "invalid scandir") ; - if (!argv[1][0]) strerr_dief1x(100, "invalid name") ; + if (!argv[1][0] || argv[1][0] == '.' || argv[1][0] == '/') + strerr_dief1x(100, "invalid name") ; if (!argv[2][0]) strerr_dief1x(100, "invalid servicedir") ; checkscandir(argv[0]) ; diff --git a/src/supervision/s6-svdir-unlink.c b/src/supervision/s6-svdir-unlink.c index 88eedbe..0e8699e 100644 --- a/src/supervision/s6-svdir-unlink.c +++ b/src/supervision/s6-svdir-unlink.c @@ -31,6 +31,8 @@ int main (int argc, char const *const *argv) } if (argc < 2) dieusage() ; + if (!argv[1][0] || argv[1][0] == '.' || argv[1][0] == '/') + strerr_dief1x(100, "invalid service name") ; s6_supervise_unlink(argv[0], argv[1], options) ; return 0 ; } -- cgit v1.2.3