]> git.tuebingen.mpg.de Git - paraslash.git/commit
aft: Store resolved paths when adding files.
authorAndre Noll <maan@tuebingen.mpg.de>
Wed, 24 Dec 2014 03:07:48 +0000 (03:07 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Mon, 30 Mar 2015 21:40:58 +0000 (21:40 +0000)
commitf3623744f5b28e0df91323cf5069f1932df7848d
treee755ae2df5432e3b43fd36be2c1d6a34842d36a2
parent780f2f681bccf82024bdb6da2e2cccaa0e084663
aft: Store resolved paths when adding files.

Currently the add command performs some sanity checks on the given
paths, but stores them unmodified in the audio file table if they
pass the checks. This commit removes the checks in favor of a call to
realpath(3) to get the canonicalized absolute pathname to be stored
in the audio file table.

The new code relies on POSIX.1-2008 semantics. That is, it calls
realpath() with second argument NULL to let the function allocate a
suitably sized buffer. This should not be a problem, since the old
POSIX.1-2001 version is broken by design, and all moderately recent
systems support the new semantics.

This change breaks t0004 which expects the ls -p command to print
the same paths that were used earlier to add audio files, which is
no longer true. We fix the test by simply running ls without the
-p option.
aft.c
t/t0004-server.sh