A few days ago I wrote about a problem applying a filter to a message
in a repl or forw.
Jonathan Ryshpan wrote:
>When I upgraded RedHad from version 7.0 to 7.1, vi started to complain
>about attemps to invoke a process on a part of the text, for example:
> !!fmt
>Vi returns a message like this:
> "/tmp/v513709/4" Can't open file for writing
> Can't create file /tmp/v513709/4
> Hit ENTER or type command to continue
Jerry Peek replied:
>It seems like the umask value inside repl is being changed somewhere --
>maybe because repl itself, or of some program that repl runs? Anyway,
>as a workaround, try this command instead:
>
>!!(umask 755; fmt)
A little investigation has turned up the following:
The bad guy appears to be an invocation of umask on replsbr.c:79,
which sets the umask accoding to Msg-Protect: in my .mh_profile;
this value was 0600. If I change it to 0700, the problem goes away,
however message files are still created with mode 0600 (Why is this?)
Jerry Peek's suggestion doesn't work. It looks like it should; but
it doesn't.
A probable fix would be to change the lines followind replsbr.c:79 to
something like:
mode_t oldmask;
...
oldmask = umask(~m_gmprot());
if ((out = fopen (drft, "w")) == NULL)
adios (drft, "unable to create");
umask(oldmask);
But I don't want to try this before checking with people who know nmh
better than I do that there wouldn't be unwanted side effects. (Maybe
there are other files created that wouldn't have their modes set
correctly.)
Jonathan Ryshpan <jonrysh$pacbell.net>
The mind is not a vessel to be filled; it is
a fire to be kindled. -- Plutarch