Fossil

Check-in [6b41a7e8]
Login

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

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:6b41a7e803348a9247818a66c9b968a9fd8e5d3408cecdaeeeed905c08dc018a
User & Date: mgagnon 2018-01-19 19:15:43
Context
2018-01-20
20:46
It isn't necessary to allow id either for the status command as nobody should be trying to setuid. check-in: 866f92fa user: andybradford tags: pledge-additions
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. Leaf 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
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
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;
    }







<
|
<
<
<







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 chown");




  /* 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;
    }