Changeset 84593 in vbox for trunk/src/VBox/Additions
- Timestamp:
- May 28, 2020 2:33:35 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/VBoxClient/display-drm.cpp
r84584 r84593 106 106 static void drmConnect(struct DRMCONTEXT *pContext) 107 107 { 108 uid_t guid = getuid(); 109 if (setreuid(0, 0) == -1) 110 { 111 perror("setuid failed drm device open."); 112 } 108 113 unsigned i; 109 114 RTFILE hDevice; … … 145 150 } 146 151 pContext->hDevice = hDevice; 152 setreuid(guid, 0); 147 153 } 148 154 … … 163 169 { 164 170 uid_t guid = getuid(); 165 if (set uid(0) == -1)166 { 167 perror("setuid failed d uring drm ioctl.");171 if (setreuid(0, 0) == -1) 172 { 173 perror("setuid failed drm device open."); 168 174 } 169 175 … … 179 185 if (RT_FAILURE(rc) && rc != VERR_INVALID_PARAMETER) 180 186 VBClLogFatalError("Failure updating layout, rc=%Rrc\n", rc); 181 set uid(guid);187 setreuid(guid, 0); 182 188 } 183 189 184 190 int main(int argc, char *argv[]) 185 191 { 186 uid_t guid = getuid();187 if (setuid(0) == -1)188 {189 perror("setuid failed during init.");190 }191 192 192 int rc = RTR3InitExe(argc, &argv, 0); 193 193 if (RT_FAILURE(rc)) … … 223 223 return VERR_INVALID_HANDLE; 224 224 } 225 setuid(guid); 225 226 226 for (;;) 227 227 {
Note:
See TracChangeset
for help on using the changeset viewer.