Skip to content

Commit

Permalink
privsep: No need for a CHROOT reason now
Browse files Browse the repository at this point in the history
  • Loading branch information
rsmarples committed May 24, 2020
1 parent 709e6b1 commit dc7c9d8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 26 deletions.
4 changes: 1 addition & 3 deletions hooks/dhcpcd-run-hooks.8.in
Expand Up @@ -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
Expand Down Expand Up @@ -84,8 +84,6 @@ Here's a list of reasons why
.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
Expand Down
3 changes: 1 addition & 2 deletions src/dhcpcd.c
Expand Up @@ -2174,8 +2174,7 @@ main(int argc, char **argv)
freopen(_PATH_DEVNULL, "r", stdin);

#ifdef PRIVSEP
if (ps_init(&ctx) == 0)
script_runchroot(&ctx);
ps_init(&ctx);
#endif

#ifdef USE_SIGNALS
Expand Down
20 changes: 0 additions & 20 deletions src/script.c
Expand Up @@ -734,23 +734,3 @@ script_runreason(const struct interface *ifp, const char *reason)

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
1 change: 0 additions & 1 deletion src/script.h
Expand Up @@ -37,5 +37,4 @@ char ** script_buftoenv(struct dhcpcd_ctx *, char *, size_t);
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

0 comments on commit dc7c9d8

Please sign in to comment.