--- wrtbtmpfl.m.SAV 2005-08-25 19:11:36.000000000 -0600 +++ wrtbtmpfl.m 2005-08-25 19:11:36.000000000 -0600 @@ -112,13 +112,14 @@ #include #ifndef S_IRUSR -#define XWBF_MODE 0x600 +#define XWBF_MODE 0x500 #else #define XWBF_MODE (S_IRUSR|S_IXUSR) #endif #define XWBF_DIR "xwbf_dir" #define XWBF_FILE "xwbf_dir/xwbf_file" +#define XWBF_BAD_FILE "xwbf_nodir/xwbf_file" static char *xwbf_name = "xwbf_temp"; @@ -323,6 +324,11 @@ /* Call xname to write the bitmap file. */ filename = XWBF_FILE; + +/* Because root can still create the file in XWBF_DIR, we have to change it */ + if (geteuid() == 0) + filename = XWBF_BAD_FILE; + ret = XCALL; /* Verify that a BitmapOpenFailed error occurred. */