Ethereal-users: Re: [Ethereal-users] File write permissions during capture

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

Date: Wed, 1 Feb 2006 13:09:47 +0100
On 2/1/06, Guy Harris <gharris@xxxxxxxxx> wrote:
> Webber, R. Marshall wrote:
>
> > When in capture mode as root, my files are being captured to a hog
> > partition. My root umask should produce files with
> > rw-r--r-- perms.
>
> ...if the application producing the file supplies an initial file mode
> of rw-rw-rw-.  The umask is ANDed with the initial file mode supplied in
> the open() or creat() call to generate the mode used for the file.
>
> Ethereal doesn't - it supplies a mode of rw------- for newly-created
> capture files, so you won't get any mode more permissive than that.
>
> > But all of my capture files are being written as
> > rw------- which isn't much use to me. There are several people on the
> > system that we want to have access to the captures but not give them
> > root to perform the captures.
> >
> > I looked through the FAQs, the .ethereal config file and and docs I
> > could lay my hands on..nothing.
> >
> > Is this configurable?
>
> No.  You'll have to change the permissions and/or ownership of the
> capture file after the capture is done.

Worth to notice that (at least on Tiger but I think in all *nixes) if
writing to a file that exists already it overwrites it but it keeps
ownership and permissions. I.e. you can first create the file change
ownership and perms then start writing to it.

[id-est:~/test] lego% touch t1
[id-est:~/test] lego% ll t1
-rw-r--r--    1 lego  lego     0 Feb  1 13:04 t1
[id-est:~/test] lego% sudo tethereal -i en0 -w t1
Hello world!
Capturing on en0
7 ^C
[id-est:~/test] lego% ll t1
-rw-r--r--   1 lego  lego  900 Feb  1 13:05 t1
[id-est:~/test] lego% tethereal -r t1
  1   0.000000 141.137.226.67 -> 141.137.226.255 NBNS Name query XXXXXXXX<00>
  2   0.874969 141.137.226.67 -> 141.137.226.255 NBNS Name query NB XXXXX<00>
  3   0.961228 00:30:80:aa:bb:cc -> 01:80:c2:00:00:00 STP Conf. Root =
32768/00:30:80:aa:bb:cc  Cost = 0  Port = 0x801a
  4   1.225045 141.137.226.162 -> 141.137.226.255 BROWSER Get Backup
List Request
  5   1.345056 141.137.226.162 -> 141.137.226.255 NBNS Name query NB XXXX1b>
  6   1.431186 141.137.226.92 -> 141.137.226.255 NBNS Name query NB XXXXXX<00>
  7   1.625021 141.137.226.67 -> 141.137.226.255 NBNS Name query NB XXXXXX<00>
[id-est:~/test] lego%



--
This information is top security. When you have read it, destroy yourself.
-- Marshall McLuhan