MCPcopy Create free account
hub / github.com/NetHack/NetHack / qt_init_nhwindows

Method qt_init_nhwindows

outdated/win/Qt3/qt3_win.cpp:4528–4556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4526}
4527
4528void NetHackQtBind::qt_init_nhwindows(int* argc, char** argv)
4529{
4530#ifdef UNIX
4531// Userid control
4532//
4533// Michael Hohmuth <hohmuth@inf.tu-dresden.de>...
4534//
4535// As the game runs setuid games, it must seteuid(getuid()) before
4536// calling XOpenDisplay(), and reset the euid afterwards.
4537// Otherwise, it can't read the $HOME/.Xauthority file and whines about
4538// not being able to open the X display (if a magic-cookie
4539// authorization mechanism is being used).
4540
4541 uid_t gamesuid=geteuid();
4542 seteuid(getuid());
4543#endif
4544
4545 QApplication::setColorSpec(ManyColor);
4546 instance=new NetHackQtBind(*argc,argv);
4547
4548#ifdef UNIX
4549 seteuid(gamesuid);
4550#endif
4551
4552#ifdef _WS_WIN_
4553 // This nethack engine feature should be moved into windowport API
4554 nt_kbhit = NetHackQtBind::qt_kbhit;
4555#endif
4556}
4557
4558int NetHackQtBind::qt_kbhit()
4559{

Callers

nothing calls this directly

Calls 2

seteuidFunction · 0.85
getuidFunction · 0.85

Tested by

no test coverage detected