Mercurial > hg > dhcpcd
changeset 5259:d569724efab3 draft
privsep: No need for a CHROOT reason now
| author | Roy Marples <roy@marples.name> |
|---|---|
| date | Sun, 24 May 2020 05:54:40 +0000 |
| parents | f29e384aa13e |
| children | 7571d82b48da |
| files | hooks/dhcpcd-run-hooks.8.in src/dhcpcd.c src/script.c src/script.h |
| diffstat | 4 files changed, 2 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/hooks/dhcpcd-run-hooks.8.in Sun May 24 05:47:14 2020 +0000 +++ b/hooks/dhcpcd-run-hooks.8.in Sun May 24 05:54:40 2020 +0000 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 28, 2020 +.Dd May 24, 2020 .Dt DHCPCD-RUN-HOOKS 8 .Os .Sh NAME @@ -84,8 +84,6 @@ .Nm could be invoked: .Bl -tag -width EXPIREXXXEXPIRE6 -.It Dv CHROOT -dhcpcd is starting up and needs to configure a chroot environment. .It Dv PREINIT dhcpcd is starting up and any pre-initialisation should be done. .It Dv CARRIER
--- a/src/dhcpcd.c Sun May 24 05:47:14 2020 +0000 +++ b/src/dhcpcd.c Sun May 24 05:54:40 2020 +0000 @@ -2174,8 +2174,7 @@ freopen(_PATH_DEVNULL, "r", stdin); #ifdef PRIVSEP - if (ps_init(&ctx) == 0) - script_runchroot(&ctx); + ps_init(&ctx); #endif #ifdef USE_SIGNALS
--- a/src/script.c Sun May 24 05:47:14 2020 +0000 +++ b/src/script.c Sun May 24 05:54:40 2020 +0000 @@ -734,23 +734,3 @@ return status; } - -#ifdef PRIVSEP -int -script_runchroot(struct dhcpcd_ctx *ctx) -{ - char *argv[2]; - - /* Make our env */ - if (make_env(ctx, NULL, "CHROOT") == -1) { - logerr(__func__); - return -1; - } - - argv[0] = ctx->script; - argv[1] = NULL; - logdebugx("executing `%s' %s", argv[0], "CHROOT"); - - return script_run(ctx, argv); -} -#endif
--- a/src/script.h Sun May 24 05:47:14 2020 +0000 +++ b/src/script.h Sun May 24 05:54:40 2020 +0000 @@ -37,5 +37,4 @@ pid_t script_exec(char *const *, char *const *); int send_interface(struct fd_list *, const struct interface *, int); int script_runreason(const struct interface *, const char *); -int script_runchroot(struct dhcpcd_ctx *); #endif
