summaryrefslogtreecommitdiff
path: root/os/xdmcp.c
AgeCommit message (Collapse)AuthorFilesLines
2019-10-30include: Remove now-empty site.hAdam Jackson1-1/+0
2019-10-30xdmcp: Remove unconfigurable COMPILEDDISPLAYCLASSAdam Jackson1-1/+1
2018-10-24os/xdmcp: Fix binding of ipv6 source addressAndreas Fett1-2/+13
Choose the socket fd of the correct address family based on the address family of the argument to the -from option. Fixes: xorg/xserver#4
2018-10-03os/xdmcp: Don't create a new socket in XdmcpReset()Alexander Volkov1-3/+9
xdmcpSocket survives during the reset, there is no need to create a new one. This commit restores logic that was broken by 49c0f2413d32fdfe36e45861fcb32aaeab633094 in Xorg 1.19. Signed-off-by: Alexander Volkov <a.volkov@rusbitech.ru>
2018-01-08os: Fix a type error in the IPv6 XDMCP codeAdam Jackson1-1/+1
Building with strict-aliasing rightly chirps here: ../os/xdmcp.c: In function ‘XdmcpRegisterConnection’: ../os/xdmcp.c:489:31: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] &((struct sockaddr_in6 *) &address)->sin6_addr.s6_addr[12]; ^~~~~~~~~~~~ We have "const char *address", so &address here is a char ** (i.e., it points to the slot on the stack containing the pointer to the character array passed in as an argument). Casting that to a struct sockaddr_in6 * is wrong, because it means that area of the stack will be reinterpreted as a struct sockaddr_in6. Instead, cast address, not &address. Signed-off-by: Adam Jackson <ajax@redhat.com>
2017-11-29os/xdmcp: Honour -once when session is deadDaniel Martin1-1/+1
Terminate a dead session when -once was passed. Don't restart it. Signed-off-by: Daniel Martin <consume.noise@gmail.com> Reviewed-by: Walter Harms <wharms@bfs.de>
2016-07-21os: Switch server to poll(2) [v3]Keith Packard1-1/+0
Eliminates all of the fd_set mangling in the server main thread v2: Listen for POLLOUT while writes are blocked. v3: Only mark client not ready on EAGAIN return from read Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-02-08os: unifdef STREAMSCONNAdam Jackson1-44/+0
Removed from xtrans in 2012, and never wired up in the modular build anyway. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-12-01os/xdmcp: Replace xdmcp block/wakeup handlers with timer and NotifyFdKeith Packard1-78/+36
This removes the block and wakeup handlers and replaces them with a combination of a NotifyFd callback and timers. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-10-19xdmcp: Declare XdmcpFatal _X_NORETURNJeremy Huddleston1-0/+1
xdmcp.c:1404:1: warning: function 'XdmcpFatal' could be declared with attribute 'noreturn' [-Wmissing-noreturn,Semantic Issue] Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-09-21os/xdmcp: Just send XDMCP keepalive packets once every three minutesKeith Packard1-18/+2
There was a complicated scheme to increase the time between keepalives from 3 minutes up to as much as 24 hours in an attempt to reduce network traffic from idle X terminals. X terminals receiving X traffic, or receiving user input would use the 3 minute value; X terminals without any network traffic would use a longer value. However, this was actually broken -- any activity in the X server, either client requests or user input, would end up resetting the keepalive timeout, so a user mashing on the keyboard would never discover that the XDMCP master had disappeared and have the session terminated, which was precisely the design goal of the XDMCP keepalive mechanism. Instead of attempting to fix this, accept the cost of a pair of XDMCP packets once every three minutes and just perform keepalives regularly. This will also make reworking the block and wakeup handler APIs to eliminate select masks easier. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-09-21os/xdmcp: Remove dead 'restart' codeKeith Packard1-13/+1
The X server used to wait for the user to hit a key or move the mouse before restarting the session after a keepalive failure. This, presumably, was to avoid having the X server continuously spew XDMCP protocol on the network while the XDM server was dead. Switching into this state was removed from the server some time before XFree86 4.3.99.16, so the remaining bits of code have been dead for over a decade, and no-one ever noticed. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2015-04-22os/xdmcp.c: Include Xtrans.h when building for WIN32Colin Harrison1-0/+4
Xtrans.h must be included on WIN32 to prototype _XSERVTransWSAStartup() xserver/os/xdmcp.c: In function ‘get_addr_by_name’: xserver/os/xdmcp.c:1483:5: error: implicit declaration of function ‘_XSERVTransWSAStartup’ [-Werror=implicit-function-declaration] Signed-off-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2015-03-16os: XDMCP options like -query etc. should imply -listen tcpJon TURNEY1-0/+17
In X server 1.17, the default configuration is now -nolisten tcp. In this configuration, XDMCP options don't work usefully, as the X server is not listening on the port for the display that it tells the display manager to connect to. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-11-12Drop trailing whitespacesPeter Hutterer1-1/+1
sed -i "s/[ ]\+$//g" **/*.(c|h) happy reviewing... git diff -w is an empty diff. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-22os: Fix -Wshadow errorsKeith Packard1-15/+13
Rename variables to avoid shadowing globals Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12Clean up a few function prototypes to not place formals in /**/Keith Packard1-24/+27
This just removes the comment markers from around the formals in several function prototypes near where pointer -> void * changes were made. There are plenty more of these to fix. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-01-12Replace 'pointer' type with 'void *'Keith Packard1-10/+10
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer' is used throughout the X server for other things, and having duplicate names generates compiler warnings. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2013-10-18dix: provide accessor methods for the last device event timePeter Hutterer1-1/+1
And now that we have the accessors, localize it. No functional changes, just preparing for a future change. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
2012-12-05Fix formatting of address operatorsYaakov Selkowitz1-6/+6
The formatter confused address operators preceded by casts with bitwise-and expressions, placing spaces on either side of both. That syntax isn't used by ordinary address operators, however, so fix them for consistency. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-22Change lastDeviceIdleTime to be per-devicePeter Hutterer1-1/+1
Preparation work for per-device idle counters. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: James Jones <jajones@nvidia.com>
2012-03-21Introduce a consistent coding styleKeith Packard1-847/+797
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-12xdmcp.c: fix three small const warningsAlan Coopersmith1-3/+3
xdmcp.c:63:36: warning: initialization discards qualifiers from pointer target type xdmcp.c: In function 'XdmcpRegisterConnection': xdmcp.c:482:8: warning: cast discards qualifiers from pointer target type xdmcp.c:482:8: warning: cast discards qualifiers from pointer target type xdmcp.c:482:8: warning: cast discards qualifiers from pointer target type xdmcp.c: In function 'get_mcast_options': xdmcp.c:1596:21: warning: initialization discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-11-23Convert a bunch of sprintf to snprintf callsAlan Coopersmith1-2/+2
This batch is the straightforward set - others are more complex and need more analysis to determine right size to pass. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-03-14When XDMCP -from is specified, only register the requested addressJon TURNEY1-1/+1
When XDMCP -from is specified, only register the requested address, rather than the requested address, and any others we have of different address families to the requested address. e.g. if we have 4 interfaces with both IPv4 and IPv6 addresses (which are not IPv6 mapped IPV4 addresses), using -from with one of those IPv4 addresses currently means only that IPv4 address, and all IPv6 addresses are used in the connection data in XDMCP REQUEST packet. (See http://cygwin.com/ml/cygwin-xfree/2011-02/msg00000.html) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-10-15os: Clean up various xtrans bits that we've never supportedAdam Jackson1-1/+1
Or at least, not supported since xserver 1.0. Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
2010-06-10Remove unnecessary parentheses around return values in functionsMikhail Gusarov1-11/+11
This patch was generated by the following Perl code: perl -i -pe 's/([^_])return\s*\(\s*([^(]+?)\s*\)s*;(\s+(\n))?/$1return $2;$4/g;' Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-06-06Replace deprecated bzero with memsetMikhail Gusarov1-3/+3
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Marcin Baczyński <marbacz@gmail.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2010-05-13Replace X-allocation functions with their C89 counterpartsMikhail Gusarov1-7/+7
The only remaining X-functions used in server are XNF*, the rest is converted to plain alloc/calloc/realloc/free/strdup. X* functions are still exported from server and x* macros are still defined in header file, so both ABI and API are not affected by this change. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-05-07Constify function prototypes in auth & xdmcp codeAlan Coopersmith1-19/+19
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Tested-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-04-14xdmcp: Don't crash on X -query with more than 255 IP addresses. (#20675)Adam Jackson1-0/+2
You could be more clever than this, but the wire protocol says this really is an array of not more than 255 ARRAY8, so it's not just a matter of changing the types.
2009-01-22Remove a bunch of useless casts.Adam Jackson1-4/+3
We've had void * for twenty years now people let's try to act like we know how it works.
2009-01-11os: ANSI cleanupsJulien Cristau1-3/+1
2008-07-17Dead code removalDaniel Stone1-5/+0
Remove a whole bunch of code that was never built, be it entire files or just dead ifdefs.
2008-07-17Drop a bunch of #ifdef Lynx.Mathieu Bérard1-4/+0
2008-05-15Add necessary include for COMPILEDDISPLAYCLASS.Eric Anholt1-0/+1
Fixes build after 07f69023b0e75d98a4be8f0d1c3dd9391b8149a0.
2008-05-14Move defaultDisplayClass to xdmcp-only visibility.Adam Jackson1-1/+1
2007-03-25General DIX static and dead code cleanup.Adam Jackson1-35/+23
2007-03-25Static cleanups, dead code deletion.Adam Jackson1-8/+8
2006-07-21Remove RCS tags. Fix Xprint makefile braindamage.Adam Jackson1-3/+0
2006-06-26Free small, one-time memory leak in xdmcp -from handlingPeter Breitenlohner1-0/+4
Part of Patch #6046 <https://bugs.freedesktop.org/attachment.cgi?id=6046>
2005-07-03Change <X11/misc.h> and <X11/os.h> to "misc.h" and "os.h".Daniel Stone1-1/+1
2005-07-03Add Xtrans definitions (FONT_t, TRANS_CLIENT) to clean up warnings.Daniel Stone1-0/+4
Add XSERV_t, TRANS_SERVER, TRANS_REOPEN to quash warnings. Add #include <dix-config.h> or <xorg-config.h>, as appropriate, to all source files in the xserver/xorg tree, predicated on defines of HAVE_{DIX,XORG}_CONFIG_H. Change all Xfont includes to <X11/fonts/foo.h>.
2005-07-01Change all misc.h and os.h references to <X11/foo.h>.Daniel Stone1-2/+2
2005-05-02Fix message type (respose->response) and fix */*comment*/ blocks to workHarold L Hunt II1-9/+9
with fussy compilers.
2005-04-20Fix includes right throughout the Xserver tree:Alexander Gottwald1-2/+2
apply changes to windows specific includes Fix includes right throughout the Xserver tree: apply changes to Xdmcp.h
2005-04-20Fix includes right throughout the Xserver tree:Daniel Stone1-5/+5
change "foo.h" to <X11/foo.h> for core headers, e.g. X.h, Xpoll.h; change "foo.h", "extensions/foo.h" and "X11/foo.h" to <X11/extensions/foo.h> for extension headers, e.g. Xv.h; change "foo.[ch]" to <X11/Xtrans/foo.[ch]> for Xtrans files.
2004-11-15Bufzilla #1802, http://freedesktop.org/bugzilla/show_bug.cgi?id=1802 AddedAlexander Gottwald1-13/+5
mingw (Win32) port
2004-07-20Bugzilla #889: Bind -from address to port number 0 instead of 177Alexander Gottwald1-2/+2
2004-04-23Merging XORG-CURRENT into trunkEgbert Eich1-33/+18