[net.emacs] autosave misfeature in GNUemacs

howie@cucca.UUCP (Howie Kaye) (11/19/85)

When gnuemacs (V16.60) would autosave, the mode of the autosave file
seemed to be set by the user's umask, rather than keeping the mode of
the original file being edited.  This was leading to unfortunate
occurances, such as world readable backups of RMAIL files.  The
following change to fileio.c sets the mode of an auto-save file to be
the same as the mode of the original source.  The change is in the
function: auto_save_1 ().


807a808,812
> /*
>  * auto save a file
>  * tries set mode of autosave file to be the same as the mode of the 
>  * original file
>  */
809a815,816
>   struct stat st;
> 
812a820,825
> 
>   if (XTYPE (bf_cur->filename) != Lisp_String) return;
>   if (XTYPE (bf_cur->auto_save_file_name) != Lisp_String) return;
> 
>   if (!stat(XSTRING (bf_cur->filename)->data, &st))
>     chmod(XSTRING(bf_cur->auto_save_file_name)->data, st.st_mode);


Howie Kaye				Sy.Howie@CU20B.ARPA             
Columbia University 			HKAUS@cuvma (bitnet)          
System's Integration Group		{?}!seismo!columbia!cucca!howie





-- 
Howie Kaye				Sy.Howie@CU20B.ARPA             
Columbia University 			HKAUS@cuvma (bitnet)          
System's Integration Group		{?}!seismo!columbia!cucca!howie