summaryrefslogtreecommitdiff
path: root/gethost.c
Commit message (Collapse)AuthorAgeFilesLines
* Variable scope reductions, as suggested by cppcheckAlan Coopersmith2022-09-111-9/+4
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Fix segfault when X startsAlex Gendin2021-08-021-3/+4
| | | | | | | | | | | | | | This patch potentially fixes bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=884934 System log entries when this bug occurs: kernel: xauth[16729]: segfault at 1 ip 00007f51f517f5a5 sp 00007ffdec846568 error 4 in libc-2.31.so[7f51f5102000+144000] kernel: Code: bc d1 f3 0f 7f 27 f3 0f 7f 6f 10 f3 0f 7f 77 20 f3 0f 7f 7f 30 49 83 c0 0f 49 29 d0 48 8d 7c 17 31 e9 8f 0b 00 00 66 0f ef c0 <f3> 0f 6f 0e f3 0f 6f 56 10 66 0f 74 c1 66 0f d7 d0 49 83 f8 11 0f This bug happens when function get_address_info() in gethost.c is called with a display name without forward slash, for example 'myhost.mydomain:0'
* Additionally check socket file with S_ISSOCKDr. Tilmann Bubeck2020-08-201-2/+2
| | | | This fixes bug https://bugzilla.redhat.com/show_bug.cgi?id=1870201
* include POSIX-standard limits.h for PATH_MAX instead of sys/syslimits.hAlan Coopersmith2015-01-051-1/+1
| | | | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
* Fix !HAVE_STRLCPY caseJon TURNEY2015-01-051-1/+1
| | | | | | | | | | | | | | | Fix error in the !HAVE_STRLCPY case, introduced in commit f990dd936b5fd1a40290bb88cde517a0ac38f823 It seems that "path[sizeof(path) - 1]" rather than "buf[sizeof(path) - 1]" must be meant here, especially as the second instance doesn't even compile... parsedpy.c: In function ‘parse_displayname’: parsedpy.c:176:9: error: ‘buf’ undeclared (first use in this function) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* Update DISPLAY parsing to work with new launchd paths in YosemiteJeremy Huddleston Sequoia2014-12-311-18/+45
| | | | Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* Handle v4-mapped inet6 addresses correctlyEgbert Eich2013-10-011-10/+16
| | | | | | | | | | | | | Handling of v4-mapped inet6 addresses has been introduced with commit 58140dbbd39389ad6af58e201e055f3d4b92d368: Look for FamilyLocal if inet or inet6 address is loopback These adresses should be treated as inet addresses. This patch makes the code consistent with the handling if xcb_auth.c in libxcb. Signed-off-by: Egbert Eich <eich@freedesktop.org>
* Look for FamilyLocal if inet or inet6 address is loopbackEgbert Eich2013-09-291-5/+35
| | | | | | | | | | | | | | libxcb uses FamilyLocal authorization if the host name or IP in the display string is from the loopback device. This patch adds the same behavior to xauth. This fixes a long standing problem that for ssh tunneled connections a display variable of the form: localhost:<N>.<M> leads to correct authorization when an X client is started but "xauth list $DISPLAY" returns nothing. Signed-off-by: Egbert Eich <eich@freedesktop.org> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
* Revert "Look for FamilyLocal if inet or inet6 address is loopback"Jeremy Huddleston Sequoia2013-09-291-35/+5
| | | | | | | | | | | | | | Also reverts the followup "More fixes for compiler warnings regarding the use of "const"." This reverts commits fb328950ce1156b8228214240b213860b794b4c8 and 345c7bf0d09f26183cfde9ad1c812c8de71869a5. Fixes build regression found on darwin tinderbox. Per SUSv4*, IN6_IS_ADDR_LOOPBACK takes a 'const struct in6_addr *', not a 'const struct sockaddr_in6 *'. *: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_in.h.html
* More fixes for compiler warnings regarding the use of "const".Dr. Tilmann Bubeck2013-09-251-4/+4
|
* Look for FamilyLocal if inet or inet6 address is loopbackEgbert Eich2013-09-241-5/+35
| | | | | | | | | | | | libxcb uses FamilyLocal authorization if the host name or IP in the display string is from the loopback device. This patch adds the same behavior to xauth. This fixes a long standing problem that for ssh tunneled connections a display variable of the form: localhost:<N>.<M> leads to correct authorization when an X client is started but "xauth list $DISPLAY" returns nothing. Signed-off-by: Egbert Eich <eich@freedesktop.org>
* Fix various compiler warnings raised by modern gcc (4.8.1).Dr. Tilmann Bubeck2013-09-241-0/+3
|
* Remove unused DECnet ("DNETCONN") code from xauthAlan Coopersmith2012-12-261-50/+0
| | | | | | | | Has never been converted to build in modular builds, so has been unusable since X11R7.0 release in 2005. DNETCONN support was removed from xtrans back in 2008. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove unused TLI ("STREAMSCONN") code from xauthAlan Coopersmith2012-12-261-8/+0
| | | | | | | | | | | Has never been converted to build in modular builds, so has been unusable since X11R7.0 release in 2005. All known platforms with TLI/XTI support that X11R7 & later releases run on also have (and mostly prefer) BSD socket support for their networking API. And as the comment notes, it never worked right in xauth anyway. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Remove alarm handler in get_hostnameAndreas Schwab2011-10-061-39/+0
| | | | | | gethostbyaddr is not (required to be) async-signal-safe. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
* Add const attributes to fix gcc -Wwrite-strings warningsAlan Coopersmith2011-09-281-3/+3
| | | | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Strip trailing whitespaceAlan Coopersmith2011-09-281-8/+8
| | | | | | | Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Purge cvs tags.Jesse Adkins2010-10-061-4/+0
| | | | Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
* Fix build failure resulting from previous commit on systems without strlcpyJeremy Huddleston2010-08-261-0/+6
| | | | | Found-by: Tinderbox Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
* launchd: Properly support launchd sockets in xauthJeremy Huddleston2010-08-251-1/+16
| | | | | | | What we had in place before was a hack that always used ':0'. This change results in the bundle id being used to differentiate different connections. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
* C89 fixJens Granseuer2008-03-091-1/+2
| | | | | 65a0917d4661e370b50beed8f06f5577bfeea59f broke the build with non-C99 aware compilers.
* get_address_info: don't allow duplicate entries to be returned in the listJeremy Huddleston2008-01-101-1/+9
| | | | | | | | OS-X's getaddrinfo() can return duplicate entries (and does for localhost with the default 10.5 /etc/hosts). This caused some annoying crashes which this patch takes care of. See http://trac.macosforge.org/projects/xquartz/ticket/44
* Remove Imake compatibility #ifdefs - require configure's AC_TYPE_SIGNALAlan Coopersmith2006-12-111-9/+0
|
* Replace platform #ifdefs with AC_CHECK_HEADERS([net/errno.h])Alan Coopersmith2006-12-111-6/+2
|
* sparse warning: non-ANSI definition of function 'get_hostname'Alan Coopersmith2006-12-111-2/+1
|
* See ChangeLog entry 2005-11-07 for details.XORG-6_8_99_903XORG-6_8_99_902Kean Johnson2005-11-081-2/+2
|
* Add config.h includes for modularization Use RETSIGTYPE if defined byXORG-6_8_99_901XORG-6_8_99_900Alan Coopersmith2005-07-261-6/+15
| | | | autoconf in addition to Imake's SIGNALRETURNSINT.
* Merging XORG-CURRENT into trunkEgbert Eich2004-04-231-1/+1
|
* Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004xf86-4_4_99_1Egbert Eich2004-03-141-1/+1
|
* Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004xf86-4_4_0STSF-CURRENTEgbert Eich2004-03-031-1/+1
|
* readding XFree86's cvs IDsxf86-4_3_99_903Egbert Eich2004-02-261-1/+1
|
* Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004Egbert Eich2004-02-261-1/+1
|
* XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_16Kaleb Keithley2003-11-251-25/+121
|
* XFree86 4.3.0.1xf86-4_3_0_1PRE_xf86-4_3_0_1Kaleb Keithley2003-11-141-17/+21
|
* R6.6 is the Xorg base-lineXORG-MAINXORG-STABLEKaleb Keithley2003-11-141-0/+283