/usr/share/gfarm/config/config-gfarm.common is in libgfarm1 2.6.15+dfsg-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | ABORT()
{
[ $# -gt 0 ] && echo >&2 "${PROGNAME}: $@"
echo >&2 "$PROGNAME failure"
exit 1
}
gen_passwd()
{
chars="=.0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
if [ -r /dev/urandom ]; then
# enough entropy, use 258bit(=log2(64)*43) key
dd if=/dev/urandom bs=44 count=1 2>/dev/null | od -d |
$awk '
BEGIN{
chars="'"$chars"'"
k=length(chars)
chars_per_word=2
l=43 # 43 characters, 256bits/log2(64) = 42.666
}
{
for (i = 2; i <= NF; i++) {
r = $i
for (j = 0; j < chars_per_word; j++) {
if (l <= 0)
exit
printf "%c", substr(chars, r%k + 1, 1)
r /= k
--l
}
}
}
END {
printf "\n"
}'
else
# 32bit entropy due to the seed, use 66bit(=log2(64)*11) key
$awk '
BEGIN {
chars="'"$chars"'"
k=length(chars)
srand(); now = srand();
srand('$$' * 12 * 60 * 60 + now)
for (i = 0; i < 11; i++) {
printf "%c", substr(chars, int(rand()*k)+1, 1)
}
printf "\n"
exit
}'
fi
}
mkcnf()
{
# local out
out=$1
shift
if ${1+"$@"} >$out; then
echo created $out
else
ABORT "cannot create $out"
fi
}
delete_file_or_directory()
{
run_or_echo=
force=false
while [ $# -gt 0 ];
do
if [ X"$1" = "X-n" ]; then
run_or_echo="echo"
force=true
elif [ X"$1" = "X-f" ]; then
force=true
else
break
fi
shift
done
# local p
for p
do
[ -d "$p" ] && $run_or_echo rmdir "$p" > /dev/null 2>&1
# [ -e "$p" ] isn't portable. not supported by Solaris /bin/sh
if ls -1d "$p" >/dev/null 2>&1; then
if [ X"$force" = "Xtrue" ] ; then
$run_or_echo rm -rf "$p"
else
ABORT "$p already exist"
fi
fi
done
}
create_directory()
{
# local d
for d
do
[ -d "$d" ] && continue
if mkdir -p "$d"; then
echo created "$d"
else
ABORT "mkdir -p $d, failed"
fi
done
}
prompt_qa()
{
ans=
while [ X"$ans" = X ]; do
echo >&2 -n "$1 [y/n]: "
read answer
ans=`echo $answer | sed -e "s| ||g"`
if [ X"$ans" = "Xy" -o X"$ans" = "XY" ]; then
return 0
elif [ X"$ans" = "Xn" -o X"$ans" = "XN" ]; then
return 1
else
ans=
echo >&2 "answer 'y' or 'n'."
echo >&2 ""
fi
done
}
|