nmh-workers
[Top] [All Lists]

repl's use of umask causing problems

2002-07-25 09:30:05
The behavior I am seeing is undesirable, but it appears to be exhibited
in the old MH stuff so I don't know if you would call it a bug.

m_gmprot() appears to return the file access mode to use for protecting
new files. The value is user configurable and the default value 600.
600 is a good choice. The problem is that there are several
places in the source where the umask is changed with the command:

    umask (~m_gmprot ());

This results in a umask of 177 and that is a problem when
a directory is created with that mode in place.  The permissions on
the new directory end up being 600 and you can't chdir into it.  
You can see this happen for yourself at the shell prompt by
setting your umask to 177 and creating a directory with mkdir.

I have seen this problem specifically when using repl with vim as my
default editor.  For some operations, it creates a working directory and
attempts to chdir into it.  My skill at twiddling bits in C is a little
rusty, but I think replacing all of the umask entries with...

    umask (~(m_gmprot () | 0111));

would fix the problem.  I would be happy to modify the source code and
submit patches if that would help.

I've been using nmh for about three years now and love it. :-)


Sincerely,

Kris Klindworth
Database Administrator
Carle Clinic Association
kris(_dot_)klindworth(_at_)carle(_dot_)com

Voice:  217/326-2615 
  Fax:  217/383-4980 

<Prev in Thread] Current Thread [Next in Thread>
  • repl's use of umask causing problems, Kris Klindworth <=