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)
9 +#ifdef __sun /* restore root privs needed to restore device access */
10 + uid_t user_id = geteuid();
13 + if (seteuid(0) < 0) {
14 + xf86Msg(X_WARNING, "Error in resetting euid to root \n");
20 xf86OSPMClose = xf86OSPMOpen();
22 @@ -600,6 +610,14 @@ xf86VTEnter(void)
23 xf86platformVTProbe();
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);
34 xf86UpdateHasVTProperty(TRUE);
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
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)
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");
60 + ExtendedEnabled = FALSE;