summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-03-03xauth 1.1.3HEADxauth-1.1.3masterAlan Coopersmith1-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-17unifdef LynxAlan Coopersmith1-4/+0
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-17unifdef hpuxAlan Coopersmith1-3/+0
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-16configure: raise minimum autoconf requirement to 2.70Alan Coopersmith2-3/+3
Needed for builds on NetBSD to work correctly, since it depends on AC_USE_SYSTEM_EXTENSIONS defining _OPENBSD_SOURCE to expose the prototype for reallocarray() in the system headers. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-20configure: Use AC_SYS_LARGEFILE to enable large file supportAlan Coopersmith1-0/+5
While .Xauthority files should never be more than 2gb in size, they may be stored on filesystems with large inodes. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-11-24Unbold brackets for optional n at start of commandsнаб1-3/+3
This makes it more consistent with the rest of the spec, as well as making it correcter: "[n]list" isn't a valid command, "list" and "nlist" are Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
2022-09-11Handle -Wempty-body warning for WRITES() macroAlan Coopersmith1-1/+1
process.c:659:57: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body] #define WRITES(fd, S) {if(write((fd), (S), strlen((S))));} ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-09-11Remove unnecessary casts from malloc() callsAlan Coopersmith1-4/+4
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-09-11Variable scope reductions, as suggested by cppcheckAlan Coopersmith3-71/+58
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-08-02config: Add missing AC_CONFIG_SRCDIRAlan Coopersmith1-2/+5
Regroup AC statements under the Autoconf initialization section. Regroup AM statements under the Automake initialization section. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-19xauth 1.1.2xauth-1.1.2Matt Turner1-1/+1
Signed-off-by: Matt Turner <mattst88@gmail.com>
2022-04-16Expand checks of socket file with S_ISSOCKLarry Doolittle1-2/+2
Extend work done in commit 18a3c3a to earlier in the socket detection process Fixes issue #6.
2022-04-16gitlab CI: stop requiring Signed-off-by in commitsAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-04-10Fix off-by-one in quote-stripping routinesAlan Coopersmith1-2/+2
Reported by Oracle Parfait: Error: Buffer overrun Buffer overflow [buffer-overflow] (CWE 120): In pointer dereference of key[(len - 1)] with index (len - 1) Array size >= 1 bytes, index >= 1 at line 1647 of process.c in function 'do_add'. Error: Buffer overrun Buffer overflow [buffer-overflow] (CWE 120): In pointer dereference of authdata[(authdatalen - 1)] with index (authdatalen - 1) Array size is ??? bytes, index is ??? at line 1965 of process.c in function 'do_generate'. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-12-04Build xz tarballs instead of bzip2Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-12-01gitlab CI: add a basic build testAlan Coopersmith1-0/+104
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-12-01configure.ac: fail build if xtrans is not foundAlan Coopersmith1-0/+9
Copied from libX11/configure.ac Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-11-30tests: report failure if stderr has unexpected outputAlan Coopersmith1-1/+6
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-11-30tests: Fix failure to make distcheckAlan Coopersmith1-2/+2
Add test_xauth to EXTRA_DIST Add test output files to CLEANFILES Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-11-30tests: make tests work in out-of-tree buildsAlan Coopersmith6-15/+16
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-11-29Fix warning -Wstringop-truncation for strncpy by using memcpy insteadDr. Tilmann Bubeck1-1/+1
2021-11-29Removed build requirement "cmdtest".Dr. Tilmann Bubeck9-22/+47
Replaced by a shell script with the needed functionality.
2021-11-29Improve portabilityBaptiste Daroussin6-8/+8
there is no need to hard depend on bash given almost all the code is /bin/sh compliant Remove the function keyword from setup-source to make it /bin/sh compliant pipe wc -l output to xargs to make the command output compatible with both GNU wc and BSD wc (which prefix the output with a tab)
2021-11-28xauth 1.1.1xauth-1.1.1Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-11-28Fix spelling/wording issuesAlan Coopersmith5-8/+8
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-08-02Fix segfault when X startsAlex Gendin3-4/+7
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'
2021-04-22Check malloc calls in process.cKarol Herbst1-0/+13
Fixes warnings like warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'authdata' where non-null expected Found-by: gcc static analysis Signed-off-by: Karol Herbst <kherbst@redhat.com>
2020-08-20Additionally check socket file with S_ISSOCKDr. Tilmann Bubeck1-2/+2
This fixes bug https://bugzilla.redhat.com/show_bug.cgi?id=1870201
2020-05-10Avoid memory leaks in error paths in do_generateAlan Coopersmith1-13/+23
Reported by Oracle Parfait: Error: Memory leak Memory leak [memory-leak] (CWE 401): Memory leak of pointer authdata allocated with malloc((authdatalen - 1)) at line 1955 of process.c in function 'do_generate'. authdata allocated at line 1946 with malloc((authdatalen - 1)) Memory leak of pointer authdata allocated with malloc((authdatalen - 1)) at line 1971 of process.c in function 'do_generate'. authdata allocated at line 1946 with malloc((authdatalen - 1)) authdata leaks when (i + 1) >= argc at line 1910. at line 1980 of process.c in function 'do_generate'. authdata allocated at line 1946 with malloc((authdatalen - 1)) authdata leaks when (i + 1) >= argc at line 1910. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-05-10Use reallocarray() when adding members to array in split_into_words()Alan Coopersmith2-2/+15
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-05-10Avoid memory leak when realloc() fails in split_into_words()Alan Coopersmith1-2/+8
Reported by Oracle Parfait: Error: Memory leak Memory leak [memory-leak] (CWE 401): Memory leak of pointer argv allocated with malloc(32) at line 283 of process.c in function 'split_into_words'. argv allocated at line 264 with malloc(32) argv leaks when cur == total at line 280. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-05-10Prevent OOB write with long file names.Tobias Stoeckmann1-1/+5
If an -f argument is exactly 1022 characters in size, an off-by-one stack overflow happens in auth_finalize. The overflow could be even larger if locks are ignored for authentication files. Make sure that a given authentication file name fits into temporary buffer and that this buffer matches buffer sizes of libXau which is used by xauth.
2020-05-03Fix segmentation fault on invalid add argument.Tobias Stoeckmann1-1/+1
The hex key supplied with an add command can be quoted, in which case the quotation marks are removed. The check itself makes sure that a given string starts with a double quotation mark and ends with a double quotation mark. Buf if only " is supplied, the code crashes because it subtracts 2 from the length (which is 1) and therefore copies too much memory into a 0 allocated memory area. Proof of concept: $ xauth add :0 0 \"
2019-07-11xauth 1.1xauth-1.1Adam Jackson1-1/+1
2019-06-20process: Close a window where no authority file would existAdam Jackson1-11/+3
unlink()ing the old auth file before link()ing the temp to the new is just silly. rename() is atomic and will happily clobber the destination, and the only thing link() can give you here is the ability to fail on filesystems that don't support hardlinks. Fixes: xorg/app/xauth#2
2019-06-09Sort entries from most specific to most generic.Michal Srb1-0/+41
There is no point in adding entry or merging lists if a FamilyWild entry would end in front of any entry, or entry without display number would end in front of entry with number. This sorts all entries in order: * FamilyWild without display number * FamilyWild with display number * Other family without display number * Other family with display number The order of the entries in each category is kept. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-06-09Merge only entries with equal dpy and protoname.Michal Srb1-15/+10
Merging two lists, or adding entry a into list acts unexpectedly if the list contains FamilyWild or entry with an empty display numbers. For example: > xauth list #ffff#6f70656e737573652d74756d626c6577656564#: MIT-MAGIC-COOKIE-1 1500d80327733252cc42ba469138a259 > xauth add test/unix:2 MIT-MAGIC-COOKIE-1 aabbccddeeff00112233445566778899 > xauth list test/unix:2 MIT-MAGIC-COOKIE-1 aabbccddeeff00112233445566778899 This is because merge_entries compares entries using `match_auth`, which follows the same rules as XauGetBestAuthByAddr. Following these rules is good when filtering the output of `xauth list`, but for merging we should compare for equality. It used to be done that way before commit 1555fff4. That commit changed it to improve the `xauth list` behavior, but did not seem consider the impact on merge. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-21Update configure.ac bug URL for gitlab migrationAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-16Update README for gitlab migrationAlan Coopersmith2-24/+20
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-05-05Change fall through comment in process.c to match gcc's requirementsAlan Coopersmith1-1/+1
Needs to match one of the regexps shown under https://gcc.gnu.org/onlinedocs/gcc-7.3.0/gcc/Warning-Options.html#index-Wimplicit-fallthrough Silences warning from gcc 7.3: process.c: In function ‘dump_entry’: process.c:1007:9: warning: this statement may fall through [-Wimplicit-fallthrough=] if (dpyname) { ^ process.c:1012:4: note: here default: ^~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-29xauth 1.0.10xauth-1.0.10Matt Turner1-1/+1
Signed-off-by: Matt Turner <mattst88@gmail.com>
2017-01-29Build xauth before running tests.Matt Turner1-1/+1
Otherwise make check fails if make hasn't previously been run. Signed-off-by: Matt Turner <mattst88@gmail.com>
2017-01-26autogen: add default patch prefixMihail Konev1-0/+3
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26autogen.sh: use quoted string variablesEmil Velikov1-4/+4
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent fall-outs, when they contain space. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26autogen.sh: use exec instead of waiting for configure to finishPeter Hutterer1-1/+1
Syncs the invocation of configure with the one from the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-01-26autogen.sh: Honor NOCONFIGURE=1Alan Coopersmith1-2/+3
See http://people.gnome.org/~walters/docs/build-api.txt Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-01-26autogen.sh: stop using maintainer modePeter Hutterer2-2/+1
See xserver commit 4bf3eac5fe20f Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-15usage(): Print summary for the -n optionSøren Sandmann Pedersen1-0/+1
This option is mentioned in the man page, but not in the help text Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2015-01-05include POSIX-standard limits.h for PATH_MAX instead of sys/syslimits.hAlan Coopersmith2-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2015-01-05Fix !HAVE_STRLCPY caseJon TURNEY2-2/+2
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>