1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00
freebsd-ports/games/xkobo/files/patch-ab
1998-03-26 12:13:39 +00:00

36 lines
837 B
Plaintext

--- xlwin.C.orig Wed Mar 13 17:34:46 1996
+++ xlwin.C Wed Mar 25 20:16:00 1998
@@ -21,6 +21,10 @@
*/
extern "C"{
+#ifdef SECURE_SCOREFILES
+#include <sys/types.h>
+#include <unistd.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
}
@@ -105,7 +109,21 @@
{
if (mask == -1) return;
if (disp == NULL){
+#ifdef SECURE_SCOREFILES
+ uid_t ruid, euid;
+
+ /* get ruid */
+ ruid = getuid();
+ /* save euid */
+ euid = geteuid();
+ /* become normal user to read $HOME/.Xauthority */
+ (void)seteuid(ruid);
+#endif
disp = XOpenDisplay(disp_string);
+#ifdef SECURE_SCOREFILES
+ /* become XKOBO_ADMINISTER again */
+ (void)seteuid(euid);
+#endif
if (disp == NULL){
fprintf(stderr, "xlwin: can't open display\n");
exit(1);