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

Re: Bug#352394: tex-common: permission scheme for /var/cache/fonts



Dear all!

On Mon, 13 Feb 2006, Norbert Preining wrote:
> > If we do this, why not drop any special handling of TEXMFMAIN and
> > TEXMFVAR completely?  Local admins with special needs can always use
> > dpkg-statoverride. 

I have submitted a new version of config.in, postinst.in, and templates.
Please review.

I include here the stuff for your convenience:
config.in:
---------------------------------------
...
# and unregister old tex-common questions, they are not needed anymore
db_unregister tex-common/groupperm || true
db_unregister tex-common/userperm || true
db_unregister tex-common/managedlsr || true

# we set the groupname seen flag to false in any case since now it has
# a completely new meaning
db_fset tex-common/groupname seen false || true

# this script may be run twice: Once by dpkg-preconfigure, once again by
# debconf when it is sourced in the postinst script.  We must do the
# following only once, therefore we fiddle with a special flag
db_fget tex-common/managecache firstrundone || true

if [ "$RET" != "true" ]; then
  # we are in the first pass, set the flag and do the things
  db_fset tex-common/managecache firstrundone true

  # check wether the directory /var/cache/fonts is group writeable and
  # for which group
  PERMS=$(stat --format="%a" /var/cache/fonts)
  GROUP=$(stat --format="%G" /var/cache/fonts)
  if [ $PERMS = 2775 ] ; then
    db_set tex-common/managecache true || true
    db_set tex-common/groupname "$GROUP" || true
  else
    db_set tex-common/managecache false || true
  fi
  db_input low tex-common/managecache || true
  db_go

  db_get tex-common/managecache || true
  if [ "$RET" = true ]; then
    db_input low tex-common/groupname || true
    db_go
  fi
fi
--------------------------------------------------------------------

postinst.in:
-------------------------------------------
    #
    # do the config stuff
    db_get tex-common/managecache || true
    if [ $RET = true ] ; then
      db_get tex-common/groupname || true
      GROUP="$RET"
      if [ -n "$GROUP" ] ; then
        find /var/cache/fonts -type d -print0 | xargs -0r chmod 02755
        find /var/cache/fonts -type d -print0 | xargs -0r chown "root:$GROUP"
      fi
    fi

    # the config script may be run twice: Once by dpkg-preconfigure,
    # once
    # again by debconf when it is sourced in the postinst script.  On
    # the
    # first pass, it sets a special flag, which must now be reset.
    db_fset tex-common/managecache firstrundone false || true
---------------------------------------------------

templates:
--------------------------------------------
Template: tex-common/managecache
Type: boolean
Default: true
_Description: Manage the permissions of the TeX font cache with debconf.
 A TeX system may have to generate new font data (pixel data, metric,
 sources) on the fly. These files can be saved into the TeX font cache
 in /var/cache/fonts and later reused.
 .
 If you accept, you can specify a group name and *all* directories under
 /var/cache/fonts will get ownership root:<groupname> and permission
 bits 2755 (i.e. writeable for the group <groupname> and sticky bit set).

Template: tex-common/groupname
Type: string
Default: users
_Description: Which group should own the TeX font cache.
 You can choose a specific group which will own all directories under and
 including the TeX font cache /var/cache/fonts. These directories will
 get permission bits 2755. We suggest to select the group 'users' here.
------------------------------

Best wishes

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining <preining AT logic DOT at>             Università di Siena
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
BENBURB
The sort of man who becomes a returning officer.
			--- Douglas Adams, The Meaning of Liff



Reply to: