[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#332264: tex-common: permission-handling of ls-R files is one-way



Norbert Preining <preining@logic.at> wrote:

> Hi Frank!
>
> On Fre, 07 Okt 2005, Frank Küster wrote:
[...]
>> >     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.

Hm, yes, my real question is: Why grep at all?  Why not

chmod -v 644 $LSRS 2>/dev/null || true

I must admit that I don't know chmod's "-v" messages, but what else
would one expect on stdout than "mode of `<file>' changed to 644"?

>> > 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)!

Okay, I misunderstood this and thought "when no common group is found" -
I looked at the *nonexisting* else clause of the stanza

      db_get tex-common/groupname || true
      LSRGROUP="$RET"
      if [ -n $LSRGROUP ] ; then
        for i in $MANAGEDLSR ; do
            lsr=`select_lsrfile $i`
            chgrp -v $LSRGROUP $lsr 2>/dev/null | fgrep changed || true
        done
      fi

Here we don't need one.  As for the case that no files are managed by
us, indeed we should do nothing.  Just drop the else branch, I'd say.

Regards, Frank
-- 
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer




Reply to: