git: 4ec063fe52d8 - main - security/su-exec: New port: Switch user and group id and exec

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Wed, 09 Aug 2023 13:04:48 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4ec063fe52d807eda49f54beb910ca5b3d434d2e

commit 4ec063fe52d807eda49f54beb910ca5b3d434d2e
Author:     Jesús Daniel Colmenares Oviedo <DtxdF@disroot.org>
AuthorDate: 2023-08-08 08:32:44 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-08-09 13:01:35 +0000

    security/su-exec: New port: Switch user and group id and exec
    
    su-exec is a simple tool that will simply execute a program with
    different privileges. The program will be executed directly and not
    run as a child, like su and sudo does, which avoids TTY and signal
    issues.
    
    WWW: https://github.com/ncopa/su-exec
    
    PR:             272867
---
 security/Makefile          |  1 +
 security/su-exec/Makefile  | 33 +++++++++++++++++++++++++++++++++
 security/su-exec/distinfo  |  3 +++
 security/su-exec/pkg-descr |  4 ++++
 4 files changed, 41 insertions(+)

diff --git a/security/Makefile b/security/Makefile
index 494ad774b480..cda821d223e4 100644
--- a/security/Makefile
+++ b/security/Makefile
@@ -1285,6 +1285,7 @@
     SUBDIR += sudo
     SUBDIR += sudoscript
     SUBDIR += super
+    SUBDIR += su-exec
     SUBDIR += suricata
     SUBDIR += swatchdog
     SUBDIR += tailscale
diff --git a/security/su-exec/Makefile b/security/su-exec/Makefile
new file mode 100644
index 000000000000..02a4a5c4ab5b
--- /dev/null
+++ b/security/su-exec/Makefile
@@ -0,0 +1,33 @@
+PORTNAME=	su-exec
+DISTVERSIONPREFIX=	v
+DISTVERSION=	0.2
+CATEGORIES=	security
+
+MAINTAINER=	DtxdF@disroot.org
+COMMENT=	Switch user and group id and exec
+WWW=		https://github.com/ncopa/su-exec
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+FLAVORS=			default static
+default_CONFLICTS_INSTALL=	su-exec-static
+static_PKGNAMESUFFIX=		-static
+static_CONFLICTS_INSTALL=	su-exec
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	ncopa
+
+.if ${FLAVOR:U} == static
+LDFLAGS+=	-static
+.endif
+
+PLIST_FILES=	bin/su-exec
+
+do-build:
+	cd ${WRKSRC} && ${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -o su-exec su-exec.c
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/su-exec ${STAGEDIR}${PREFIX}/bin
+
+.include <bsd.port.mk>
diff --git a/security/su-exec/distinfo b/security/su-exec/distinfo
new file mode 100644
index 000000000000..bb9ae6f6cb03
--- /dev/null
+++ b/security/su-exec/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1690896135
+SHA256 (ncopa-su-exec-v0.2_GH0.tar.gz) = ec4acbd8cde6ceeb2be67eda1f46c709758af6db35cacbcde41baac349855e25
+SIZE (ncopa-su-exec-v0.2_GH0.tar.gz) = 2426
diff --git a/security/su-exec/pkg-descr b/security/su-exec/pkg-descr
new file mode 100644
index 000000000000..d9eb12dd208a
--- /dev/null
+++ b/security/su-exec/pkg-descr
@@ -0,0 +1,4 @@
+su-exec is a simple tool that will simply execute a program with
+different privileges. The program will be executed directly and not
+run as a child, like su and sudo does, which avoids TTY and signal
+issues.