1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-17 00:00:40 +00:00
freebsd-ports/audio/xmcd/files/patch-af
1999-05-26 07:08:19 +00:00

40 lines
875 B
Plaintext

--- 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(