100 Commits
Author SHA1 Message Date
Justin MaggardandJustin Maggard 9f1677825c Fix some warnings from newer compilers 2020-11-18 14:45:11 -08:00
Justin MaggardandJustin Maggard 9fba41008a upnphttp: Disallow negative HTTP chunk lengths
[CVE-2020-28926]

This fixes a couple vulnerabilities that could lead to an infinite loop
or heap corruption.
2020-11-18 14:44:42 -08:00
Justin MaggardandJustin Maggard 06ee114731 upnphttp: Validate SUBSCRIBE callback URL
The UPnP protocol specification mandates that subscribers can request a
callback to an arbitrary URL. This recently resulted in CVE-2020-12695
(CallStranger) outlining the risk of information disclosure and DoS
attacks.

This commit ensures that the callback URL sent in a SUBSCRIBE request
points to the same IP address that made the request.
2020-11-18 14:44:33 -08:00
Justin MaggardandJustin Maggard 8f14d7223d upnpsoap: Return truncated results on full buffer
If our response buffer fills up to the max buffer size on a UPnP Browse
request, we should return short results rather than erroring out.

Fixes: #314 (Cannot browse MiniDLNA 1.2.1 with VLC 2.2.6 (UPnPError 709: Unsupported or invalid sort criteria))
2019-12-09 21:14:59 -08:00
Justin Maggard 13d36533b5 cleanup: Declare some unshared functions static. 2015-04-10 15:47:28 -07:00
Justin Maggard c1bb37a387 clients: Re-enable Samsung DCM10 flag.
The browsing issue that was reported on Samsung Series F was
actually only present when a custom root container was being
specified (http://sourceforge.net/p/minidlna/patches/121/).

So instead of disabling DCM10, fix our X_GetFeatureList
response when a custom root container is set.  If the custom
root is Browse Folders, then drop the user straight to
folder browsing for that media type.  If it's something
other than folder browsing, just set all media type roots to
the custom root container.

For future reference, the DCM10 flag enables (at least)
video bookmark support and Samsung "BasicView" support; so
selecting, for example, Videos from the Samsung UI can send
you straight to the Videos section of the media library.
2015-04-10 15:33:09 -07:00
Justin Maggard 6630671af0 images: Set DCT method to JDCT_IFAST. 2015-04-10 15:32:32 -07:00
Justin Maggard ec11819012 upnpsoap: Don't honor the NO_RESIZE flag for thumbnails
Some images don't include an embedded thumbnail, and others
have the thumbnail in the wrong aspect ratio.  In these
cases we resize ourselves, which we should allow to occur
regardless of the NO_RESIZE flag.
2015-04-09 16:57:08 -07:00
Justin Maggard 0845c2193b tivo: Fix title and description escaping. 2015-04-08 23:38:38 -07:00
Justin Maggard e165dbf7a9 metadata: Properly escape episode titles from nfo files. 2015-04-08 23:27:47 -07:00
Justin Maggard f09f441607 upnpsoap: Handle StartingIndex on magic containers
We need to subtract StartingIndex when we limit SQL query
results based on the max number of items in a magic container.
2015-04-08 01:21:21 -07:00
Justin Maggard f18c3cee6f image: Improve resize quality at the edges.
get_pix() returns opaque black pixels for out-of-bounds coordinates, resulting
in spurious averages at the edges. The attached patch appears to fix the
problem, at least for the floating-point resizers.

From SF user R.L. Horn.
2015-02-09 18:01:54 -08:00
Justin Maggard 24fb139678 metadata: Use "Album Artist" tag from AAC files.
Add Album Artist AAC metadata parsing contributed by SF user knono549.
Then, change music metadata gathering code to use either Album Artist
or Band as upnp:artist.
2015-02-03 17:22:32 -08:00
Justin Maggard 3c4c35b49c upnpsoap: Use scaled thumbnails when rotation is needed
Embedded thumbnails may have an undesirable orientation, so
we should do our own scaling with inline rotation if the
thumbnail image needs to be rotated.
2014-12-11 17:03:35 -08:00
Justin Maggard 7fe24ae1bc Wrap up version 1.1.4. 2014-08-26 14:09:22 -07:00
Justin Maggard 75a697a671 upnpttp: factor out basic header generation 2014-07-25 18:26:02 -07:00
Justin Maggard 04c8730dae clients: reduce log level of some debug messages 2014-07-25 18:25:45 -07:00
Justin Maggard 2caa05f69a Update NEWS. 2014-07-18 15:36:36 -07:00
Justin Maggard b1cd1b5413 upnphttp: fix requests for the last byte of a file
Philips TV's apparently do this with MKV files (SF bug #180).
2014-07-18 12:27:39 -07:00
Justin Maggard 5b3c6a3645 upnphttp: declare a couple functions static 2014-07-18 12:26:30 -07:00
Justin Maggard 24ec6d24fb Merge branch 'master' into ffmpeg 2014-07-11 18:17:33 -07:00
Justin Maggard 44810ab274 Stub out NLS function. 2014-07-11 18:16:33 -07:00
Justin Maggard 255bb2a5c4 tagutils-aac: fix bad null termination
SF bug #244, patch #119
2014-07-11 17:20:41 -07:00
Justin Maggard 8029921884 containers: add magic container infrastructure
Add support for dynamic containers, with enough flexibility to also
replace our existing container ID replacement functionality.
2014-07-01 17:08:18 -07:00
Justin Maggard 95bbedb196 upnpsoap: factor out some duplicated code. 2014-06-27 12:59:50 -07:00
Justin Maggard c226e615ad upnpsoap: factor out ObjecID translation into a separate function. 2014-06-26 18:54:45 -07:00
Justin Maggard a01ffa1787 Fixes for client cache restructuring. 2014-06-17 18:38:36 -07:00
Justin Maggard 0e55facacd metadata: support 64-bit time_t
OpenBSD moved all machine architectures to long long time_t in the last
release which triggered a crash in minidlna's scanner on 32-bit systems.

Reported-by: Stuart Henderson
2014-06-11 10:23:23 -07:00
Justin Maggard a46a8e5e89 process: associate open connections with clients 2014-06-09 18:48:49 -07:00
Justin Maggard e9a653d6e8 clients: restructure client cache 2014-06-09 18:02:03 -07:00
Justin Maggard 173f6a76d7 Wrap up version 1.1.3. 2014-06-05 15:14:30 -07:00
Justin Maggard 7cc2ddedff clients: add NetFront Living Connect support
Add subtitle support for NetFront™ Living Connect middleware-based
clients.  These appear to include devices from Panasonic, Philips,
Vizio, Sony, and probably more.
2014-06-05 13:47:26 -07:00
Justin Maggard 25f6c01f85 clients: remove FLAG_SAMSUNG_DCM10 capability
I'm not entirely sure what this flag enables.  But there are reports
that is breaks browsing on Samsung Series F TV's.  So we'll have to
disable for now, until that gets sorted out by people who actually
have Samsung TV's.
2014-06-05 13:10:51 -07:00
Justin Maggard bb9d584a86 metadata: get rid of some unnecessary mallocs 2014-05-16 11:07:43 -07:00
Justin Maggard 2ab6d21dbf metadata: get embedded cover art from video files using libavformat
Newer version of libavformat can grab cover art, so we'll go ahead
and use it.  We also need to make sure we don't confuse cover art
with a normal video stream.
2014-05-16 09:58:54 -07:00
Justin Maggard 05cde8a79f metadata: more libav10 compatibility changes
Add a couple more compatibility wrappers.
2014-05-14 18:33:26 -07:00
Justin Maggard ca6645e980 Merge branch 'master' into ffmpeg 2014-05-14 17:55:19 -07:00
Justin Maggard 34cb08928c portability: add support for Illumos
This still won't work on older Solaris systems, but modern Illumos
at least should build and run now.
2014-05-14 17:53:25 -07:00
Justin Maggard 28c751023a Merge branch 'master' into ffmpeg 2014-05-14 15:56:33 -07:00
Justin Maggard 361bc34f93 metadata: add libavcodec > 54 compatibility
libavcodec55 brings some API changes, including CodecID => AVCodecID.
Add a compatibility wrapper so we can build with libavcodec >= 55.
2014-05-14 15:44:15 -07:00
Justin Maggard ad4c7fbebe Merge branch 'master' into ffmpeg 2014-04-30 10:19:09 -07:00
Justin Maggard 8e05f9b6f7 Allow the user to specify an arbitrary root container. 2014-04-29 16:12:42 -07:00
Justin Maggard 820b5857a5 Fix a few memory leaks in some error conditions during image manipulation. 2014-04-29 10:44:34 -07:00
Justin Maggard 9b1d541dc8 Merge branch 'master' into ffmpeg 2014-04-28 16:02:19 -07:00
Justin Maggard 61bb91ecc9 scanner: check defined media types before parsing files 2014-04-28 16:01:30 -07:00
Justin Maggard 7cc550ac14 Merge branch 'master' into ffmpeg 2014-04-28 12:32:50 -07:00
Justin Maggard f9c37fb205 clients: add BubbleUPnP detection and enable subtitle support 2014-04-28 12:04:19 -07:00
Justin Maggard 13e3613dd6 Minor code simplification. 2014-04-28 12:00:59 -07:00
Justin Maggard 4eeb0858e4 Merge commit '750917f7ea9876d7a97f48aa4b22097fcf7958d9' 2014-04-28 10:47:01 -07:00
Justin Maggard 67e673fe51 Merge commit 'e4fcb71' into ffmpeg 2014-04-25 17:31:48 -07:00
Justin Maggard e4fcb717e7 log: replace a few fprintf's with DPRINTF's. 2014-04-25 17:31:12 -07:00
Justin Maggard 750917f7ea minissdp: fix minor uninitialized access 2014-04-25 17:13:07 -07:00
Justin Maggard be5f4a50eb Type data pointer variables as uint8_t. 2014-04-25 14:30:38 -07:00
Justin Maggard 381c4805e6 subtitles: accept smi in addition to srt 2014-04-21 15:44:39 -07:00
Justin Maggard 0721528bcd sql: introduce sql_get_int64_field()
Returns int64_t instead of int.
2014-04-21 15:43:13 -07:00
Justin Maggard 27a29f9e92 tivo: clean up some error checking 2014-04-18 16:18:00 -07:00
Justin Maggard 08c21f39d1 http: fix error handling in the fallback read/write path 2014-04-18 15:46:00 -07:00
Justin Maggard e2cebb68e1 albumart: use a separate variable for temporary pointer storage
Re-using the same one confuses some static code analyzers, and
is a bit less readable.
2014-04-18 15:36:38 -07:00
Justin Maggard 331d484555 utils: add noalloc flag to modifyString()
This should make it more straightforward for code analyzers to
tell if the function is going to allocate memory.
2014-04-18 15:18:44 -07:00
Justin Maggard b0550495e8 sql: use va_end() where appropriate 2014-04-11 14:34:23 -07:00
Justin Maggard 5676a17204 cleanup: remove unnecessary sbeacon set 2014-04-11 12:51:16 -07:00
Justin Maggard ffb8b35424 cleanup: avoid dereferencing NULL pointers 2014-04-11 12:43:59 -07:00
Justin Maggard 5bbd7b5443 albumart: remove logically dead code 2014-04-11 12:36:20 -07:00
Justin Maggard c6367aa4ce minissdp: fix potential out-of-bounds read 2014-04-11 12:31:32 -07:00
Justin Maggard 45cf9208fb Declare printf-like attributes for strcatf() and xasprintf()
Declare printf-like attributes for strcatf() and xasprintf(), and
clean up errors found by the compile after doing so.
2014-04-10 18:18:28 -07:00
Justin Maggard bc43d45964 Clean up a couple return value checks. 2014-04-07 14:20:50 -07:00
Justin Maggard 27eae53584 process: remove logically dead code. 2014-04-07 11:26:37 -07:00
Justin Maggard d492b43ef8 Fix various potential illegal access and memory leaks in error conditions. 2014-04-07 11:20:19 -07:00
Justin Maggard 6e43ab3c06 Introduce THISORNUL macro. 2014-04-07 10:29:56 -07:00
Justin Maggard e3792ad8da upnpsoap: fix uninitialized read with emtpy filter 2014-04-07 09:08:30 -07:00
Justin Maggard 435bd3d04d Use SERVER_NAME variable when checking for existing process. 2014-03-17 11:41:10 -07:00
Justin Maggard 9c8bc5d9c2 status: note when a media scan is in progress 2014-03-17 11:32:56 -07:00
Justin Maggard 98ebb0f5d5 albumart: code simplification 2014-03-17 11:01:36 -07:00
Justin Maggard 76a1ffff4e cleanup: remote obsolete references to listening_ip 2014-03-14 19:06:07 -07:00
Justin Maggard 0ea24845eb clients: add Asus O!Play support and quirks
Asus O!Play reboots with titles longer than 23 characters with some
file types when there are subtitles present.  So we truncate video
file titles with external subtitles.

It also supports subtitles in LG fashion, so add that too.
2014-03-13 10:48:41 -07:00
Justin Maggard 365d5c3412 upnpsoap: make subtitle support more generic
It sounds like more clients may support subtitles using a res element,
so we should make our support more generic.
2014-03-12 11:59:10 -07:00
Justin Maggard cce9a012b3 config: add merge_media_dirs option
By default, if there are multiple media directories specified, there
will be entries for each one in the root directory container.  If
there is only one media directory specified, then just its contents
will be in the root container, to save one level of browsing.

Setting this option changes the default behavior so that multiple
media dirs will behave like a single media dir.
2014-03-12 11:40:49 -07:00
Justin Maggard 7c0739ad3f config: introduce strtobool() helper. 2014-03-12 11:32:09 -07:00
Justin Maggard e3a53fc8a3 clients: separate Samsung BDP and TV client types again
Advertising the DCM10 vendor-specific feature to Samsung Series
C and D (at least) players causes them to always browse ContainerID
1, no matter which section is chosen from their GUI.

Treat TVs and BDPs as separate client types with unique features.
2014-03-11 14:46:21 -07:00
Justin Maggard d10293b038 autoconf: Use subdir-objects, to silence warnings from new autotools 2014-03-10 10:00:52 -07:00
Justin Maggard 10471aa29b portability: fix compiling on systems without iconv 2014-03-07 13:20:26 -08:00
Justin Maggard a606012d23 Fix Clang compiler warnings. 2014-03-07 12:42:40 -08:00
Justin Maggard 546b12e1a9 portability: rework inline functions for clang compatibility. 2014-03-07 12:36:50 -08:00
Justin Maggard ce16739213 samsung: fix root_container setting
Pretend that we don't support SamsungGetFeatureList if we have a
custom root container specified, or else the Samsung client will
jump straight to our normal A/V/P sections.
2014-03-07 12:23:58 -08:00
Justin Maggard b9404d1847 cleanup: remove unused tagutils code, and switch to standard int types 2014-03-06 17:08:21 -08:00
Justin Maggard cb95ca6e06 Wrap up version 1.1.2. 2014-03-06 16:30:25 -08:00
Justin Maggard 993a4adbbc ssdp: improve debug logging 2014-03-05 13:56:50 -08:00
Justin Maggard 5cddc8fb4d print usage and bail if the user gives an unknown command line option 2014-03-03 16:04:46 -08:00
Justin Maggard 1a78a94f70 process: make max number of children (connections) configurable
At least some Panasonic clients try to open more than 5 simultaneous
connections to the server.  If we keep the default of 5 max children,
it results in choppy playback on those clients.

Make this setting configurable, and default to 50 max connections.
Our process is pretty lightweight, so 50 children should not be a
problem on most systems.
2014-03-03 13:32:20 -08:00
Justin Maggard 372afa1ae6 cosmetic: whitespace cleanup 2014-03-03 13:28:31 -08:00
Justin Maggard 6cef303fc1 try to ensure proper ownership of db_dir
If user has been set, try to ensure that db_dir is owned by that user.
If that fails, log an error.
2014-02-27 15:47:02 -08:00
Justin Maggard 4236d53b59 ssdp: add multicast membership as the individual interfaces come up
Previously, this was only done during startup, so interfaces that
came up later wouldn't have been added.
2014-02-26 15:09:21 -08:00
Justin Maggard fe7c26da2f ssdp: send a full byebye + alive set when a new interface comes online
If an interface comes online after startup, we really need to send a
complete byebye + alive set on that interface, but we don't want to do
it for other interfaces.  So do it as the interfaces come up, and
skip it for interfaces that existed before the reload.
2014-02-26 15:04:46 -08:00
Justin Maggard a7c8ffb88d cosmetic: whitespace cleanup 2014-02-26 12:37:14 -08:00
Justin Maggard ea9a530a3a clients: keep generic device records
Now that we display connected clients in the status page,
it makes sense that we show all of them, instead of only
recognized device types.
2014-02-26 12:34:15 -08:00
Justin Maggard 005cb0bd30 Fix uninitialized access when adding multicast membership.
Thanks Keith for pointing this out.
2014-02-18 10:39:43 -08:00
Justin Maggard 65fb740414 upnpsoap: Support searches specifying @parentid = 0. 2014-02-04 12:03:57 -08:00
Justin Maggard a3252bd2dd minissdp: Use struct ip_mreqn for multicast membership if it's available. 2014-02-03 15:02:30 -08:00
Justin Maggard 1e7fe1413c scanner: Avoid largeish stack allocations in recursive function. 2014-02-03 12:34:48 -08:00
Justin Maggard 67fd1fe45a getifaddrs: Fix building on systems without IFF_SLAVE. 2014-02-03 11:57:34 -08:00