Fossil

Check-in [396513fa]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:If running "fossil status" when pledge() is enabled, the "chown" promise needs to be added when running as root, otherwise fossil receive a SIGABRT and crash when attempting to call fchown(...) on creation of the .fossil-journal file.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:396513fa4a6f8da86bbb7508f138b61c876372a5ca8c4e869506ae837bea797e
User & Date: mgagnon 2018-01-19 18:06:28
Context
2018-01-19
19:15
Remove call of "getuid()" added on previous commit because it is not available on windows. For the pledge() call, always allow "chown" for now, even if not running as root. check-in: 6b41a7e8 user: mgagnon tags: trunk
18:06
If running "fossil status" when pledge() is enabled, the "chown" promise needs to be added when running as root, otherwise fossil receive a SIGABRT and crash when attempting to call fchown(...) on creation of the .fossil-journal file. check-in: 396513fa user: mgagnon tags: trunk
2018-01-18
03:52
Now that pledge() is automatically detected, update the comment with the new name of the configuration parameter. check-in: 4f90d591 user: andybradford tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/checkin.c.

470
471
472
473
474
475
476



477

478
479
480
481
482
483
484
  int showHdr = command==CHANGES && find_option("header", 0, 0);
  int verboseFlag = command==CHANGES && find_option("verbose", "v", 0);
  const char *zIgnoreFlag = find_option("ignore", 0, 1);
  unsigned scanFlags = 0;
  unsigned flags = 0;
  int vid, i;




  fossil_pledge("stdio rpath wpath cpath id flock tty");


  /* Load affirmative flag options. */
  for( i=0; i<count(flagDefs); ++i ){
    if( (command==CHANGES || !(flagDefs[i].mask & C_CLASSIFY))
     && find_option(flagDefs[i].option, 0, 0) ){
      flags |= flagDefs[i].mask;
    }







>
>
>
|
>







470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
  int showHdr = command==CHANGES && find_option("header", 0, 0);
  int verboseFlag = command==CHANGES && find_option("verbose", "v", 0);
  const char *zIgnoreFlag = find_option("ignore", 0, 1);
  unsigned scanFlags = 0;
  unsigned flags = 0;
  int vid, i;

  if( getuid()==0 ){
    fossil_pledge("stdio rpath wpath cpath id flock tty chown");
  }else{
    fossil_pledge("stdio rpath wpath cpath id flock tty");
  }

  /* Load affirmative flag options. */
  for( i=0; i<count(flagDefs); ++i ){
    if( (command==CHANGES || !(flagDefs[i].mask & C_CLASSIFY))
     && find_option(flagDefs[i].option, 0, 0) ){
      flags |= flagDefs[i].mask;
    }