New package: opendoas-0.1

This commit is contained in:
Duncaen 2016-05-29 20:44:35 +02:00
parent 6aaaa67ce4
commit 6fb99d8e6f
4 changed files with 82 additions and 0 deletions

8
srcpkgs/opendoas/INSTALL Normal file
View File

@ -0,0 +1,8 @@
#
# This script sets up correct perms for usr/bin/doas.
#
case "${ACTION}" in
post)
chmod 4111 usr/bin/doas
;;
esac

View File

@ -0,0 +1,6 @@
#%PAM-1.0
#auth sufficient pam_timestamp.so timestamp_timeout=300 verbose
#session optional pam_timestamp.so timestamp_timeout=300
auth include system-auth
account include system-auth
session include system-auth

View File

@ -0,0 +1,42 @@
--- bsd.prog.mk
+++ bsd.prog.mk
@@ -14,7 +14,7 @@ libopenbsd.a: ${OPENBSD}
${AR} -r $@ $?
${PROG}: ${OBJS} libopenbsd.a
- ${CC} ${CFLAGS} ${LDFLAGS} $^ -o $@
+ ${CC} ${CFLAGS} $^ -o $@ ${LDFLAGS}
install: ${PROG} ${PAM_DOAS} ${MAN}
mkdir -p -m 0755 ${DESTDIR}${BINDIR}
@@ -22,7 +22,6 @@ install: ${PROG} ${PAM_DOAS} ${MAN}
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}
cp ${PAM_DOAS} ${DESTDIR}${PAMDIR}/doas
chmod 0644 ${DESTDIR}${PAMDIR}/doas
--- doas.c
+++ doas.c
@@ -295,7 +295,9 @@ checkconfig(const char *confpath, int argc, char **argv,
{
struct rule *rule;
- setresuid(uid, uid, uid);
+ if (setresuid(uid, uid, uid) != 0)
+ err(1, "can't setresuid");
+
parseconfig(confpath, 0);
if (!argc)
exit(0);
--- libopenbsd/openbsd.h
+++ libopenbsd/openbsd.h
@@ -3,7 +3,6 @@
#include <stdarg.h>
#include <sys/types.h>
-#include <sys/cdefs.h>
#include "readpassphrase.h"

26
srcpkgs/opendoas/template Normal file
View File

@ -0,0 +1,26 @@
# Template file for 'opendoas'
pkgname=opendoas
version=0.1
revision=1
wrksrc="OpenDoas-$version"
build_style=configure
conf_files="/etc/pam.d/doas"
hostmakedepends="bison"
makedepends="pam-devel"
short_desc="Portable OpenBSD doas to execute commands as another user"
maintainer="Duncaen <duncaen@voidlinux.eu>"
license="BSD"
homepage="https://github.com/Duncaen/OpenDoas"
distfiles="https://github.com/Duncaen/OpenDoas/archive/v${version}.tar.gz"
checksum=468fb97307e4ac4c6b92931a2e315fd2b6201f7e82a4db25ec2aa6f6d8b3627e
CFLAGS="-Wno-unused-result"
pre_configure() {
cp ${FILESDIR}/doas.pam pam.d__doas__linux
export VERSION=$version BINGRP=root
}
post_install() {
vlicense LICENSE
}