commit bc18ef3a6de192846f4f2c35aee0012f0dd27afb from: Thomas Adam date: Fri Mar 21 16:24:59 2025 UTC portable: define _PW_NAME_LEN This portablu adds a definition for _PW_NAME_LEN if it's not found. Additionally, make socket options portable, and ensure gotctl is now buildable, as this has changed with respect to gotd, adding logging, etc. commit - 11b08149fcd8763628621149e6957161ac236fef commit + bc18ef3a6de192846f4f2c35aee0012f0dd27afb blob - c97e7d0e69b77f321536159f10324e7fb857b421 blob + 8226752df2d929f863f7f987c3b042d6e1c318e4 --- gotctl/Makefile.am +++ gotctl/Makefile.am @@ -6,11 +6,15 @@ AM_CPPFLAGS += -I$(top_builddir)/gotd gotctl_SOURCES = gotctl.c \ $(top_srcdir)/gotd/imsg.c \ + $(top_srcdir)/gotd/parse.y \ + $(top_srcdir)/gotd/secrets.c \ $(top_srcdir)/lib/error.c \ $(top_srcdir)/lib/hash.c \ + $(top_srcdir)/lib/log.c \ $(top_srcdir)/lib/object_qid.c \ $(top_srcdir)/lib/path.c \ - $(top_srcdir)/lib/pollfd.c + $(top_srcdir)/lib/pollfd.c \ + $(top_srcdir)/lib/reference_parse.c gotctl_DEPENDENCIES = $(top_builddir)/compat/libopenbsd-compat.a EXTRA_DIST = gotctl.8 blob - 77da458596ecb00f013cf151b97639966bcbe0da blob + d52dae80c5001553913ee94344f2d7f52c490959 --- gotd/gotd.c +++ gotd/gotd.c @@ -3078,7 +3078,12 @@ start_auth_child(struct gotd_client *client, int requi int daemonize, int verbosity) { struct gotd_child_proc *proc; + int sock_flags = SOCK_STREAM | SOCK_NONBLOCK; +#ifdef SOCK_CLOEXEC + sock_flags |= SOCK_CLOEXEC; +#endif + proc = calloc(1, sizeof(*proc)); if (proc == NULL) return got_error_from_errno("calloc"); blob - 57c83b55a87d19e7fd97463282757061ded30a78 blob + 0397dd38f1bad54ededab586d08d6405ed127a48 --- gotd/gotd.h +++ gotd/gotd.h @@ -649,6 +649,7 @@ struct gotd_imsg_notify { /* Followed by username_len data bytes. */ }; +int enter_chroot(const char *); int gotd_parse_config(const char *, int, enum gotd_procid, struct gotd_secrets *, struct gotd *); struct gotd_repo *gotd_find_repo_by_name(const char *, struct gotd_repolist *); blob - fb06ed9608e05a21544619ffe1cf9cfe3f7a25cf blob + 911bd5b30ed2d814e072b214bdb52e373c7c2072 --- include/got_compat2.h +++ include/got_compat2.h @@ -65,6 +65,9 @@ #define __attribute__(a) #endif +#ifndef _PW_NAME_LEN +#define _PW_NAME_LEN 31 /* max length, not counting NUL */ +#endif #ifndef UID_MAX # define UID_MAX UINT_MAX /* max value for a uid_t */