On 01.11.05 Bonaccorso Salvatore ([EMAIL PROTECTED]) wrote:

Hi,

> Installing tex-common give some litle warning ( i don't know if it
> was appropriate to tell this):
> 
> Setting up tex-common (0.9) ...
> chgrp: invalid group name `cachegroup'
> 

> -- debconf information:
>   tex-common/groupname: cachegroup
>   tex-common/cnf_name:
>   tex-common/managedlsr: cache
> 
The problem breaks down to some lines of code in debian/config.in (I
didn't check it by running, but just by reading the code).


# first we collect those ls-R files which are group writeable in gwritetrue
# and those which are not group writeable in gwritefalse
# furthermore we save the respective group and write permission in
# ${i}group
> 
Some informatins are collected here.

# now we save the list of group writeable ls-R files to tex-common/managedlsr
db_set tex-common/managedlsr $gwritetrue || true
#
# and ask the user to check if this selection is ok
db_input low tex-common/managedlsr || true
db_go

#
# get the answer of the users, ie what files should really be group writeable
db_get tex-common/managedlsr && SELECTED_LSR="$RET" || true
if [ -n "$SELECTED_LSR" ]; then
    #
    # we check wether all the group writeable files belong to the same group
    # if yes, we suggest this group and ask the groupname question,
    # otherwise we ignore this and do *not* play around with groups.
    iscommongroup=-1
    for i in $SELECTED_LSR ; do
      eval tmp=${i}group
      if [ "X$iscommongroup" = "X-1" ] ; then
         iscommongroup=$tmp
      else
         if [ ! $tmp = $iscommongroup ] ; then
            iscommongroup=""
         fi
      fi
    done

Now think over, what will happen here. Before that 

  "if [ "X$iscommongroup" = "X-1" ]"

iscommongroup is set to -1. Hence we have to assume the test will be
successful every time. $SELECTED_LSR contains a list of ls-R files,
in this case "cache". ${i} has the value "cache" upon first run (see
above). The value of tmp is a combination of the value of i and
"group".


[EMAIL PROTECTED] ~ $ i=a
[EMAIL PROTECTED] ~ $ eval tmp=${i}group
[EMAIL PROTECTED] ~ $ echo $tmp
agroup

. After all that the value of iscommongroup is "cachegroup".

    db_set tex-common/groupname "$iscommongroup" || true
    if [ -n $iscommongroup ] ; then
      #
      # here we could be more intelligent and check wether the choosen group
      # actually exist, and if not, reask again!
      #
      db_input low tex-common/groupname || true
      db_go
    fi
fi
#
# we do not care for user permissions in this setting!
#

, which is fed to debconf finally. Maybe I'm completely wrong, but
this code seems very broken to me.

H.
-- 
sigmentation fault


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to