--- pgp/src/fileio.h 2018/04/24 16:38:46 1.1.1.2 +++ pgp/src/fileio.h 2018/04/24 16:42:28 1.1.1.6 @@ -7,6 +7,7 @@ #endif #ifdef VMS +#define PGP_SYSTEM_DIR "PGP$LIBRARY:" #define FOPRBIN "rb","ctx=stm" #define FOPRTXT "r" #if 0 @@ -20,6 +21,11 @@ #define FOPWPBIN "w+b","ctx=stm" #else #ifdef UNIX +/* + * Directory for system-wide files. Must end in a /, ready for + * dumb appending of the filename. (If not defined, it's not used.) + */ +#define PGP_SYSTEM_DIR "/usr/local/lib/pgp/" #define FOPRBIN "r" #define FOPRTXT "r" #define FOPWBIN "w" @@ -41,20 +47,12 @@ #define equal_buffers(buf1,buf2,count) !memcmp( buf1, buf2, count ) -/* This macro is for burning sensitive data (byte arrays only) on stack. - Many of the file I/O routines use it for zapping buffers */ -#define burn(x) fill0(x,sizeof(x)) - /* Returns TRUE iff file is can be opened for reading. */ boolean file_exists(char *filename); /* Returns TRUE iff file can be opened for writing. Does not harm file! */ boolean file_ok_write(char *filename); -/* Completely overwrite and erase file, so that no sensitive information is - left on the disk */ -int wipeout(FILE *f); - /* Completely overwrite and erase file of given name, so that no sensitive information is left on the disk */ int wipefile(char *filename); @@ -83,6 +81,9 @@ char *maybe_force_extension(char *filena variable PGPPATH */ char *buildfilename(char *result, char *fname); +/* The same, but also searches PGP_SYETEM_DIR */ +char *buildsysfilename(char *result, char *fname); + /* Build a path for fileName based on origPath */ int build_path(char *path, char *fileName, char *origPath); @@ -141,3 +142,14 @@ void rmtemp(char *); char *savetemp(char *, char *); void cleanup_tmpf(void); int savetempbak(char *, char *); + +extern int write_error(FILE *f); +extern void settmpdir(char *path); +extern void setoutdir(char *filename); +extern boolean is_tempfile(char *path); +extern boolean has_extension(char *filename, char *extension); + +/* Directories to search for the manuals */ +extern char const * const manual_dirs[]; +/* Returns non-zero if any manuals are missing */ +unsigned manuals_missing(void);