ls-R generation as nobody

Volker Kuhlmann <[email protected]>
Newsgroups gmane.comp.tex.tetex.general
Message-ID <[email protected]>
The generation of ls-R files was recently changed to be run as nobody,
instead of the user invoking mktexlsr (see diff at end). This creates a
problem for files which are not supposed to be accessible to every user
on the system, eg commercial pfb files [1]. Access to those files can
easily be controlled by appropriate group ownerships. However, "nobody"
isn't member of that group, and it's probably not a good idea to change
that.

Obviously I can edit the script, but is there a recommended way to deal
with this?

Thanks much,

Volker

[1] dvips in this case says it includes the pfb files, but in fact
doesn't, and doesn't show a warning either. This is probably the same
error as noted on the TeX-k list within the last week. I'm not sure
whether it would be preferable to terminate with error or create output
which looks distinctly dodgy because of font substitutions.



--- /usr/share/texmf/teTeX/bin/i586-linux-libc6/mktexlsr-tetex-2.0.2-198.3	2004-10-05 07:27:25.000000000 +1300
+++ /usr/share/texmf/teTeX/bin/i586-linux-libc6/mktexlsr-tetex-2.0.2-198.7	2005-04-02 07:29:46.000000000 +1200
@@ -66,6 +66,14 @@
 test $# = 0 && {
   OIFS=$IFS; IFS=$SEP; set x `kpsewhich --show-path=ls-R 2>/dev/null`; shift; IFS=$OIFS
 }
+
+nobody="$(id -un nobody)"
+if test "$(id -ur 2> /dev/null)" = "0" -a -n "$nobody" ; then
+    runls () { su $nobody -s /bin/sh -c 'exec -a ls ls -LRa 2>/dev/null'; }
+else
+    runls () { ls -LRa 2>/dev/null; }
+fi
+
 cache="`kpsewhich --expand-var='$VARTEXFONTS'`"
 for TEXMFLS_R in "$@"; do
   # Prepend cwd if the directory was relative.
@@ -133,7 +141,7 @@
   # removes . and .. from the list.  Note that using colons in directory
   # names results in nothing but grief.
   echo "./:" >>"$db_file_tmp"
-  (cd "$TEXMFLS_R" && \ls -LRa 2>/dev/null) |
+  (cd "$TEXMFLS_R" && \runls) |
     sed '/^\(\.\|\.\/\.\)\?lsR[0-9]\+\.\(tmp\|[0-9]\+\):\?/d
 	 /^\.:\?$/d
 	 /^\.\.$/d


-- 
Volker Kuhlmann			is possibly list0570 with the domain in header
http://volker.dnsalias.net/		Please do not CC list postings to me.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.