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

Re: fonts in user home



Hi,

Frank Küster <frank@debian.org> wrote:

> I am sure people will request it.  And in the long run, people will want
> to use filesystems (and kernels) that even don't allow everything to
> root, and need a special user for special maintenance purposes.

OK, I eventually removed the use of mktemp to avoid the problem of
permissions. The temporary file is created in the destination directory
(therefore, it will have the right default permissions for this
directory and user's umask) and mv'ed to the destination file when
complete. Of course, the temporary file name is predictable but this is
no problem since the directory should not be world-writable.

Of course, now I am forced to setup a trap to erase the temporary file
in case the script is killed (contrary to /tmp, the directory where it
is created now is quite unlikely to be cleaned upon reboot). So, I took
the list of signals to trap from teTeX's updmap. Mustn't be too bad...

> I wasn't aware of the complications.  Let's just add the id check, and
> people who want to run update-updmap as non-root users should use sudo.
> So the check must be sudo-safe (I'm not really sure, but I think you can
> still see from the environment of a sudo'ed command who actually is
> calling it).

update-updmap now has two modes of operation. System-wide and
user-specific. The mode is selected this way:
  - system-wide if 'id -u' returns 0
  - user-specific otherwise

It is easy, though slighlty awkward WRT to setting the default values
for options, to add a --system-wide option that forces system-wide mode
even if 'id -u' returns non-zero. So, if people want to do what you
said, no problem, that will be done.

In system-wide mode, update-updmap behaves just as in the previous
version (at least, it should!).

In user-specific mode, an additional user-specific updmap.d directory is
merged with the system-wide /etc/texmf/updmap.d directory. The order of
the files is preserved, thus, if you have
/etc/texmf/updmap.d/{04foo,06bar}.cfg
and ~/.texmf-config/updmap.d/05baz.cfg, they will appear in this order in
updmap.cfg:

  /etc/texmf/updmap.d/04foo.cfg
  ~/.texmf-config/updmap.d/05baz.cfg
  /etc/texmf/updmap.d/06bar.cfg

Additionally, shadowing of system-provided files is supported: in the
previous example, if you also have ~/.texmf-config/updmap.d/06bar.cfg,
it will be used instead of /etc/texmf/updmap.d/06bar.cfg.

Finally, you have control over two things: the user-specific
configuration directory if running in user-specific mode
($conf_dir = ~/.texmf-config/updmap.d in the example), and the output
file ($output_file = /path/to/updmap.cfg). There are two new options to
set them (-c/--conf-dir and -o/--output-file) and their default values
are computed as follows:

 a) System-wide mode

    $output_file defaults to /var/lib/texmf/web2c/updmap.cfg.
    $conf_dir has no meaning in this mode.

 b) User-specific mode

    If $TEXMFVAR expands to a single directory (with 'kpsewhich
    --expand-path'), then $output_file defaults to
    $TEXMFVAR/web2c/updmap.cfg. Otherwise, the --output-file option must
    be specified.
    
    The first updmap.d subdirectory in the expansion of $TEXMFCONFIG, if
    any, is used as the default for $conf_dir. Otherwise, --conf-dir
    must be specified.

As a result, in the default setup for tetex 3, users can simply run
"update-updmap" without any arguments; ~/.texmf-config/updmap.d/ will be
used as the input directory and updmap.cfg will be created in
~/.texmf-var/web2c.

I didn't update the manpage yet. Too busy. Will be done around mid-july.

Attaching the bzip2'd script 'cause it's shorter than the patch... BTW,
I see that you add '# skeleton-pair: t' to all the tetex scripts. Isn't
there any way to set it globally in your Emacs configuration?

Last thing: now, the script should me moved to from /usr/sbin to
/usr/bin and the man page should be moved from section 8 to section 1.

> I wouldn't encourage people to work as root by adding such
> possibilities, especially not when we have better things to do. 

Quite right.

Regards,

Attachment: update-updmap.bz2
Description: update-updmap version 0.6

-- 
Florent

Reply to: