On Sat, Apr 21, 2012 at 08:28:19PM -0400, Roberto C. S?nchez wrote:

> These files are regenerated everytime Shorewall is started/restarted.
> The only way to achieve the behavior you describe is to change the umask
> prior to starting/restarting Shorewall.  Because this is external to
> Shorewall, I am closing this report.

Hi Roberto,

This is a shorewall problem - the files are being "regenerated", this is
the problem.

The files in question should simply be truncated when opened.  This is normal
behavior of most unix programs, unless they have a good reason to do
otherwise.

>From the open(2) man page,

   O_TRUNC
          If the file already exists and is a regular file  and  the  open
          mode  allows  writing  (i.e.,  is O_RDWR or O_WRONLY) it will be
          truncated to length 0.  If the file is a FIFO or terminal device
          file,  the  O_TRUNC  flag  is  ignored.  Otherwise the effect of
          O_TRUNC is unspecified.

   creat() is equivalent to open() with flags equal to O_CREAT|O_WRONLY|O_TRUNC.

Using the shell, it works like this,

    $ umask
    0022

    $ touch aa

    $ ls -l aa
    -rw-r--r-- 1 jeff jeff 0 Apr 22 17:05 aa

    $ umask 777

    $ : >| aa

    $ ls -l aa
    -rw-r--r-- 1 jeff jeff 0 Apr 22 17:06 aa

    $ touch bb

    $ ls -l bb
    ---------- 1 jeff jeff 0 Apr 22 17:06 bb

    $ umask 022

For open(2), the umask has no effect unless the file being created did not
originally exist.

This means that shorewall is deleting these files, then creating them,
rather than just opening with O_CREAT|O_WRONLY|O_TRUNC flags.

This is a bug in shorewall.  Please re-open.

Thanks,
-- 
Jeffrey Sheinberg




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to