[tex-live] tlmgr: permissions on /tmp/texlive.tlpdb.lzma
Norbert Preining
preining at logic.at
Fri Sep 12 22:39:40 CEST 2008
On Fr, 12 Sep 2008, Dr. Clea F. Rees wrote:
> What role does /tmp/texlive.tlpdb.lzma play?
It is a temp file. And it should be removed. Sorry, I will try to fix
it.
The same happens with /tmp/texlive.tlpdb
> --list" or "tlmgr list", I get a message complaining that permissions
> are denied for /tmp/texlive.tlpdb.lzma. The permissions are 0644 with
Not surprising.
PLEASE:
- fetch current tlmgr.pl AND TLPDB.pm
- as root call tlmgr update --list
- as normal user try tlmgr update --list
Karl, that is that patch, I will try to hack something for Win32 and
temp files.
Index: TLPDB.pm
===================================================================
--- TLPDB.pm (revision 10573)
+++ TLPDB.pm (working copy)
@@ -205,6 +205,7 @@
$self->root($root_from_path);
}
my $retfh;
+ my $tlpdbfile;
if ($path =~ m;^((http|ftp)://|file:\/\/*);) {
debug("TLPDB.pm: trying to initialize from $path\n");
# if we have lzmadec available we try the lzma file
@@ -214,7 +215,9 @@
my $bn = TeXLive::TLUtils::basename("$path");
my $lzmafile = "$tmpdir/$bn.lzma";
my $lzmafile_quote = $lzmafile;
- my $tlpdbfile = "$tmpdir/$bn";
+ # this is a variable of the whole sub as we have to remove the file
+ # before returning
+ $tlpdbfile = "$tmpdir/$bn";
my $tlpdbfile_quote = $tlpdbfile;
if (win32()) {
$lzmafile =~ s!/!\\!g;
@@ -231,6 +234,9 @@
# lzmadec *hopefully* returns 0 on success and anything else on failure
if (!system("$::progs{'lzmadec'} < $lzmafile_quote > $tlpdbfile_quote")) {
debug("Un-lzmaing $lzmafile did not succeed, try normally\n");
+ # to be sure we unlink the lzma file and the tlpdbfile
+ unlink($lzmafile);
+ unlink($tlpdbfile);
} else {
unlink($lzmafile);
open $retfh, "<$tlpdbfile" or die"Cannot open $tlpdbfile!";
@@ -266,6 +272,9 @@
if (!$found) {
tlwarn("Cannot read any package from $path, seems not to be a TLPDB!");
}
+ # remove the un-lzma-ed tlpdb file from temp dir
+ # THAT IS RACY!!! we should fix that in some better way with tempfile
+ unlink($tlpdbfile) if $tlpdbfile;
return($found);
}
Best wishes
Norbert
-------------------------------------------------------------------------------
Dr. Norbert Preining <preining at logic.at> Vienna University of Technology
Debian Developer <preining at debian.org> Debian TeX Group
gpg DSA: 0x09C5B094 fp: 14DF 2E6C 0307 BE6D AD76 A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
BROUGH SOWERBY
One who has been working at that same desk in the same office for
fifteen years and has very much his own ideas about why he is
continually passed over for promotion.
--- Douglas Adams, The Meaning of Liff
More information about the tex-live
mailing list