Bug#332264: tex-common: permission-handling of ls-R files is one-way
Hi Frank!
On Fre, 07 Okt 2005, Frank Küster wrote:
> > truegwrite=""
> > falsegwrite=""
>
> I don't like these names - truegwrite evokes "Trug" in my head. Why not
> gwritetrue and gwritefalse (if only it sounds more like
> \newif\if@gwrite\gwritetrue...)
Well, easy.
> > for i in var cache main ; do
> > ${i}group=""
>
> Sometimes I'm dreaming about using Perl for maintainer scripts. This is
> one occation (my %group \dots). Furthermore:
Why not use it. It is possible!
> frank@alhambra:~$ i=var
> frank@alhambra:~$ ${i}group=""
> bash: vargroup=: command not found
> frank@alhambra:~$
Hmm, damned, I thought it would work.
> i=var
> eval group_$i=users
> eval echo \$group_$i
Ok, I will rewrite it.
> > lsr=`select_lsrfile $i`
> > if [ -r $lsr ] ; then
> > ${i}group=`echo $lsr | awk '{print$4}'`
> > if ls -l $lsr | grep -q ^.....w ; then
>
> I don't understand the syntax in these lines (the purpose seems clear).
> From the lines with "if" it seems that lsr contains a filename, but from
> the assignment to ${i}group it seems it is the output of "ls -l $file".
Again write. select_lsrfile is missing, it justs gives me for var cache
main the correct full path of the respective ls-R file.
It should be `ls -l $lsr ...
> > db_get tex-common/managedlsr && SELECTED_LSR="$RET"
>
> db_get tex-common/managedlsr && SELECTED_LSR="$RET" || true
ok.
> > Please note that we do not care for user permissions ATM, this way.
>
> Hm, you mean permissions for "others", right? The owner will be root.
Yes. I sadi user perm because the template is called userperm
> writeable by others, that's what we want. If someone previously had set
> write permissions for "others" on ls-R files, this will not be changed
> upon an upgrade. I think we can keep it like this, but should mention
> it in NEWS.Debian or README.Debian.
Ok.
> > postinst.in implementation proposal, please comment:
> >
> > db_get tex-common/managedlsr || true
> > if [ -n "$RET" ] ; then
> > falsegwritefiles=""
> > MANAGEDLSR="$RET"
> > for i in var cache main ; do
> > if echo $MANAGEDLSR | grep -q $i ; then
> > :
> > else
> > $falsegwritefiles="$falsegwritefiles $i"
> > fi
>
> There's a perl variable in it, and why not revert it?
ooops.
> if ! echo $MANAGEDLSR | grep -q $i ; then
> falsegwritefiles="$falsegwritefiles $i"
> fi
>
> Or just
>
> echo $MANAGEDLSR | grep -q $i || falsegwritefiles="$falsegwritefiles $i"
much better.
> > else
> > echo "Fixing permissions of ls-R files ..."
> > chmod -v 644 $LSRS 2>/dev/null | fgrep changed || true
> > fi
>
> why the fgrep?
This I took from the tetex-base postinst script. In fact I would habve
used grep, but didn't know why whoever (you?) long time ago used fgrep.
> > Here it is not clear what we should do at the end, when NO group file is
> > selected, ie the last else clause. Probably we shouldn't touch anything
> > at all!
>
> Yes, I think we should change nothing (just as your code does, doesn't it?)
No, atm (this is exactely the else clause above) it DOES change the
permission of ALL ls-R files (variable LSRS, globally set)!
I will send another version soon.
Best wishes
Norbert
-------------------------------------------------------------------------------
Dr. Norbert Preining <preining AT logic DOT at> Università di Siena
sip:preining@at43.tuwien.ac.at +43 (0) 59966-690018
gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
LIFF (n.)
A book, the contents of which are totally belied by its cover. For
instance, any book the dust jacket of which bears the words. 'This
book will change your life'.
--- Douglas Adams, The Meaning of Liff
Reply to: