/var/list/.bin/led is in smartlist 3.15-25build1.
This file is owned by list:list, with mode 0o755.
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 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | #! /bin/sh
: &&O='cd .' || exec /bin/sh "$0" $argv:q # we're in a csh, feed myself to sh
$O || exec /bin/sh "$0" "$@" # we're in a buggy zsh
#########################################################################
# led A wrapper for the editor, if it is told to edit #
# a SmartList governed file, it will employ all #
# the appropriate locking mechanisms. #
# In addition it warns if the editor touches the #
# file's attributes. #
# #
# Created by S.R. van den Berg, The Netherlands #
#########################################################################
#$Id: led,v 1.8 1995/11/14 04:27:25 srb Exp $
test=test # /bin/test
touch=touch # /bin/touch
rm=rm # /bin/rm
ls=ls # /bin/ls
echo=echo # /bin/echo
kill=kill # /bin/kill
sleep=sleep # /bin/sleep
chmod=chmod # /bin/chmod
basename=basename # /bin/basename
dirname=dirname # /bin/dirname
lockfile=lockfile # /usr/local/bin/lockfile
test -z "$VISUAL" && VISUAL=$EDITOR
test -z "$VISUAL" && VISUAL=vi
if test $# = 0
then
exec $VISUAL
fi
childpid=""
lockfiles=""
nlockfiles=""
touchfiles=""
TMPF=/tmp/led.$$
trap "$test -z \"\$childpid\" || $kill -1 \$childpid 2>/dev/null
$rm -f $TMPF \$lockfiles; exit 1" 1 2 3 13 15
$rm -f $TMPF
$touch $TMPF
for a in "$@"
do
case "$a" in
[-+]*) ;;
*)
if lf="`$ls -ld $a 2>&1`"
then
( set dummy $lf
$echo " $a $2 $3 $4" >>$TMPF
)
fi
file=`$basename $a`
dir=`$dirname $a`
lf=""
tf=""
case "$file" in
dist|dist.digest) lf=$dir/$file.lock ;;
rc.init|rc.submit|rc.request) tf=$dir/../.etc/rc.lock ;;
rc.custom|subscreen|subscribe.file|log) tf=$dir/rc.lock ;;
tmp.from|tmp.request) lf=$dir/tmp.lock ;;
esac
case "$lf" in
$lockfiles|"") ;;
*) lockfiles="$lockfiles $lf" ;;
esac
case "$tf" in
$touchfiles|"") ;;
*) touchfiles="$touchfiles $tf" ;;
esac ;;
esac
done
if $test -z "$lockfiles" || $lockfile $lockfiles
then
:
else
$rm -f $TMPF
exit 1
fi
$test -z "$touchfiles" || $touch $touchfiles
if $test ! -z "$lockfiles" -o ! -z "$touchfiles"
then
parent=$$
exec 9>&2 2>/dev/null
( trap 1 2 3 13 15
while $kill -0 $parent
do
$sleep 32
$chmod u+w $lockfiles
$touch $touchfiles $lockfiles
$chmod u-w $lockfiles
done
) &
childpid=$!
exec 2>&9 9>&-
fi
$VISUAL "$@"
( trap 1 2 3 13 15
exec 4<$TMPF
test -z "$SHELL" && SHELL=/bin/sh
test -z "$PS1" && PS1="$ "
PS1="Type 'exit' to resume checking after you have corrected it.
$PS1"
export PS1
while read info <&4
do
set dummy $info
file=$2
info="$3 $4 $5"
set dummy `$ls -ld $file 2>&1`
newinfo="$2 $3 $4"
if $test "X$info" != "X$newinfo"
then
$echo "***************************************************************"
$echo "Your editor messed up the attributes of '$file'." 1>&2
$echo "I now see: '$newinfo', the way it was: '$info'." 1>&2
$echo 1>&2 \
"If you don't fix this, SmartList might not operate correctly!"
$echo 1>&2 \
"I'll give you the opportunity to do so now (type exit when done)."
$echo 1>&2 ""
$SHELL 4>&-
$echo 1>&2 "Checking the rest of the files ..."
fi
done
)
exec 9>&2 2>/dev/null
$test -z "$childpid" || $kill -1 $childpid
wait
exec 2>&9 9>&-
$rm -f _dummy_ $lockfiles $TMPF
trap 1 2 3 13 15
if $test ! -z "$touchfiles"
then
for a in $touchfiles
do
if $test -f $a
then
while $echo "Remove $a? (y/n)" 1>&2
read b
case "$b" in
[Yy]*) $rm -f $a ; $test a = b ;;
[Nn]*) $test a = b ;;
*) $test a = a ;;
esac
do
:
done
fi
done
fi
|