Skip to content

Commit

Permalink
remove pam.d configuration files
Browse files Browse the repository at this point in the history
pam configuration files are not portable, its the job of the
package maintainer or user who builds opendoas themselves to
configure pam in a safe and usable way.
  • Loading branch information
Duncaen committed Jan 28, 2021
1 parent 24b1a95 commit cfa9f0d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 20 deletions.
5 changes: 1 addition & 4 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ OBJS:= ${OBJS:.c=.o}
${PROG}: ${OBJS}
${CC} ${CFLAGS} $^ -o $@ ${LDFLAGS} ${LDLIBS}

install: ${PROG} ${PAM_DOAS} ${MAN}
install: ${PROG} ${MAN}
mkdir -p -m 0755 ${DESTDIR}${BINDIR}
[ -n "${PAM_DOAS}" ] && mkdir -p -m 0755 ${DESTDIR}${PAMDIR} || true
mkdir -p -m 0755 ${DESTDIR}${MANDIR}/man1
mkdir -p -m 0755 ${DESTDIR}${MANDIR}/man5
cp -f ${PROG} ${DESTDIR}${BINDIR}
chown ${BINOWN}:${BINGRP} ${DESTDIR}${BINDIR}/${PROG}
chmod ${BINMODE} ${DESTDIR}${BINDIR}/${PROG}
[ -n "${PAM_DOAS}" ] && cp ${PAM_DOAS} ${DESTDIR}${PAMDIR}/doas || true
[ -n "${PAM_DOAS}" ] && chmod 0644 ${DESTDIR}${PAMDIR}/doas || true
cp -f doas.1 ${DESTDIR}${MANDIR}/man1
cp -f doas.conf.5 ${DESTDIR}${MANDIR}/man5

Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ from openssh (`readpassphrase.c`) or from sudo (`closefrom.c`).

The PAM and shadow authentication code does not come from the OpenBSD project.

### pam configuration

I will not ship pam configuration files, they are distribution specific and
its simply not safe or productive to ship and install those files.

If you want to use opendoas on your system and there is no package that
ships with a working pam configuration file, then you have to write and
test it yourself.

A good starting point is probably the distribution maintained `/etc/pam.d/sudo`
file.

### Perist/Timestamp/Timeout

The persist feature is disabled by default and can be enabled with the configure
Expand Down
7 changes: 0 additions & 7 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ usage: configure [options]
--datadir=DIR architecture-independent data files [PREFIX/share]
--mandir=DIR manual pages [DATADIR/man]
--sysconfdir=DIR directory for configuration files [/etc]
--pamdir=DIR PAM directory [SYSCONFDIR/pam.d]
--build=build-alias a cpu-vendor-opsys for the system where the application will be built
--host=host-alias a cpu-vendor-opsys for the system where the application will run
Expand Down Expand Up @@ -52,7 +51,6 @@ for x; do
--datadir) SHAREDIR=$var ;;
--mandir) MANDIR=$var ;;
--sysconfdir) SYSCONFDIR=$var ;;
--pamdir) PAMDIR=$var ;;
--build) BUILD=$var ;;
--host) HOST=$var ;;
--target) TARGET=$var ;;
Expand Down Expand Up @@ -134,7 +132,6 @@ esac
: ${SHAREDIR:=${PREFIX}/share}
: ${MANDIR:=${SHAREDIR}/man}
: ${SYSCONFDIR:=/etc}
: ${PAMDIR:=${SYSCONFDIR}/pam.d}
: ${BINMODE:=4755}
: ${BINOWN:=root}
: ${BINGRP:=root}
Expand All @@ -146,7 +143,6 @@ BINDIR ?= ${BINDIR}
SHAREDIR ?= ${SHAREDIR}
MANDIR ?= ${MANDIR}
SYSCONFDIR?= ${SYSCONFDIR}
PAMDIR ?= ${PAMDIR}
BINMODE ?= ${BINMODE}
BINOWN ?= ${BINOWN}
BINGRP ?= ${BINGRP}
Expand Down Expand Up @@ -203,9 +199,6 @@ int main(void) {
printf 'LDLIBS += -lpam\n' >>$CONFIG_MK
printf '#define USE_PAM\n' >>$CONFIG_H
printf 'pam\n'

pam_file="pam.d__doas__${OS}"
[ -e "$pam_file" ] && printf 'PAM_DOAS = %s\n' "$pam_file" >>$CONFIG_MK
return 0
}

Expand Down
5 changes: 0 additions & 5 deletions pam.d__doas__darwin

This file was deleted.

4 changes: 0 additions & 4 deletions pam.d__doas__linux

This file was deleted.

0 comments on commit cfa9f0d

Please sign in to comment.