Fossil SCM
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.
Commit
396513fa4a6f8da86bbb7508f138b61c876372a5ca8c4e869506ae837bea797e
Parent
4f90d591aa09d24…
1 file changed
+5
-1
+5
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -472,11 +472,15 @@ | ||
| 472 | 472 | const char *zIgnoreFlag = find_option("ignore", 0, 1); |
| 473 | 473 | unsigned scanFlags = 0; |
| 474 | 474 | unsigned flags = 0; |
| 475 | 475 | int vid, i; |
| 476 | 476 | |
| 477 | - fossil_pledge("stdio rpath wpath cpath id flock tty"); | |
| 477 | + if( getuid()==0 ){ | |
| 478 | + fossil_pledge("stdio rpath wpath cpath id flock tty chown"); | |
| 479 | + }else{ | |
| 480 | + fossil_pledge("stdio rpath wpath cpath id flock tty"); | |
| 481 | + } | |
| 478 | 482 | |
| 479 | 483 | /* Load affirmative flag options. */ |
| 480 | 484 | for( i=0; i<count(flagDefs); ++i ){ |
| 481 | 485 | if( (command==CHANGES || !(flagDefs[i].mask & C_CLASSIFY)) |
| 482 | 486 | && find_option(flagDefs[i].option, 0, 0) ){ |
| 483 | 487 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -472,11 +472,15 @@ | |
| 472 | const char *zIgnoreFlag = find_option("ignore", 0, 1); |
| 473 | unsigned scanFlags = 0; |
| 474 | unsigned flags = 0; |
| 475 | int vid, i; |
| 476 | |
| 477 | fossil_pledge("stdio rpath wpath cpath id flock tty"); |
| 478 | |
| 479 | /* Load affirmative flag options. */ |
| 480 | for( i=0; i<count(flagDefs); ++i ){ |
| 481 | if( (command==CHANGES || !(flagDefs[i].mask & C_CLASSIFY)) |
| 482 | && find_option(flagDefs[i].option, 0, 0) ){ |
| 483 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -472,11 +472,15 @@ | |
| 472 | const char *zIgnoreFlag = find_option("ignore", 0, 1); |
| 473 | unsigned scanFlags = 0; |
| 474 | unsigned flags = 0; |
| 475 | int vid, i; |
| 476 | |
| 477 | if( getuid()==0 ){ |
| 478 | fossil_pledge("stdio rpath wpath cpath id flock tty chown"); |
| 479 | }else{ |
| 480 | fossil_pledge("stdio rpath wpath cpath id flock tty"); |
| 481 | } |
| 482 | |
| 483 | /* Load affirmative flag options. */ |
| 484 | for( i=0; i<count(flagDefs); ++i ){ |
| 485 | if( (command==CHANGES || !(flagDefs[i].mask & C_CLASSIFY)) |
| 486 | && find_option(flagDefs[i].option, 0, 0) ){ |
| 487 |