]> git.tuebingen.mpg.de Git - paraslash.git/commit
Truncate overlong tag info and replace newlines by spaces.
authorAndre Noll <maan@systemlinux.org>
Wed, 27 May 2009 17:16:54 +0000 (19:16 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 27 May 2009 17:16:54 +0000 (19:16 +0200)
commit86fdff38d980c39062764a31f40a2ee2c5854d33
tree132b766858bc937e31f845bc48d0ed6f2a5198f7
parent711b364a5a88932de99aa559ce4a683b26dc2afc
Truncate overlong tag info and replace newlines by spaces.

The tag info which is computed by the audio format handlers and stored
in the audio file table is read into a fixed-size buffer by the audio
file selector in open_and_update_audio_file(), passed to the server
process and then sent to the client via the stat command. It is not
interpreted at all during this process. In particular, it is not
essential for correctly streaming the audio file.

Vorbis comments and id3v2 tags have no size limit and may contain
arbitrary data which may lead to the following twi problems:

- As noted by Gerrit Renker, if the tag info is too long
to fit into the fixed-size buffer, the current code skips
the audio file and removes it from the list of currently
admissible files. So para_server fails to stream such files.

- If the tag info contains newlines, these are included
verbatim in the status output which may confuse para_audiod.

This patch truncates the tag info string if it does not fit into the
4K buffer and replaces newlines by spaces. This is a bit ugly but
avoids both of the above problems. It's still possible to retrieve
the complete tag info via the "ls -lv" command.
aft.c