component(developer/golang-123): Add Component
[oi-userland.git] / components / x11 / xorg-server / patches / 32-21206921.patch
blob1aaafa641424b380d4a33ff7965f991a69ddf7b9
1 diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
2 index 6570f0b..85d698f 100644
3 --- a/hw/xfree86/common/xf86Events.c
4 +++ b/hw/xfree86/common/xf86Events.c
5 @@ -558,6 +558,16 @@ xf86VTEnter(void)
6 if (!xf86VTSwitchTo())
7 return;
9 +#ifdef __sun /* restore root privs needed to restore device access */
10 + uid_t user_id = geteuid();
12 + if (user_id != 0) {
13 + if (seteuid(0) < 0) {
14 + xf86Msg(X_WARNING, "Error in resetting euid to root \n");
15 + }
16 + }
17 +#endif
19 #ifdef XF86PM
20 xf86OSPMClose = xf86OSPMOpen();
21 #endif
22 @@ -600,6 +610,14 @@ xf86VTEnter(void)
23 xf86platformVTProbe();
24 #endif
26 +#ifdef __sun
27 + if (user_id != 0) { /* reset privs back to user */
28 + if (seteuid(user_id) < 0) {
29 + xf86Msg(X_WARNING, "Error in resetting euid to %d\n", user_id);
30 + }
31 + }
32 +#endif
34 xf86UpdateHasVTProperty(TRUE);
36 OsReleaseSIGIO();
37 diff --git a/hw/xfree86/os-support/solaris/sun_vid.c b/hw/xfree86/os-support/solaris/sun_vid.c
38 index 25f7618..7548f50 100644
39 --- a/hw/xfree86/os-support/solaris/sun_vid.c
40 +++ b/hw/xfree86/os-support/solaris/sun_vid.c
41 @@ -22,7 +22,7 @@
42 * OF THIS SOFTWARE.
45 -/* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
46 +/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
48 * Permission is hereby granted, free of charge, to any person obtaining a
49 * copy of this software and associated documentation files (the "Software"),
50 @@ -100,8 +100,9 @@ xf86DisableIO(void)
51 if (!ExtendedEnabled)
52 return;
54 - sysi86(SI86V86, V86SC_IOPL, 0);
56 - ExtendedEnabled = FALSE;
57 + if (sysi86(SI86V86, V86SC_IOPL, 0) < 0)
58 + xf86Msg(X_WARNING, "xf86DisableIOPorts: Failed to set IOPL for I/O\n");
59 + else
60 + ExtendedEnabled = FALSE;
61 #endif /* i386 */