summaryrefslogtreecommitdiff
path: root/xinit.c
AgeCommit message (Collapse)Author
2019-02-09Buffer overflow with many arguments.Tobias Stoeckmann
Command line arguments are copied into clientargv and serverargv without verifying that enough space is available. A high amount of arguments can therefore trigger a buffer overflow like this: $ xinit $(seq 1 500) Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org> Reviewed-by: Walter Harms wharms@bfs,de
2017-01-31xinit: check for correct fork error codeTobias Stoeckmann
Even though this code is only active on __sun machines, the fork return value should be checked for -1, not 1, to detect an error situation. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-09-08Fix warnings about parameters to startServer & startClient shadowing globalsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-24Use pid_t instead of int for type of pidsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-18Declare processTimeout() as taking a const string argAlan Coopersmith
Fixes gcc const warnings on every call to it Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-07-18If we have to forcibly kill the Xserver on Solaris, reset kbd_modeAlan Coopersmith
If the Xserver hangs when xinit is waiting for it to die, and xinit sends a kill -9 to it, then it will leave the keyboard in a state that can't be used on the text console, so fix it up ourselves. Upstreaming from Solaris, where it was originally implemented to fix Sun bug 4221128 “If Xserver is slow to exit, xinit does "kill -9" and kbd_mode -a is required” Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-02-23Add printf attributes suggested by gccAlan Coopersmith
Also moves existing noreturn attributes up to function prototypes for functions with forward declarations. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-05-19Annotate Fatal and Fatalx as _X_NORETURNJeremy Huddleston
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-08Include <sys/time.h> and <sys/resource.h> unconditionallyJulien Cristau
Suggested by Mark Kettenis. X.Org bug#40632 <https://bugs.freedesktop.org/show_bug.cgi?id=40632> Signed-off-by: Julien Cristau <jcristau@debian.org>
2011-01-29Merge adjacent if (timeout) blocksAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Dirk Wallenstein <halsmit@t-online.de>
2010-11-22Minor typo.Tom Doherty
Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-06-11DragonFly BSD: includes for PRIO_PROCESS and setpriority() in xinit.cDavid Shao
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-13Rationalize errors outputMikhail Gusarov
Implement Errorx/Fatalx in addition to existing Error/Fatal, replace all fprintf(stderr)/exit with Fatal, all fprintf(stderr) with Error. Additionally harmonize capitalization and punctuation of error messages. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-13Fix comment indentationMikhail Gusarov
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-13Use signals from Unix98 and drop pre-POSIX compatibilityMikhail Gusarov
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-13Use sigaction(2) instead of signal(2) to handle SIGUSR1 and SIGALRMMikhail Gusarov
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-13sys/wait.h is in Unix98Mikhail Gusarov
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-13setpriority and PRIO_PROCESS are in Unix98Mikhail Gusarov
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-13SIGTT{IN,OU} is in Unix98Mikhail Gusarov
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-13SIGCHLD is in Unix98Mikhail Gusarov
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-13killpg(2) is in Unix98Mikhail Gusarov
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-13waitpid(2) is in Unix98Mikhail Gusarov
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-13Use EXIT_{SUCCESS, FAILURE} from C90 instead of homegrown equivalentsMikhail Gusarov
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-13Stop converting functions' return types to voidMikhail Gusarov
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-13Simplify environment juggling by using fork() instead of vfork()Mikhail Gusarov
xinit used to copy process environment in order to give client correct DISPLAY and WINDOWPATH variables. It was not possible to do it in client process because it was vforked, not forked. As vfork() usage was not entirely correct (manpage specifies that behaviour is undefined if there are any memory modifications between vfork and exec), switch to fork(), move setting environment variables to client process and and drop all the manual mucking with environment. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-13Fix whitespaceMikhail Gusarov
File was indented with mix of 8-space and tab symbols and inconsistently formatted. Apply more-or-less consistent formatting and reindent everything to 4-space. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2010-04-08Nuke OS/2 and LynxOS support remnants.Mikhail Gusarov
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2009-10-03Strip RCS/CVS tagsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-10-03Drop ancient SunWindows compatibility checkAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-10-03Drop ancient A/UX compatibility hackAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2009-10-03Purge ancient server names from help, add newer server names insteadAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
2008-12-18Apple: Use MAC_OS_X_VERSION_MIN_REQUIRED instead of ↵Jeremy Huddleston
__MAC_OS_X_VERSION_MIN_REQUIRED
2008-11-22Apple: Use AvailabilityMacros.h for Tiger compatabilityJeremy Huddleston
2008-08-05Apple: sleep() to avoid innocent error message spewJeremy Huddleston
2008-08-04Support the instant-off API in SnowLeopard.Jeremy Huddleston
2008-05-06Apple: No need for these bits being here in xinit as of xserver-1.4.0-apple9Jeremy Huddleston
2008-04-25Apple: Added some OSX version protection, so this will still compile on ↵Jeremy Huddleston
Tiger and below.
2008-04-25Apple: Use CFProcessPath instead of argv[0] trick.Jeremy Huddleston
2008-04-20Replace sprintf() and strcpy() with snprintf().Matthieu Herrb
2007-12-16OS-X: Added argv[0] hack for finding Xquartz UI and icon as well as claiming ↵Jeremy Huddleston
its dock icon Partially removes need for x11-exec on OS-X. We still need to handle options set in defaults.
2007-12-15Changed x11-exec to actually start X11.app. X11.app will be responsible for ↵Jeremy Huddleston
calling xinit.
2007-12-15Added Apple launchd supportJeremy Huddleston
2007-12-03Added some support for Xquartz on OS-X.Jeremy Huddleston
2007-05-21Remove old Imake checks now that we always build with autoconfAlan Coopersmith
2007-05-21Remove support for pre-POSIX-1990 platformsAlan Coopersmith
2007-05-21Modernize list of Xservers printed when "X" is not found in $PATHAlan Coopersmith
2007-05-21Don't print windowpath debug messages unless built -DDEBUGAlan Coopersmith
No need to print warnings on systems without vt support
2007-05-21X.Org Bugzilla #8013: xinit should set WINDOWPATHSamuel Thibault
X.Org Bugzilla #8013: <https://bugs.freedesktop.org/show_bug.cgi?id=8013> Patch #6701: <https://bugs.freedesktop.org/attachment.cgi?id=6701>
2006-06-20Check setuid() return value. Bugzilla #7116.Matthieu Herrb
2005-10-04Bug #2027: Treat SIGTERM like SIGINT in xinit. (Andreas Luik)XORG-6_8_99_901Adam Jackson