aboutsummaryrefslogtreecommitdiffstats
path: root/audio/xmcd
diff options
context:
space:
mode:
authortg <tg@FreeBSD.org>1999-05-26 15:08:19 +0800
committertg <tg@FreeBSD.org>1999-05-26 15:08:19 +0800
commit30b218e8f8f3e3f879ac242cd9a2aa92485eb6e3 (patch)
treebc9e9bce40ff39a84779bfb2f3d3d706abc67dce /audio/xmcd
parentca9b21c10bd9803d9a97eb47d6cf4274632ad505 (diff)
downloadfreebsd-ports-gnome-30b218e8f8f3e3f879ac242cd9a2aa92485eb6e3.tar.gz
freebsd-ports-gnome-30b218e8f8f3e3f879ac242cd9a2aa92485eb6e3.tar.zst
freebsd-ports-gnome-30b218e8f8f3e3f879ac242cd9a2aa92485eb6e3.zip
Give up root temporarily to read user's .Xauthority.
PR: 11887
Diffstat (limited to 'audio/xmcd')
-rw-r--r--audio/xmcd/files/patch-af39
1 files changed, 39 insertions, 0 deletions
diff --git a/audio/xmcd/files/patch-af b/audio/xmcd/files/patch-af
new file mode 100644
index 000000000000..5200c47286f0
--- /dev/null
+++ b/audio/xmcd/files/patch-af
@@ -0,0 +1,39 @@
+--- xmcd_d/main.c.orig Sat Apr 24 03:41:00 1999
++++ xmcd_d/main.c Sun May 23 11:55:01 1999
+@@ -151,6 +151,8 @@
+ {
+ int i;
+ Display *display;
++ uid_t euid, ruid;
++ gid_t egid, rgid;
+
+ /* Error message stream */
+ errfp = stderr;
+@@ -201,6 +203,16 @@
+ }
+ }
+
++ /* get real IDs */
++ ruid = getuid();
++ rgid = getgid();
++ /* save effective IDs */
++ euid = geteuid();
++ egid = getegid();
++ /* give up root until we have a connection to the X server */
++ (void)seteuid(ruid);
++ (void)setegid(rgid);
++
+ /* Initialize X toolkit */
+ widgets.toplevel = XtVaAppInitialize(
+ &app_context,
+@@ -210,6 +222,10 @@
+ NULL,
+ NULL
+ );
++
++ /* Ok, back to root */
++ (void)seteuid(euid);
++ (void)setegid(egid);
+
+ /* Get application options */
+ XtVaGetApplicationResources(