Commit Graph
2311 Commits
Author SHA1 Message Date
Chris Boot 5dc4c9ca14 tinysvcmdns: fix CVE-2017-12087
This patch incorporates upstream's fixes for a remotely exploitable
buffer overflow bug in the bundled tinysvcmdns library. The following
upstream commits are included:

https://bitbucket.org/geekman/tinysvcmdns/commits/48c73fbb36b7a5584b00538d89c89dd8b15ab2a7
https://bitbucket.org/geekman/tinysvcmdns/commits/29ea1b9fca94dc42d16109e050d2967231b1e341

The changes have been incorporated preserving local changes such as the
check for malloc() returning NULL.

Reported against shairport-sync in Ubuntu Launchpad:
https://bugs.launchpad.net/ubuntu/+source/shairport-sync/+bug/1729668

This commit closes GitHub issue #619.
2017-11-23 14:36:04 +00:00
Mike BradyandGitHub 0ea60e7587 Update RELEASENOTES.md 2017-11-20 19:15:01 +00:00
Mike Brady 03321799fb Add previous and next controls 2017-11-20 13:16:17 +00:00
Mike Brady dc111c8d1d Send playing status as soon as the first packet is received 2017-11-20 11:45:49 +00:00
Mike BradyandGitHub 677ced12ae Update RELEASENOTES.md 2017-11-19 21:47:32 +00:00
Mike Brady bafdd94e33 Clang-format 2017-11-19 21:41:11 +00:00
Mike Brady b98e2a0854 Handle play / pause / play-pause / stop but primitively 2017-11-19 21:40:09 +00:00
Mike Brady df7c48f0f3 Clean up naming of some files, get the 'stop' command working 2017-11-19 21:16:36 +00:00
Mike Brady 67dfe591d0 Reorganise D-BUS interface code and introduce an MPRIS interface. 2017-11-19 16:14:53 +00:00
Mike Brady 74f41a1769 Reorganise D-BUS interface code and introduce an MPRIS interface. 2017-11-19 16:08:39 +00:00
Mike Brady 79e610fa81 It turns out you don't need to add an interface file or a service file for a dbus app that doesn't need to be autostarted, or something. 2017-11-12 22:32:02 +00:00
Mike Brady b606c5a2a8 Forgot documentation updates, again!
Merge branch 'development' of github.com:mikebrady/shairport-sync into development
2017-11-12 16:54:08 +01:00
Mike Brady 9d2eb511cd Fix a variable substitution. Might be problematic for BSD 2017-11-12 16:53:55 +01:00
Mike BradyandGitHub e61ee0d4d5 Update RELEASENOTES.md 2017-11-12 14:54:19 +00:00
Mike Brady d4eae76f33 dbus-related files taken from directories and renamed 2017-11-12 15:45:29 +01:00
Mike Brady f5248a20e1 Change the names of some of the files. 2017-11-12 14:49:53 +01:00
Mike Brady e50e39a3f9 Merge branch 'development' of github.com:mikebrady/shairport-sync into development
Forgot the typo fix.
2017-11-12 14:28:02 +01:00
Mike Brady 3198ec4265 Improve dbus and add some dacp services 2017-11-12 14:26:10 +01:00
Mike Brady 532c77eb23 clang-format only 2017-11-12 14:25:09 +01:00
Mike BradyandGitHub 5e6b3382b0 Merge pull request #614 from corbinsantin/development
Fix typo in README.md
2017-11-09 09:19:59 +00:00
Corbin Santin df603dc8bc Update README.md
small typo
2017-11-09 00:15:36 -08:00
Mike Brady 827fa5a5b0 Clean up rtp_send_client_command a little 2017-11-06 09:05:22 +00:00
Mike BradyandGitHub 00dbf5aa3d Update RELEASENOTES.md 2017-11-04 12:02:39 +00:00
Mike BradyandGitHub 177992fb58 Merge pull request #612 from belboj/signal-race
Fixed race condition when stopping other threads with SIGUSR1
2017-11-04 11:43:35 +00:00
Belbo b98e6a9ac0 Fixed race condition when stopping other threads with SIGUSR1
Many threads have a main loop that checks some exit variable in the loop condition. To stop a thread, another thread sets that exit variable, sends a SIGUSR1 to that thread to get it out of blocking calls like read(), write() or select(), and finally joins it.

There was a race condition though: if the signal arrived after the loop condition was checked but before the blocking system function was entered, the target thread essentially ignored the signal, made the blocking call anyway, and could get stuck forever there.

The only way around this race condition is to block SIGUSR1 in the destination thread during the critical time interval. This requires that the blocking system call and the call to unblock SIGUSR1 be an atomic unit. There is only one system call that makes this possible: pselect(), which takes a signal mask to replace the current signal mask with, but only while pselect() runs. Other functions like read(), recv(), write() and sendto() may only be called if we can be sure that they don't block. For this purpose, the file descriptors must be set to non-blocking mode and we must prepend the call to them with a call to pselect() to block until the socket becomes readable/writable.
2017-11-01 20:46:05 +01:00
Mike BradyandGitHub 183c6f08e0 Update RELEASENOTES.md 2017-11-01 15:56:59 +00:00
Mike BradyandGitHub 889bae4d3e Merge pull request #611 from belboj/some-fixes
Some issues found during the development of a DLNA backend.

Many thanks for these.
2017-11-01 15:49:37 +00:00
Belbo 3e54765193 Fixed loop condition in non_blocking_write()
The while loop should be repeated, if the last write attempt was a partial write only. In this case, however, rc is greater than 0 (should be 1), not equal to 0.
2017-10-31 23:19:22 +01:00
Belbo afa3238829 Fixed EINTR handling in rtsp_read_request()
EINTR is an error code written to errno, not returned by read().
2017-10-31 23:19:22 +01:00
Belbo 39e122a4ff Fixed dangling pointer to random state array
The C library function initstate(), at least in macOS El Capitan, not only sets the state array given to it as the second argument, but also accesses the state array given to it in a previous call! (I don't know why, or if that behaviour is correct, but macOS seems to do that anyhow).
Therefore, we cannot pass a local variable to it. As soon as the player thread stops, it will be a dangling pointer, and when a new player thread is started afterwards, initstate() will dereference that dangling pointer with unforeseeable consequences.
2017-10-31 23:19:22 +01:00
Belbo a704b2fe0b handle_announce() waits for playing_conn to stop if it's already shutting down
- If playing_conn is already stopping, handle_announce() waits one second for it to stop. This gives the current RTSP connection a better chance to get the player, if it has been started very quickly after the previous RTSP connection had decided to stop. iTunes can sometimes be very quick in starting a new RTSP connection after tearing down the previous one, but shairport_sync unfortunately needs at least 100ms to shut down the old connection.
- cleanup_threads() sets playing_conn to NULL if it points to the removed thread, otherwise playing_conn would be a dangling pointer, which is bad, because handle_announce() dereferences it unless it is NULL.
2017-10-31 23:19:22 +01:00
Belbo 19ff6042cf Prevent buffer overflow in log functions
die(), warn(), debug() and inform() write the string into a limited internal buffer first. They now use vsnprintf() instead of vsprintf() to prevent an overflow of that buffer.
2017-10-31 23:19:21 +01:00
Mike BradyandGitHub 9f2acec154 Update RELEASENOTES.md 2017-10-30 09:49:20 +00:00
Mike Brady d46172e2eb Don't disable PulseAudio autospawn 2017-10-30 10:45:38 +01:00
Mike Brady 5fba88cd60 Add an exit diagnostic, clean up a dbus flag 2017-10-30 10:37:34 +01:00
Mike Brady 91c6587d78 Address a warning about a buffer being too short. 2017-10-25 19:31:10 +01:00
Mike Brady d406514966 Correct a few warnings that show upo in Clang but not in GCC 2017-10-24 10:30:20 +01:00
Mike Brady 588c551bae Correct a Makefile bug that was silent in Linux but caused problems in FreeBSD 2017-10-24 10:29:43 +01:00
Mike BradyandGitHub 7389ea8099 Update RELEASENOTES.md 2017-10-22 10:23:48 +01:00
Mike Brady 6467803858 Adjust the debug level of buffers exhausted and network condition messages. 2017-10-22 11:20:21 +02:00
Mike Brady 338831455b Oops -- a little typo. 2017-10-15 14:38:52 +01:00
Mike BradyandGitHub d3241cfeaf Update RELEASENOTES.md 2017-10-15 14:29:33 +01:00
Mike BradyandGitHub f27f4db9b6 Update RELEASENOTES.md 2017-10-15 14:29:04 +01:00
Mike Brady 90874ea6f8 Merge branch 'development' of https://github.com/mikebrady/shairport-sync into development
Oops.
2017-10-15 14:24:14 +01:00
Mike Brady 3cb86f400b Add the 'dapo' metadata message, giving the DACP port number when found 2017-10-15 14:23:09 +01:00
Mike Brady 415b3f4ba9 Generalise volumeup to any command. 2017-10-15 13:08:21 +01:00
Mike BradyandGitHub ca29610722 Update RELEASENOTES.md 2017-10-13 22:24:06 +01:00
Mike Brady b3a90f9d6d Make the volumeup command work with IPv6 -- use the scope_id 2017-10-13 22:16:50 +01:00
Mike Brady ce06d45033 Hook up "volumeup" remote control command -- doesn't work on ipv6, it seems 2017-10-09 22:14:34 +01:00
Mike Brady c3bfb048ca Checnk the order of the commands a little 2017-10-09 11:02:54 +01:00