Thu, 3 May 2018 06:45:22 +0200 Sebastien Marie <[email protected]>
> On Thu, May 03, 2018 at 12:27:05AM +0300, [email protected] wrote:
> > > 
> > > So if i understand, in that case 37 is the fd for places.sqlite-wal
> > > opened earlier in the ktrace ?
> > >   

Hi Landry, Sebastien,

Yes, wiped that temp file, but generated a fresh one, different fd num:

 50653 firefox  CALL  clock_gettime(CLOCK_MONOTONIC,0x7f7ffffe1d58)
 50653 firefox  STRU  struct timespec { 44122.094371935 }
 50653 firefox  RET   clock_gettime 0
 50653 firefox  CALL  getpid()
 50653 firefox  RET   getpid 50653/0xc5dd
 50653 firefox  CALL  stat(0x7f7ffffe1b30,0x7f7ffffe18a0)
 50653 firefox  NAMI  "/home/user/.mozilla/firefox/test/places.sqlite"
 50653 firefox  STRU  struct stat { dev=1051, ino=181924, mode=-rw-r--r-- , 
nlink=1, uid=1000<"user">, gid=1000<"user">, rdev=742816, atime=1524794989<"Apr 
27 05:09:49 2018">.487312718, mtime=1525294393<"May  2 23:53:13 
2018">.783442474, ctime=1525294393<"May  2 23:53:13 2018">.783442474, 
size=5242880, blocks=10272, blksize=16384, flags=0x0, gen=0x0 }
 50653 firefox  RET   stat 0
 50653 firefox  CALL  
open(0xb1f8870275d,0x10202<O_RDWR|O_CREAT|O_CLOEXEC>,0644<S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH>)
 50653 firefox  NAMI  "/home/user/.mozilla/firefox/test/places.sqlite-wal"
 50653 firefox  RET   open 40/0x28
 50653 firefox  CALL  fstat(40,0x7f7ffffe1780)
 50653 firefox  STRU  struct stat { dev=1051, ino=182010, mode=-rw-r----- , 
nlink=1, uid=1000<"user">, gid=1000<"user">, rdev=0, atime=1525294428<"May  2 
23:53:48 2018">.294304583, mtime=1525294428<"May  2 23:53:48 2018">.294304583, 
ctime=1525294428<"May  2 23:53:48 2018">.294304583, size=0, blocks=0, 
blksize=16384, flags=0x0, gen=0x0 }
 50653 firefox  RET   fstat 0
 50653 firefox  CALL  fchmod(40,0644<S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH>)
 50653 firefox  PLDG  fchmod, "fattr", errno 1 Operation not permitted
 50653 firefox  PSIG  SIGABRT SIG_DFL
 50653 firefox  NAMI  "firefox.core"
 50653 firefox  STRU  struct pollfd [2] { fd=16, events=0x3<POLLIN|POLLPRI>, 
revents=0<> } { fd=37, events=0x3<POLLIN|POLLPRI>, revents=0<> }
 50653 firefox  STRU  struct pollfd { fd=4, events=0x1<POLLIN>, revents=0<> }

Same trace with the stat structs obviously the details are significant.
Please advise if you'd need further traces and how to obtain more info.

> I think I already seen this behaviour in fossil:
> - openbsd ports@ list: 
> https://marc.info/?l=openbsd-ports&m=152196264519554&w=2
> - fossil-scm list: 
> https://www.mail-archive.com/[email protected]/msg27158.html
> 
> The fchmod(2) code behave to libsqlite.
> 
> In the fossil case (but I assume similarity here), libsqlite sets the
> mode on "foo-journal" to be the same than "foo". This code path could be
> triggered when the initial run that create "foo" had difference umask
> setting than the current run that create "foo-journal".
> 
> Anton, what are the mode of (it was part of stripped stat information :-])
> - /home/user/.mozilla/firefox/test/places.sqlite
> - /home/user/.mozilla/firefox/test/places.sqlite-wal (once created)

Included above, indeed the places.sqlite-wal file has a different mode.

Does firefox use own routines for fattr operations, or the system ones?
And probably the same question for both (lib)sqlite and fossil applies.

> and what is your umask value in this shell ?

The umask is set in the .profile (ksh) as umask 027 (changed from 022).

Is it the right time to precise the pledge path to the profile dir only
and probably another code path would be the save files routines (ouch)?

I suggest web clients should not have access to paths outside $workdir.

Kind regards,
Anton Lazarov

Reply via email to