aboutsummaryrefslogtreecommitdiff
path: root/audio/lmms
diff options
context:
space:
mode:
authorJean-Yves Lefort <jylefort@FreeBSD.org>2006-12-06 11:16:29 +0000
committerJean-Yves Lefort <jylefort@FreeBSD.org>2006-12-06 11:16:29 +0000
commitd1d47e5559aae81fa7e50df8a50c02284d6e7977 (patch)
treef1cce29e63b17f5ac221c67ad71ef69f958a8ec7 /audio/lmms
parent12a28f5b29fad3ab86ca8bca319399b26e2ada86 (diff)
downloadports-d1d47e5559aae81fa7e50df8a50c02284d6e7977.tar.gz
ports-d1d47e5559aae81fa7e50df8a50c02284d6e7977.zip
Install the program setuid-root so that it can set realtime priority,
and drop root privileges early in main().
Notes
Notes: svn path=/head/; revision=179013
Diffstat (limited to 'audio/lmms')
-rw-r--r--audio/lmms/Makefile7
-rw-r--r--audio/lmms/files/patch-src_core_main.cpp20
2 files changed, 26 insertions, 1 deletions
diff --git a/audio/lmms/Makefile b/audio/lmms/Makefile
index 21c96373b789..d6f57154a135 100644
--- a/audio/lmms/Makefile
+++ b/audio/lmms/Makefile
@@ -7,7 +7,7 @@
PORTNAME= lmms
PORTVERSION= 20061204
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= audio
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= jylefort
@@ -49,4 +49,9 @@ post-patch:
pre-configure:
@cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${LIBTOOLIZE}
+post-install:
+ # make it setuid-root to be able to set realtime priority
+ # (root privileges are dropped in the main routine)
+ ${CHMOD} u+s ${PREFIX}/bin/lmms
+
.include <bsd.port.mk>
diff --git a/audio/lmms/files/patch-src_core_main.cpp b/audio/lmms/files/patch-src_core_main.cpp
new file mode 100644
index 000000000000..42964de206ef
--- /dev/null
+++ b/audio/lmms/files/patch-src_core_main.cpp
@@ -0,0 +1,20 @@
+--- src/core/main.cpp.orig Mon Dec 4 15:22:34 2006
++++ src/core/main.cpp Wed Dec 6 11:52:51 2006
+@@ -49,6 +49,9 @@
+ #include <sched.h>
+ #endif
+
++#include <sys/types.h>
++#include <unistd.h>
++
+
+ #include "main_window.h"
+ #include "embed.h"
+@@ -89,6 +92,7 @@
+ printf( "could not set realtime priority.\n" );
+ }
+ #endif
++ setuid(getuid()); // drop root privileges
+
+ QApplication app( argc, argv );
+