Fossil SCM
Only make the first argument to pledge() available using the fossil_pledge() interface. The second argument is always NULL.
Commit
91ccde50a003cff52ac9288f22ccb4fd52fc1518dc6c6008a7a7181166f0c8df
Parent
4471e93c758182c…
3 files changed
+1
-1
+1
-1
+4
-4
+1
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -472,11 +472,11 @@ | ||
| 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 | + fossil_pledge("stdio rpath wpath cpath id flock tty"); | |
| 478 | 478 | |
| 479 | 479 | /* Load affirmative flag options. */ |
| 480 | 480 | for( i=0; i<count(flagDefs); ++i ){ |
| 481 | 481 | if( (command==CHANGES || !(flagDefs[i].mask & C_CLASSIFY)) |
| 482 | 482 | && find_option(flagDefs[i].option, 0, 0) ){ |
| 483 | 483 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -472,11 +472,11 @@ | |
| 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,11 @@ | |
| 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 |
+1
-1
| --- src/config.h | ||
| +++ src/config.h | ||
| @@ -260,10 +260,10 @@ | ||
| 260 | 260 | ** The pledge() interface is currently only available on OpenBSD 5.9 |
| 261 | 261 | ** and later. Make calls to fossil_pledge() no-ops on all platforms |
| 262 | 262 | ** that omit the FOSSIL_HAVE_PLEDGE configuration parameter. |
| 263 | 263 | */ |
| 264 | 264 | #if !defined(HAVE_PLEDGE) |
| 265 | -# define fossil_pledge(A,B) | |
| 265 | +# define fossil_pledge(A) | |
| 266 | 266 | #endif |
| 267 | 267 | |
| 268 | 268 | |
| 269 | 269 | #endif /* _RC_COMPILE_ */ |
| 270 | 270 |
| --- src/config.h | |
| +++ src/config.h | |
| @@ -260,10 +260,10 @@ | |
| 260 | ** The pledge() interface is currently only available on OpenBSD 5.9 |
| 261 | ** and later. Make calls to fossil_pledge() no-ops on all platforms |
| 262 | ** that omit the FOSSIL_HAVE_PLEDGE configuration parameter. |
| 263 | */ |
| 264 | #if !defined(HAVE_PLEDGE) |
| 265 | # define fossil_pledge(A,B) |
| 266 | #endif |
| 267 | |
| 268 | |
| 269 | #endif /* _RC_COMPILE_ */ |
| 270 |
| --- src/config.h | |
| +++ src/config.h | |
| @@ -260,10 +260,10 @@ | |
| 260 | ** The pledge() interface is currently only available on OpenBSD 5.9 |
| 261 | ** and later. Make calls to fossil_pledge() no-ops on all platforms |
| 262 | ** that omit the FOSSIL_HAVE_PLEDGE configuration parameter. |
| 263 | */ |
| 264 | #if !defined(HAVE_PLEDGE) |
| 265 | # define fossil_pledge(A) |
| 266 | #endif |
| 267 | |
| 268 | |
| 269 | #endif /* _RC_COMPILE_ */ |
| 270 |
+4
-4
| --- src/util.c | ||
| +++ src/util.c | ||
| @@ -492,12 +492,12 @@ | ||
| 492 | 492 | ** |
| 493 | 493 | ** On platforms that have pledge(), use this routine. |
| 494 | 494 | ** On all other platforms, this routine does not exist, but instead |
| 495 | 495 | ** a macro defined in config.h is used to provide a no-op. |
| 496 | 496 | */ |
| 497 | -void fossil_pledge(const char *promises, const char *execpromises){ | |
| 498 | - if( pledge(promises, execpromises) ){ | |
| 499 | - fossil_fatal("pledge(\"%s\",\"%s\") fails with errno=%d", | |
| 500 | - promises, execpromises, (int)errno); | |
| 497 | +void fossil_pledge(const char *promises){ | |
| 498 | + if( pledge(promises, 0) ){ | |
| 499 | + fossil_fatal("pledge(\"%s\",NULL) fails with errno=%d", | |
| 500 | + promises, (int)errno); | |
| 501 | 501 | } |
| 502 | 502 | } |
| 503 | 503 | #endif /* defined(HAVE_PLEDGE) */ |
| 504 | 504 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -492,12 +492,12 @@ | |
| 492 | ** |
| 493 | ** On platforms that have pledge(), use this routine. |
| 494 | ** On all other platforms, this routine does not exist, but instead |
| 495 | ** a macro defined in config.h is used to provide a no-op. |
| 496 | */ |
| 497 | void fossil_pledge(const char *promises, const char *execpromises){ |
| 498 | if( pledge(promises, execpromises) ){ |
| 499 | fossil_fatal("pledge(\"%s\",\"%s\") fails with errno=%d", |
| 500 | promises, execpromises, (int)errno); |
| 501 | } |
| 502 | } |
| 503 | #endif /* defined(HAVE_PLEDGE) */ |
| 504 |
| --- src/util.c | |
| +++ src/util.c | |
| @@ -492,12 +492,12 @@ | |
| 492 | ** |
| 493 | ** On platforms that have pledge(), use this routine. |
| 494 | ** On all other platforms, this routine does not exist, but instead |
| 495 | ** a macro defined in config.h is used to provide a no-op. |
| 496 | */ |
| 497 | void fossil_pledge(const char *promises){ |
| 498 | if( pledge(promises, 0) ){ |
| 499 | fossil_fatal("pledge(\"%s\",NULL) fails with errno=%d", |
| 500 | promises, (int)errno); |
| 501 | } |
| 502 | } |
| 503 | #endif /* defined(HAVE_PLEDGE) */ |
| 504 |