libgocryptfs/tests/maxlen.bash
Jakob Unterwurzacher b068ffbff9 maxlen.bash: result was 1 too high
Additionally, output 0 instead of 7 on permission errors.
2016-10-04 10:26:22 +02:00

19 lines
297 B
Bash
Executable File

#!/bin/bash -eu
#
# Find out the maximum supported filename length and print it.
#
# Part of the gocryptfs test suite
# https://nuetzlich.net/gocryptfs/
NAME="maxlen."
LEN=0
while [ $LEN -le 10000 ]; do
touch $NAME 2> /dev/null || break
rm $NAME
LEN=${#NAME}
NAME="${NAME}x"
done
echo $LEN