opendoas

my fork of doas with custom prompt
git clone git://git.kocotian.pl/opendoas.git
Log | Files | Refs | README | LICENSE

commit 84ccfe0b9ac591199d0464ede10a4130c8a3482d
parent 50a47d3b7e587fabcce85bc5af10450a3707821a
Author: Sunil Nimmagadda <sunil@nimmagadda.net>
Date:   Mon,  2 Nov 2020 11:54:29 +0530

Honor --sysconfdir option for doas.conf path.

Some distributions may choose to place configuration files in a different
directory than /etc. The configure script provides --sysconfdir
option already, use it to find doas.conf path instead of hardcoding
'/etc/doas.conf'.

Diffstat:
Mbsd.prog.mk | 2++
Mdoas.c | 2+-
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/bsd.prog.mk b/bsd.prog.mk @@ -6,6 +6,8 @@ CFLAGS += -I${CURDIR}/libopenbsd ${COPTS} -MD -MP -Wno-unused-result include config.mk +CFLAGS += -DDOAS_CONF="\"${SYSCONFDIR}/doas.conf\"" + OPENBSD := $(addprefix libopenbsd/,${OPENBSD}) OBJS := ${SRCS:.y=.c} OBJS := ${OBJS:.c=.o} diff --git a/doas.c b/doas.c @@ -325,7 +325,7 @@ main(int argc, char **argv) if (geteuid()) errx(1, "not installed setuid"); - parseconfig("/etc/doas.conf", 1); + parseconfig(DOAS_CONF, 1); /* cmdline is used only for logging, no need to abort on truncate */ (void)strlcpy(cmdline, argv[0], sizeof(cmdline));