pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
dma: Partially untangle DMA_ROOT_USER (upstream) confusion
Module Name: pkgsrc-wip
Committed By: Greg Troxel <gdt%lexort.com@localhost>
Pushed By: gdt
Date: Thu Nov 26 09:10:43 2026 -0500
Changeset: c4b407f1efc7a4b57f87cb33d3725e4ad8899a36
Modified Files:
dma/Makefile
dma/TODO
Log Message:
dma: Partially untangle DMA_ROOT_USER (upstream) confusion
Add a URL to upstream report "DMA_ROOT_USER considered confusing".
Rename the package variable to the normal DMA_USER. Move the setting
into the "!unpriv" conditional arm, and guess at appropriate values
within the unpriv arm, with a TODO marker.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=c4b407f1efc7a4b57f87cb33d3725e4ad8899a36
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
dma/Makefile | 19 ++++++++++++++-----
dma/TODO | 33 ++++-----------------------------
2 files changed, 18 insertions(+), 34 deletions(-)
diffs:
diff --git a/dma/Makefile b/dma/Makefile
index d7f054a678..3ab33f50fb 100644
--- a/dma/Makefile
+++ b/dma/Makefile
@@ -1,6 +1,7 @@
# $NetBSD$
DISTNAME= dma-0.14
+PKGREVISION= 1
CATEGORIES= mail
MASTER_SITES= ${MASTER_SITE_GITHUB:=corecode/}
GITHUB_TAG= v${PKGVERSION_NOREV}
@@ -28,14 +29,19 @@ USE_CC_FEATURES= c99
.include "../../mk/bsd.prefs.mk"
-DMA_GROUP?= dma
-DMA_ROOT_USER?= dma
DMA_SPOOLDIR= ${VARBASE}/spool/dma
.if ${UNPRIVILEGED:tl} == "yes"
+DMA_USER?= ${UNPRIVILEGED_USER}
+DMA_GROUP?= ${UNPRIVILEGED_GROUP}
+
+# TODO: Explain whether or not and why not allowing group write is appropriate
OWN_DIRS_PERMS+= ${DMA_SPOOLDIR} ${UNPRIVILEGED_USER} ${UNPRIVILEGED_GROUP} 0700
.else
-OWN_DIRS_PERMS+= ${DMA_SPOOLDIR} ${DMA_ROOT_USER} ${DMA_GROUP} 0770
+DMA_USER?= dma
+DMA_GROUP?= dma
+
+OWN_DIRS_PERMS+= ${DMA_SPOOLDIR} ${DMA_USER} ${DMA_GROUP} 0770
# Upstream makefile sets sgid/suid but we patched that out.
# dma is sgid for queue access
SPECIAL_PERMS+= ${PREFIX}/libexec/dma \
@@ -44,8 +50,8 @@ SPECIAL_PERMS+= ${PREFIX}/libexec/dma \
# grants other read permission for unclear reasons; mirror that as not harmful.
SPECIAL_PERMS+= ${PREFIX}/libexec/dma-mbox-create \
${REAL_ROOT_USER} ${DMA_GROUP} 4554
+PKG_USERS= ${DMA_USER}:${DMA_GROUP}
PKG_GROUPS= ${DMA_GROUP}
-PKG_USERS= ${DMA_ROOT_USER}:${DMA_GROUP}
.endif
# dma has awkward getprogname detection; essentially one must define
@@ -58,7 +64,10 @@ CFLAGS+= -DHAVE_GETPROGNAME
.endif
CFLAGS+= -DHAVE_STRLCPY
CFLAGS+= -DDMA_GROUP=\"${DMA_GROUP}\"
-CFLAGS+= -DDMA_ROOT_USER=\"${DMA_ROOT_USER}\"
+# Upstream uses the confusing and unhelpful name "DMA_ROOT_USER" to
+# specify the unprivileged user that dma drops privs to, when invoked
+# as root. https://github.com/corecode/dma/issues/175
+CFLAGS+= -DDMA_ROOT_USER=\"${DMA_USER}\"
MAKE_ENV+= CONFDIR=${PKG_SYSCONFDIR}
MAKE_ENV+= LIBS=${LIBS:Q}
diff --git a/dma/TODO b/dma/TODO
index 6090cbb9a1..a336226396 100644
--- a/dma/TODO
+++ b/dma/TODO
@@ -1,29 +1,4 @@
-Add comments explaining DMA_ROOT_USER and why it isn't root. The
-"root isn't root, but then we use REAL_ROOT" is confusing; there's
-obviously some grand plan that isn't obvious. --> DONE :
-ad8a9dd74e dma: Explain suid plan
-
-Add a comment explaining why the other-x bit is off for
-dma-mbox-create, but the other-r bit is on (4554), because this is
-unusual. --> DONE :
-ad8a9dd74e dma: Explain suid plan
-
-Clarify the comment about glibc/getprogname. In particular "uses
-glibc" and "is Linux" aren't really the same thing. If it's a proxy
-that's good enough for now, that's ok, but say it. Or if I'm confused
-add a comment that would straighten out someone with my confusion. --> DONE
-ad8a9dd74e dma: Explain suid plan
--and-
-b8e6abb48a dma: Makefile comment for getprogname() upstream issue
-
-It seems odd to be using SPECIAL_PERMS so much when I would expect
-dma's own makefiles to install with the right user/group/perms.
-(pkgsrc install doesn't set these, but instead adds them to METALOG
-and then the tarball uses that; this is the normal pattern). Maybe
-upstream just doesn't do this, but it seems odd, and it seems like a
-workaroudnd for the DMA_ROOT_USER not being root. --> N/A
-tech-pkg clarification that METALOG is not used in pkgsrc :
-https://mail-index.netbsd.org/tech-pkg/2026/11/23/msg032696.html
-
-Upstream issues have been raised and documented in patches/Makefile
-where relevant.
+File queue->dma_queue renaming (SunOS) upstream. (The point is that,
+with a healthy upstream, to get to not needing patches, to 1) help
+anyone using the program not in pkgsrc and 2) to reduce the need to
+merge patches in the future.)
Home |
Main Index |
Thread Index |
Old Index