procmail
[Top] [All Lists]

misc.c and permissions

1999-05-06 10:31:12
Hello

The default behavior for procmail is to enforce strict permissions
(00660 I believe) on mail spool files.  Due to a unique situation on my
mail server I require the files to be 00666.  In misc.c I foudn the
following code:

 else
            { if(!(stbuf.st_mode&OVERRIDE_MASK)&&
                 stbuf.st_mode&cumask&
                        (accspooldir?~(mode_t)0:~(S_IRGRP|S_IWGRP)))
               { static const char enfperm[]=
                  "Enforcing stricter permissions on";
                 nlog(enfperm);logqnl(chp);
                 syslog(LOG_NOTICE,slogstr,enfperm,chp);setids();
                 chmod(chp,stbuf.st_mode&=~cumask);
               }
              break;                              /* everything is justfine $
            }


I changed this to :

 else
            { if(!(stbuf.st_mode&OVERRIDE_MASK)&&
                 stbuf.st_mode&cumask&
                (accspooldir?~(mode_t)0:~(S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH))) $
               { static const char enfperm[]=
                  "Enforcing stricter permissions on";
                 nlog(enfperm);logqnl(chp);
                 syslog(LOG_NOTICE,slogstr,enfperm,chp);setids();
                 chmod(chp,stbuf.st_mode&=~cumask);
               }
              break;                              /* everything is just fine $
            }


This seems to accomplish what I was looking for.  Does anyone know if
this will break any other functions of procmail?  Or is there a better
way to accomplish this?

Thanks

<Prev in Thread] Current Thread [Next in Thread>