Fossil SCM

Only make the first argument to pledge() available using the fossil_pledge() interface. The second argument is always NULL.

drh 2018-01-17 19:29 trunk
Commit 91ccde50a003cff52ac9288f22ccb4fd52fc1518dc6c6008a7a7181166f0c8df
3 files changed +1 -1 +1 -1 +4 -4
+1 -1
--- src/checkin.c
+++ src/checkin.c
@@ -472,11 +472,11 @@
472472
const char *zIgnoreFlag = find_option("ignore", 0, 1);
473473
unsigned scanFlags = 0;
474474
unsigned flags = 0;
475475
int vid, i;
476476
477
- fossil_pledge("stdio rpath wpath cpath id flock tty", "");
477
+ fossil_pledge("stdio rpath wpath cpath id flock tty");
478478
479479
/* Load affirmative flag options. */
480480
for( i=0; i<count(flagDefs); ++i ){
481481
if( (command==CHANGES || !(flagDefs[i].mask & C_CLASSIFY))
482482
&& find_option(flagDefs[i].option, 0, 0) ){
483483
--- 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 @@
260260
** The pledge() interface is currently only available on OpenBSD 5.9
261261
** and later. Make calls to fossil_pledge() no-ops on all platforms
262262
** that omit the FOSSIL_HAVE_PLEDGE configuration parameter.
263263
*/
264264
#if !defined(HAVE_PLEDGE)
265
-# define fossil_pledge(A,B)
265
+# define fossil_pledge(A)
266266
#endif
267267
268268
269269
#endif /* _RC_COMPILE_ */
270270
--- 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 @@
492492
**
493493
** On platforms that have pledge(), use this routine.
494494
** On all other platforms, this routine does not exist, but instead
495495
** a macro defined in config.h is used to provide a no-op.
496496
*/
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);
501501
}
502502
}
503503
#endif /* defined(HAVE_PLEDGE) */
504504
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button