[2212] in SIPB bug reports
[daemon@ATHENA.MIT.EDU : Re: Major problems with TeX-3.14 ]
daemon@ATHENA.MIT.EDU (marc@Athena.MIT.EDU)
Wed Oct 30 11:11:49 1991
From: marc@Athena.MIT.EDU
Date: Wed, 30 Oct 91 11:11:12 -0500
To: bug-sipb@Athena.MIT.EDU
------- Forwarded transaction
[0360] daemon@ATHENA.MIT.EDU (irvin@betelgeuse.dartmouth.edu) Info-AFS_Redistribution 10/29/91 10:55 (90 lines)
Subject: Re: Major problems with TeX-3.14
To: zalewk@rpi.edu
Cc: info-afs@transarc.com
Reply-To: irvin@northstar.dartmouth.edu
In-Reply-To: Your message of Tue, 15 Oct 91 17:13:59 EDT.
Date: Tue, 29 Oct 91 09:21:14 +22322538
From: irvin@betelgeuse.dartmouth.edu
In message <9110152113.AA03637@rpi.edu> you write:
> At RPI, we have recently installed TeX, Version 3.14 into AFS space. I had
> orginally built it in NFS space, after FTPing the sources from byron. TeX,
> LaTeX, et al worked fine on all the architectures I built it for, which
> include SUN4's, SUN3's, RS/6000's, and AIX/370.
>
> However, upon moving everything into AFS space, strange things started
> happening. Users reported getting "<directory>: Permission Denied" messages,
> where <directory> was some directory in AFS space, and NOT one of the
> directories that TeX uses (ie. fonts, inputs, formats, etc.).
>
I have a fix for this problem. I got some pointers from people on
comp.text.tex, and poked around a bit. The problem is that getwd()
was hand rolled, since it is not universally available on all machines.
The function is located in common/extra.c .
If you machine has a getwd() function, then I would recommend using it,
otherwise you will need to hack the included function to work with the
AFS problems.
Compile the following and run it from various locations within AFS to see if
you have a builtin getwd() and to see if it will work in AFS.
#include <stdio.h>
char *getwd();
main() {
char buf[1024];
getwd(buf);
printf("cwd = %s\n", buf);
}
If this works, you're in fat city. Go to your TeX source directory
and edit common/extra.c
You will need to remove (or comment out) the getwd() function (lines: 503-566).
It starts out like this:
char *
getwd ()
{
struct stat root_stat, cwd_stat;
char *cwd_path = xmalloc (1);
*cwd_path = 0;
and ends up like this:
if (*cwd_path == 0)
cwd_path = "/";
else
/* Go back to where we were. */
checked_chdir (cwd_path);
return cwd_path;
}
then find where getwd is called (line: 607) -> cwd = getwd ();
and change this to read: cwd = getwd (xmalloc(1024));
Don't worry, xmalloc is defined in this file. That's all there is to
it, just recompile TeX now and your all set.
This has been tested on the following platforms:
IBM-RT and IBM-6152 running AOS4.3 (rt_aos4)
IBM RS/6000 running AIX3.1 (rs_aix31)
SUN4/110 and Sparc 1 running SunOS4.0.3 (sun4_40 & sun4c_40)
SUN3/60 and SUN3/280 running SunOS4.0.3 (sun3_40)
An additional advantage of this patch is that it is *MUCH* faster than
the method currently used.
Let me know if you want a diff of the above changes to patch your file.
Hope this helps.
Tim Irvin
Systems Administrator
Project NORTHSTAR
Dartmouth College
--[0360]--
------- End forwarded transaction