Fossil SCM
In the db_get(N,D) function, if N is setting, then always leave D as NULL so that we use the published default value for that setting.
Commit
eb804dc6749a1f29b118a7ea3718e6b5d1e3b360a40edc266242dc598a9ad06a
Parent
89872d17d1b908c…
12 files changed
+3
-3
+1
-1
+1
-1
+1
-1
+1
-1
+2
-2
+1
-1
+3
-3
+2
-2
+2
-1
+1
-1
+1
-1
+3
-3
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -110,11 +110,11 @@ | ||
| 110 | 110 | ** if the email-send-method is something other than "off". |
| 111 | 111 | */ |
| 112 | 112 | void alert_schema(int bOnlyIfEnabled){ |
| 113 | 113 | if( !alert_tables_exist() ){ |
| 114 | 114 | if( bOnlyIfEnabled |
| 115 | - && fossil_strcmp(db_get("email-send-method","off"),"off")==0 | |
| 115 | + && fossil_strcmp(db_get("email-send-method",0),"off")==0 | |
| 116 | 116 | ){ |
| 117 | 117 | return; /* Don't create table for disabled email */ |
| 118 | 118 | } |
| 119 | 119 | db_multi_exec(zAlertInit/*works-like:""*/); |
| 120 | 120 | alert_triggers_enable(); |
| @@ -158,11 +158,11 @@ | ||
| 158 | 158 | /* |
| 159 | 159 | ** Return true if email alerts are active. |
| 160 | 160 | */ |
| 161 | 161 | int alert_enabled(void){ |
| 162 | 162 | if( !alert_tables_exist() ) return 0; |
| 163 | - if( fossil_strcmp(db_get("email-send-method","off"),"off")==0 ) return 0; | |
| 163 | + if( fossil_strcmp(db_get("email-send-method",0),"off")==0 ) return 0; | |
| 164 | 164 | return 1; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /* |
| 168 | 168 | ** If the subscriber table does not exist, then paint an error message |
| @@ -482,11 +482,11 @@ | ||
| 482 | 482 | blob_init(&p->out, 0, 0); |
| 483 | 483 | p->mFlags = mFlags; |
| 484 | 484 | if( zAltDest ){ |
| 485 | 485 | p->zDest = zAltDest; |
| 486 | 486 | }else{ |
| 487 | - p->zDest = db_get("email-send-method","off"); | |
| 487 | + p->zDest = db_get("email-send-method",0); | |
| 488 | 488 | } |
| 489 | 489 | if( fossil_strcmp(p->zDest,"off")==0 ) return p; |
| 490 | 490 | if( emailerGetSetting(p, &p->zFrom, "email-self") ) return p; |
| 491 | 491 | if( fossil_strcmp(p->zDest,"db")==0 ){ |
| 492 | 492 | char *zErr; |
| 493 | 493 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -110,11 +110,11 @@ | |
| 110 | ** if the email-send-method is something other than "off". |
| 111 | */ |
| 112 | void alert_schema(int bOnlyIfEnabled){ |
| 113 | if( !alert_tables_exist() ){ |
| 114 | if( bOnlyIfEnabled |
| 115 | && fossil_strcmp(db_get("email-send-method","off"),"off")==0 |
| 116 | ){ |
| 117 | return; /* Don't create table for disabled email */ |
| 118 | } |
| 119 | db_multi_exec(zAlertInit/*works-like:""*/); |
| 120 | alert_triggers_enable(); |
| @@ -158,11 +158,11 @@ | |
| 158 | /* |
| 159 | ** Return true if email alerts are active. |
| 160 | */ |
| 161 | int alert_enabled(void){ |
| 162 | if( !alert_tables_exist() ) return 0; |
| 163 | if( fossil_strcmp(db_get("email-send-method","off"),"off")==0 ) return 0; |
| 164 | return 1; |
| 165 | } |
| 166 | |
| 167 | /* |
| 168 | ** If the subscriber table does not exist, then paint an error message |
| @@ -482,11 +482,11 @@ | |
| 482 | blob_init(&p->out, 0, 0); |
| 483 | p->mFlags = mFlags; |
| 484 | if( zAltDest ){ |
| 485 | p->zDest = zAltDest; |
| 486 | }else{ |
| 487 | p->zDest = db_get("email-send-method","off"); |
| 488 | } |
| 489 | if( fossil_strcmp(p->zDest,"off")==0 ) return p; |
| 490 | if( emailerGetSetting(p, &p->zFrom, "email-self") ) return p; |
| 491 | if( fossil_strcmp(p->zDest,"db")==0 ){ |
| 492 | char *zErr; |
| 493 |
| --- src/alerts.c | |
| +++ src/alerts.c | |
| @@ -110,11 +110,11 @@ | |
| 110 | ** if the email-send-method is something other than "off". |
| 111 | */ |
| 112 | void alert_schema(int bOnlyIfEnabled){ |
| 113 | if( !alert_tables_exist() ){ |
| 114 | if( bOnlyIfEnabled |
| 115 | && fossil_strcmp(db_get("email-send-method",0),"off")==0 |
| 116 | ){ |
| 117 | return; /* Don't create table for disabled email */ |
| 118 | } |
| 119 | db_multi_exec(zAlertInit/*works-like:""*/); |
| 120 | alert_triggers_enable(); |
| @@ -158,11 +158,11 @@ | |
| 158 | /* |
| 159 | ** Return true if email alerts are active. |
| 160 | */ |
| 161 | int alert_enabled(void){ |
| 162 | if( !alert_tables_exist() ) return 0; |
| 163 | if( fossil_strcmp(db_get("email-send-method",0),"off")==0 ) return 0; |
| 164 | return 1; |
| 165 | } |
| 166 | |
| 167 | /* |
| 168 | ** If the subscriber table does not exist, then paint an error message |
| @@ -482,11 +482,11 @@ | |
| 482 | blob_init(&p->out, 0, 0); |
| 483 | p->mFlags = mFlags; |
| 484 | if( zAltDest ){ |
| 485 | p->zDest = zAltDest; |
| 486 | }else{ |
| 487 | p->zDest = db_get("email-send-method",0); |
| 488 | } |
| 489 | if( fossil_strcmp(p->zDest,"off")==0 ) return p; |
| 490 | if( emailerGetSetting(p, &p->zFrom, "email-self") ) return p; |
| 491 | if( fossil_strcmp(p->zDest,"db")==0 ){ |
| 492 | char *zErr; |
| 493 |
+1
-1
| --- src/branch.c | ||
| +++ src/branch.c | ||
| @@ -40,11 +40,11 @@ | ||
| 40 | 40 | zBr = fossil_strdup(db_column_text(&q,0)); |
| 41 | 41 | } |
| 42 | 42 | db_reset(&q); |
| 43 | 43 | if( zBr==0 ){ |
| 44 | 44 | static char *zMain = 0; |
| 45 | - if( zMain==0 ) zMain = db_get("main-branch","trunk"); | |
| 45 | + if( zMain==0 ) zMain = db_get("main-branch",0); | |
| 46 | 46 | zBr = fossil_strdup(zMain); |
| 47 | 47 | } |
| 48 | 48 | return zBr; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -40,11 +40,11 @@ | |
| 40 | zBr = fossil_strdup(db_column_text(&q,0)); |
| 41 | } |
| 42 | db_reset(&q); |
| 43 | if( zBr==0 ){ |
| 44 | static char *zMain = 0; |
| 45 | if( zMain==0 ) zMain = db_get("main-branch","trunk"); |
| 46 | zBr = fossil_strdup(zMain); |
| 47 | } |
| 48 | return zBr; |
| 49 | } |
| 50 | |
| 51 |
| --- src/branch.c | |
| +++ src/branch.c | |
| @@ -40,11 +40,11 @@ | |
| 40 | zBr = fossil_strdup(db_column_text(&q,0)); |
| 41 | } |
| 42 | db_reset(&q); |
| 43 | if( zBr==0 ){ |
| 44 | static char *zMain = 0; |
| 45 | if( zMain==0 ) zMain = db_get("main-branch",0); |
| 46 | zBr = fossil_strdup(zMain); |
| 47 | } |
| 48 | return zBr; |
| 49 | } |
| 50 | |
| 51 |
+1
-1
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -2130,11 +2130,11 @@ | ||
| 2130 | 2130 | /* Get the ID of the parent manifest artifact */ |
| 2131 | 2131 | vid = db_lget_int("checkout", 0); |
| 2132 | 2132 | if( vid==0 ){ |
| 2133 | 2133 | useCksum = 1; |
| 2134 | 2134 | if( sCiInfo.zBranch==0 ) { |
| 2135 | - sCiInfo.zBranch=db_get("main-branch", "trunk"); | |
| 2135 | + sCiInfo.zBranch=db_get("main-branch", 0); | |
| 2136 | 2136 | } |
| 2137 | 2137 | }else if( content_is_private(vid) ){ |
| 2138 | 2138 | g.markPrivate = 1; |
| 2139 | 2139 | } |
| 2140 | 2140 | |
| 2141 | 2141 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2130,11 +2130,11 @@ | |
| 2130 | /* Get the ID of the parent manifest artifact */ |
| 2131 | vid = db_lget_int("checkout", 0); |
| 2132 | if( vid==0 ){ |
| 2133 | useCksum = 1; |
| 2134 | if( sCiInfo.zBranch==0 ) { |
| 2135 | sCiInfo.zBranch=db_get("main-branch", "trunk"); |
| 2136 | } |
| 2137 | }else if( content_is_private(vid) ){ |
| 2138 | g.markPrivate = 1; |
| 2139 | } |
| 2140 | |
| 2141 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2130,11 +2130,11 @@ | |
| 2130 | /* Get the ID of the parent manifest artifact */ |
| 2131 | vid = db_lget_int("checkout", 0); |
| 2132 | if( vid==0 ){ |
| 2133 | useCksum = 1; |
| 2134 | if( sCiInfo.zBranch==0 ) { |
| 2135 | sCiInfo.zBranch=db_get("main-branch", 0); |
| 2136 | } |
| 2137 | }else if( content_is_private(vid) ){ |
| 2138 | g.markPrivate = 1; |
| 2139 | } |
| 2140 | |
| 2141 |
M
src/db.c
+1
-1
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -2950,11 +2950,11 @@ | ||
| 2950 | 2950 | /* Figure out which revision to open. */ |
| 2951 | 2951 | if( !emptyFlag ){ |
| 2952 | 2952 | if( g.argc==4 ){ |
| 2953 | 2953 | g.zOpenRevision = g.argv[3]; |
| 2954 | 2954 | }else if( db_exists("SELECT 1 FROM event WHERE type='ci'") ){ |
| 2955 | - g.zOpenRevision = db_get("main-branch", "trunk"); | |
| 2955 | + g.zOpenRevision = db_get("main-branch", 0); | |
| 2956 | 2956 | } |
| 2957 | 2957 | } |
| 2958 | 2958 | |
| 2959 | 2959 | if( g.zOpenRevision ){ |
| 2960 | 2960 | /* Since the repository is open and we know the revision now, |
| 2961 | 2961 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2950,11 +2950,11 @@ | |
| 2950 | /* Figure out which revision to open. */ |
| 2951 | if( !emptyFlag ){ |
| 2952 | if( g.argc==4 ){ |
| 2953 | g.zOpenRevision = g.argv[3]; |
| 2954 | }else if( db_exists("SELECT 1 FROM event WHERE type='ci'") ){ |
| 2955 | g.zOpenRevision = db_get("main-branch", "trunk"); |
| 2956 | } |
| 2957 | } |
| 2958 | |
| 2959 | if( g.zOpenRevision ){ |
| 2960 | /* Since the repository is open and we know the revision now, |
| 2961 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -2950,11 +2950,11 @@ | |
| 2950 | /* Figure out which revision to open. */ |
| 2951 | if( !emptyFlag ){ |
| 2952 | if( g.argc==4 ){ |
| 2953 | g.zOpenRevision = g.argv[3]; |
| 2954 | }else if( db_exists("SELECT 1 FROM event WHERE type='ci'") ){ |
| 2955 | g.zOpenRevision = db_get("main-branch", 0); |
| 2956 | } |
| 2957 | } |
| 2958 | |
| 2959 | if( g.zOpenRevision ){ |
| 2960 | /* Since the repository is open and we know the revision now, |
| 2961 |
+1
-1
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -707,11 +707,11 @@ | ||
| 707 | 707 | find_option("side-by-side","y",0); |
| 708 | 708 | find_option("internal","i",0); |
| 709 | 709 | find_option("verbose","v",0); |
| 710 | 710 | zTclsh = find_option("tclsh",0,1); |
| 711 | 711 | if( zTclsh==0 ){ |
| 712 | - zTclsh = db_get("tclsh","tclsh"); | |
| 712 | + zTclsh = db_get("tclsh",0); | |
| 713 | 713 | } |
| 714 | 714 | /* The undocumented --script FILENAME option causes the Tk script to |
| 715 | 715 | ** be written into the FILENAME instead of being run. This is used |
| 716 | 716 | ** for testing and debugging. */ |
| 717 | 717 | zTempFile = find_option("script",0,1); |
| 718 | 718 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -707,11 +707,11 @@ | |
| 707 | find_option("side-by-side","y",0); |
| 708 | find_option("internal","i",0); |
| 709 | find_option("verbose","v",0); |
| 710 | zTclsh = find_option("tclsh",0,1); |
| 711 | if( zTclsh==0 ){ |
| 712 | zTclsh = db_get("tclsh","tclsh"); |
| 713 | } |
| 714 | /* The undocumented --script FILENAME option causes the Tk script to |
| 715 | ** be written into the FILENAME instead of being run. This is used |
| 716 | ** for testing and debugging. */ |
| 717 | zTempFile = find_option("script",0,1); |
| 718 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -707,11 +707,11 @@ | |
| 707 | find_option("side-by-side","y",0); |
| 708 | find_option("internal","i",0); |
| 709 | find_option("verbose","v",0); |
| 710 | zTclsh = find_option("tclsh",0,1); |
| 711 | if( zTclsh==0 ){ |
| 712 | zTclsh = db_get("tclsh",0); |
| 713 | } |
| 714 | /* The undocumented --script FILENAME option causes the Tk script to |
| 715 | ** be written into the FILENAME instead of being run. This is used |
| 716 | ** for testing and debugging. */ |
| 717 | zTempFile = find_option("script",0,1); |
| 718 |
+2
-2
| --- src/info.c | ||
| +++ src/info.c | ||
| @@ -884,11 +884,11 @@ | ||
| 884 | 884 | } |
| 885 | 885 | |
| 886 | 886 | if( g.perm.Hyperlink ){ |
| 887 | 887 | @ <tr><th>Other Links:</th> |
| 888 | 888 | @ <td> |
| 889 | - if( fossil_strcmp(zBrName, db_get("main-branch","trunk"))!=0 ){ | |
| 889 | + if( fossil_strcmp(zBrName, db_get("main-branch",0))!=0 ){ | |
| 890 | 890 | @ %z(href("%R/vdiff?branch=%!S", zUuid))branch diff</a> | |
| 891 | 891 | } |
| 892 | 892 | @ %z(href("%R/artifact/%!S",zUuid))manifest</a> |
| 893 | 893 | @ | %z(href("%R/ci_tags/%!S",zUuid))tags</a> |
| 894 | 894 | if( g.perm.Admin ){ |
| @@ -3008,11 +3008,11 @@ | ||
| 3008 | 3008 | } |
| 3009 | 3009 | db_finalize(&q); |
| 3010 | 3010 | @ </td></tr> |
| 3011 | 3011 | |
| 3012 | 3012 | if( !zBranchName ){ |
| 3013 | - zBranchName = db_get("main-branch", "trunk"); | |
| 3013 | + zBranchName = db_get("main-branch", 0); | |
| 3014 | 3014 | } |
| 3015 | 3015 | if( !zNewBranch || !zNewBranch[0]){ |
| 3016 | 3016 | zNewBranch = zBranchName; |
| 3017 | 3017 | } |
| 3018 | 3018 | @ <tr><th align="right" valign="top">Branching:</th> |
| 3019 | 3019 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -884,11 +884,11 @@ | |
| 884 | } |
| 885 | |
| 886 | if( g.perm.Hyperlink ){ |
| 887 | @ <tr><th>Other Links:</th> |
| 888 | @ <td> |
| 889 | if( fossil_strcmp(zBrName, db_get("main-branch","trunk"))!=0 ){ |
| 890 | @ %z(href("%R/vdiff?branch=%!S", zUuid))branch diff</a> | |
| 891 | } |
| 892 | @ %z(href("%R/artifact/%!S",zUuid))manifest</a> |
| 893 | @ | %z(href("%R/ci_tags/%!S",zUuid))tags</a> |
| 894 | if( g.perm.Admin ){ |
| @@ -3008,11 +3008,11 @@ | |
| 3008 | } |
| 3009 | db_finalize(&q); |
| 3010 | @ </td></tr> |
| 3011 | |
| 3012 | if( !zBranchName ){ |
| 3013 | zBranchName = db_get("main-branch", "trunk"); |
| 3014 | } |
| 3015 | if( !zNewBranch || !zNewBranch[0]){ |
| 3016 | zNewBranch = zBranchName; |
| 3017 | } |
| 3018 | @ <tr><th align="right" valign="top">Branching:</th> |
| 3019 |
| --- src/info.c | |
| +++ src/info.c | |
| @@ -884,11 +884,11 @@ | |
| 884 | } |
| 885 | |
| 886 | if( g.perm.Hyperlink ){ |
| 887 | @ <tr><th>Other Links:</th> |
| 888 | @ <td> |
| 889 | if( fossil_strcmp(zBrName, db_get("main-branch",0))!=0 ){ |
| 890 | @ %z(href("%R/vdiff?branch=%!S", zUuid))branch diff</a> | |
| 891 | } |
| 892 | @ %z(href("%R/artifact/%!S",zUuid))manifest</a> |
| 893 | @ | %z(href("%R/ci_tags/%!S",zUuid))tags</a> |
| 894 | if( g.perm.Admin ){ |
| @@ -3008,11 +3008,11 @@ | |
| 3008 | } |
| 3009 | db_finalize(&q); |
| 3010 | @ </td></tr> |
| 3011 | |
| 3012 | if( !zBranchName ){ |
| 3013 | zBranchName = db_get("main-branch", 0); |
| 3014 | } |
| 3015 | if( !zNewBranch || !zNewBranch[0]){ |
| 3016 | zNewBranch = zBranchName; |
| 3017 | } |
| 3018 | @ <tr><th align="right" valign="top">Branching:</th> |
| 3019 |
+1
-1
| --- src/loadctrl.c | ||
| +++ src/loadctrl.c | ||
| @@ -49,11 +49,11 @@ | ||
| 49 | 49 | /* |
| 50 | 50 | ** Abort the current operation of the load average of the host computer |
| 51 | 51 | ** is too high. |
| 52 | 52 | */ |
| 53 | 53 | void load_control(void){ |
| 54 | - double mxLoad = atof(db_get("max-loadavg", "0")); | |
| 54 | + double mxLoad = atof(db_get("max-loadavg", 0)); | |
| 55 | 55 | if( mxLoad<=0.0 || mxLoad>=load_average() ) return; |
| 56 | 56 | |
| 57 | 57 | style_header("Server Overload"); |
| 58 | 58 | @ <h2>The server load is currently too high. |
| 59 | 59 | @ Please try again later.</h2> |
| 60 | 60 |
| --- src/loadctrl.c | |
| +++ src/loadctrl.c | |
| @@ -49,11 +49,11 @@ | |
| 49 | /* |
| 50 | ** Abort the current operation of the load average of the host computer |
| 51 | ** is too high. |
| 52 | */ |
| 53 | void load_control(void){ |
| 54 | double mxLoad = atof(db_get("max-loadavg", "0")); |
| 55 | if( mxLoad<=0.0 || mxLoad>=load_average() ) return; |
| 56 | |
| 57 | style_header("Server Overload"); |
| 58 | @ <h2>The server load is currently too high. |
| 59 | @ Please try again later.</h2> |
| 60 |
| --- src/loadctrl.c | |
| +++ src/loadctrl.c | |
| @@ -49,11 +49,11 @@ | |
| 49 | /* |
| 50 | ** Abort the current operation of the load average of the host computer |
| 51 | ** is too high. |
| 52 | */ |
| 53 | void load_control(void){ |
| 54 | double mxLoad = atof(db_get("max-loadavg", 0)); |
| 55 | if( mxLoad<=0.0 || mxLoad>=load_average() ) return; |
| 56 | |
| 57 | style_header("Server Overload"); |
| 58 | @ <h2>The server load is currently too high. |
| 59 | @ Please try again later.</h2> |
| 60 |
+3
-3
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -514,11 +514,11 @@ | ||
| 514 | 514 | int login_self_register_available(const char *zNeeded){ |
| 515 | 515 | CapabilityString *pCap; |
| 516 | 516 | int rc; |
| 517 | 517 | if( !db_get_boolean("self-register",0) ) return 0; |
| 518 | 518 | if( zNeeded==0 ) return 1; |
| 519 | - pCap = capability_add(0, db_get("default-perms","")); | |
| 519 | + pCap = capability_add(0, db_get("default-perms", 0)); | |
| 520 | 520 | capability_expand(pCap); |
| 521 | 521 | rc = capability_has_any(pCap, zNeeded); |
| 522 | 522 | capability_free(pCap); |
| 523 | 523 | return rc; |
| 524 | 524 | } |
| @@ -1162,11 +1162,11 @@ | ||
| 1162 | 1162 | if( zPublicPages!=0 ){ |
| 1163 | 1163 | Glob *pGlob = glob_create(zPublicPages); |
| 1164 | 1164 | const char *zUri = PD("REQUEST_URI",""); |
| 1165 | 1165 | zUri += (int)strlen(g.zTop); |
| 1166 | 1166 | if( glob_match(pGlob, zUri) ){ |
| 1167 | - login_set_capabilities(db_get("default-perms","u"), 0); | |
| 1167 | + login_set_capabilities(db_get("default-perms", 0), 0); | |
| 1168 | 1168 | } |
| 1169 | 1169 | glob_free(pGlob); |
| 1170 | 1170 | } |
| 1171 | 1171 | } |
| 1172 | 1172 | |
| @@ -1504,11 +1504,11 @@ | ||
| 1504 | 1504 | @ <p>This project does not allow user self-registration. Please contact the |
| 1505 | 1505 | @ project administrator to obtain an account.</p> |
| 1506 | 1506 | style_footer(); |
| 1507 | 1507 | return; |
| 1508 | 1508 | } |
| 1509 | - zPerms = db_get("default-perms","u"); | |
| 1509 | + zPerms = db_get("default-perms", 0); | |
| 1510 | 1510 | |
| 1511 | 1511 | /* Prompt the user for email alerts if this repository is configured for |
| 1512 | 1512 | ** email alerts and if the default permissions include "7" */ |
| 1513 | 1513 | canDoAlerts = alert_tables_exist() && db_int(0, |
| 1514 | 1514 | "SELECT fullcap(%Q) GLOB '*7*'", zPerms |
| 1515 | 1515 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -514,11 +514,11 @@ | |
| 514 | int login_self_register_available(const char *zNeeded){ |
| 515 | CapabilityString *pCap; |
| 516 | int rc; |
| 517 | if( !db_get_boolean("self-register",0) ) return 0; |
| 518 | if( zNeeded==0 ) return 1; |
| 519 | pCap = capability_add(0, db_get("default-perms","")); |
| 520 | capability_expand(pCap); |
| 521 | rc = capability_has_any(pCap, zNeeded); |
| 522 | capability_free(pCap); |
| 523 | return rc; |
| 524 | } |
| @@ -1162,11 +1162,11 @@ | |
| 1162 | if( zPublicPages!=0 ){ |
| 1163 | Glob *pGlob = glob_create(zPublicPages); |
| 1164 | const char *zUri = PD("REQUEST_URI",""); |
| 1165 | zUri += (int)strlen(g.zTop); |
| 1166 | if( glob_match(pGlob, zUri) ){ |
| 1167 | login_set_capabilities(db_get("default-perms","u"), 0); |
| 1168 | } |
| 1169 | glob_free(pGlob); |
| 1170 | } |
| 1171 | } |
| 1172 | |
| @@ -1504,11 +1504,11 @@ | |
| 1504 | @ <p>This project does not allow user self-registration. Please contact the |
| 1505 | @ project administrator to obtain an account.</p> |
| 1506 | style_footer(); |
| 1507 | return; |
| 1508 | } |
| 1509 | zPerms = db_get("default-perms","u"); |
| 1510 | |
| 1511 | /* Prompt the user for email alerts if this repository is configured for |
| 1512 | ** email alerts and if the default permissions include "7" */ |
| 1513 | canDoAlerts = alert_tables_exist() && db_int(0, |
| 1514 | "SELECT fullcap(%Q) GLOB '*7*'", zPerms |
| 1515 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -514,11 +514,11 @@ | |
| 514 | int login_self_register_available(const char *zNeeded){ |
| 515 | CapabilityString *pCap; |
| 516 | int rc; |
| 517 | if( !db_get_boolean("self-register",0) ) return 0; |
| 518 | if( zNeeded==0 ) return 1; |
| 519 | pCap = capability_add(0, db_get("default-perms", 0)); |
| 520 | capability_expand(pCap); |
| 521 | rc = capability_has_any(pCap, zNeeded); |
| 522 | capability_free(pCap); |
| 523 | return rc; |
| 524 | } |
| @@ -1162,11 +1162,11 @@ | |
| 1162 | if( zPublicPages!=0 ){ |
| 1163 | Glob *pGlob = glob_create(zPublicPages); |
| 1164 | const char *zUri = PD("REQUEST_URI",""); |
| 1165 | zUri += (int)strlen(g.zTop); |
| 1166 | if( glob_match(pGlob, zUri) ){ |
| 1167 | login_set_capabilities(db_get("default-perms", 0), 0); |
| 1168 | } |
| 1169 | glob_free(pGlob); |
| 1170 | } |
| 1171 | } |
| 1172 | |
| @@ -1504,11 +1504,11 @@ | |
| 1504 | @ <p>This project does not allow user self-registration. Please contact the |
| 1505 | @ project administrator to obtain an account.</p> |
| 1506 | style_footer(); |
| 1507 | return; |
| 1508 | } |
| 1509 | zPerms = db_get("default-perms", 0); |
| 1510 | |
| 1511 | /* Prompt the user for email alerts if this repository is configured for |
| 1512 | ** email alerts and if the default permissions include "7" */ |
| 1513 | canDoAlerts = alert_tables_exist() && db_int(0, |
| 1514 | "SELECT fullcap(%Q) GLOB '*7*'", zPerms |
| 1515 |
+2
-2
| --- src/security_audit.c | ||
| +++ src/security_audit.c | ||
| @@ -128,11 +128,11 @@ | ||
| 128 | 128 | */ |
| 129 | 129 | zAnonCap = db_text("", "SELECT fullcap(NULL)"); |
| 130 | 130 | zPubPages = db_get("public-pages",0); |
| 131 | 131 | if( db_get_boolean("self-register",0) ){ |
| 132 | 132 | CapabilityString *pCap; |
| 133 | - pCap = capability_add(0, db_get("default-perms","")); | |
| 133 | + pCap = capability_add(0, db_get("default-perms",0)); | |
| 134 | 134 | capability_expand(pCap); |
| 135 | 135 | zSelfCap = capability_string(pCap); |
| 136 | 136 | capability_free(pCap); |
| 137 | 137 | }else{ |
| 138 | 138 | zSelfCap = fossil_strdup(""); |
| @@ -440,11 +440,11 @@ | ||
| 440 | 440 | @ from throttling expensive operations during peak demand. |
| 441 | 441 | @ <p>If running in a chroot jail on Linux, verify that the /proc |
| 442 | 442 | @ filesystem is mounted within the jail, so that the load average |
| 443 | 443 | @ can be obtained from the /proc/loadavg file. |
| 444 | 444 | }else { |
| 445 | - double r = atof(db_get("max-loadavg", "0")); | |
| 445 | + double r = atof(db_get("max-loadavg", 0)); | |
| 446 | 446 | if( r<=0.0 ){ |
| 447 | 447 | @ <li><p> |
| 448 | 448 | @ Load average limiting is turned off. This can cause the server |
| 449 | 449 | @ to bog down if many requests for expensive services (such as |
| 450 | 450 | @ large diffs or tarballs) arrive at about the same time. |
| 451 | 451 |
| --- src/security_audit.c | |
| +++ src/security_audit.c | |
| @@ -128,11 +128,11 @@ | |
| 128 | */ |
| 129 | zAnonCap = db_text("", "SELECT fullcap(NULL)"); |
| 130 | zPubPages = db_get("public-pages",0); |
| 131 | if( db_get_boolean("self-register",0) ){ |
| 132 | CapabilityString *pCap; |
| 133 | pCap = capability_add(0, db_get("default-perms","")); |
| 134 | capability_expand(pCap); |
| 135 | zSelfCap = capability_string(pCap); |
| 136 | capability_free(pCap); |
| 137 | }else{ |
| 138 | zSelfCap = fossil_strdup(""); |
| @@ -440,11 +440,11 @@ | |
| 440 | @ from throttling expensive operations during peak demand. |
| 441 | @ <p>If running in a chroot jail on Linux, verify that the /proc |
| 442 | @ filesystem is mounted within the jail, so that the load average |
| 443 | @ can be obtained from the /proc/loadavg file. |
| 444 | }else { |
| 445 | double r = atof(db_get("max-loadavg", "0")); |
| 446 | if( r<=0.0 ){ |
| 447 | @ <li><p> |
| 448 | @ Load average limiting is turned off. This can cause the server |
| 449 | @ to bog down if many requests for expensive services (such as |
| 450 | @ large diffs or tarballs) arrive at about the same time. |
| 451 |
| --- src/security_audit.c | |
| +++ src/security_audit.c | |
| @@ -128,11 +128,11 @@ | |
| 128 | */ |
| 129 | zAnonCap = db_text("", "SELECT fullcap(NULL)"); |
| 130 | zPubPages = db_get("public-pages",0); |
| 131 | if( db_get_boolean("self-register",0) ){ |
| 132 | CapabilityString *pCap; |
| 133 | pCap = capability_add(0, db_get("default-perms",0)); |
| 134 | capability_expand(pCap); |
| 135 | zSelfCap = capability_string(pCap); |
| 136 | capability_free(pCap); |
| 137 | }else{ |
| 138 | zSelfCap = fossil_strdup(""); |
| @@ -440,11 +440,11 @@ | |
| 440 | @ from throttling expensive operations during peak demand. |
| 441 | @ <p>If running in a chroot jail on Linux, verify that the /proc |
| 442 | @ filesystem is mounted within the jail, so that the load average |
| 443 | @ can be obtained from the /proc/loadavg file. |
| 444 | }else { |
| 445 | double r = atof(db_get("max-loadavg", 0)); |
| 446 | if( r<=0.0 ){ |
| 447 | @ <li><p> |
| 448 | @ Load average limiting is turned off. This can cause the server |
| 449 | @ to bog down if many requests for expensive services (such as |
| 450 | @ large diffs or tarballs) arrive at about the same time. |
| 451 |
+2
-1
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -45,11 +45,12 @@ | ||
| 45 | 45 | int rc; |
| 46 | 46 | int configSync = 0; /* configuration changes transferred */ |
| 47 | 47 | if( g.fNoSync ){ |
| 48 | 48 | return 0; |
| 49 | 49 | } |
| 50 | - zAutosync = db_get("autosync", "on"); | |
| 50 | + zAutosync = db_get("autosync", 0); | |
| 51 | + if( zAutosync==0 ) zAutosync = "on"; /* defend against misconfig */ | |
| 51 | 52 | if( is_false(zAutosync) ) return 0; |
| 52 | 53 | if( db_get_boolean("dont-push",0) || fossil_strncmp(zAutosync,"pull",4)==0 ){ |
| 53 | 54 | flags &= ~SYNC_CKIN_LOCK; |
| 54 | 55 | if( flags & SYNC_PUSH ) return 0; |
| 55 | 56 | } |
| 56 | 57 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -45,11 +45,12 @@ | |
| 45 | int rc; |
| 46 | int configSync = 0; /* configuration changes transferred */ |
| 47 | if( g.fNoSync ){ |
| 48 | return 0; |
| 49 | } |
| 50 | zAutosync = db_get("autosync", "on"); |
| 51 | if( is_false(zAutosync) ) return 0; |
| 52 | if( db_get_boolean("dont-push",0) || fossil_strncmp(zAutosync,"pull",4)==0 ){ |
| 53 | flags &= ~SYNC_CKIN_LOCK; |
| 54 | if( flags & SYNC_PUSH ) return 0; |
| 55 | } |
| 56 |
| --- src/sync.c | |
| +++ src/sync.c | |
| @@ -45,11 +45,12 @@ | |
| 45 | int rc; |
| 46 | int configSync = 0; /* configuration changes transferred */ |
| 47 | if( g.fNoSync ){ |
| 48 | return 0; |
| 49 | } |
| 50 | zAutosync = db_get("autosync", 0); |
| 51 | if( zAutosync==0 ) zAutosync = "on"; /* defend against misconfig */ |
| 52 | if( is_false(zAutosync) ) return 0; |
| 53 | if( db_get_boolean("dont-push",0) || fossil_strncmp(zAutosync,"pull",4)==0 ){ |
| 54 | flags &= ~SYNC_CKIN_LOCK; |
| 55 | if( flags & SYNC_PUSH ) return 0; |
| 56 | } |
| 57 |
+1
-1
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -677,11 +677,11 @@ | ||
| 677 | 677 | |
| 678 | 678 | /* Determine the check-in manifest artifact ID. Panic on failure. */ |
| 679 | 679 | if( zRevision ){ |
| 680 | 680 | vid = name_to_typed_rid(zRevision, "ci"); |
| 681 | 681 | }else if( !g.localOpen ){ |
| 682 | - vid = name_to_typed_rid(db_get("main-branch", "trunk"), "ci"); | |
| 682 | + vid = name_to_typed_rid(db_get("main-branch", 0), "ci"); | |
| 683 | 683 | }else{ |
| 684 | 684 | vid = db_lget_int("checkout", 0); |
| 685 | 685 | if( !is_a_version(vid) ){ |
| 686 | 686 | zRevision = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid); |
| 687 | 687 | if( zRevision ){ |
| 688 | 688 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -677,11 +677,11 @@ | |
| 677 | |
| 678 | /* Determine the check-in manifest artifact ID. Panic on failure. */ |
| 679 | if( zRevision ){ |
| 680 | vid = name_to_typed_rid(zRevision, "ci"); |
| 681 | }else if( !g.localOpen ){ |
| 682 | vid = name_to_typed_rid(db_get("main-branch", "trunk"), "ci"); |
| 683 | }else{ |
| 684 | vid = db_lget_int("checkout", 0); |
| 685 | if( !is_a_version(vid) ){ |
| 686 | zRevision = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid); |
| 687 | if( zRevision ){ |
| 688 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -677,11 +677,11 @@ | |
| 677 | |
| 678 | /* Determine the check-in manifest artifact ID. Panic on failure. */ |
| 679 | if( zRevision ){ |
| 680 | vid = name_to_typed_rid(zRevision, "ci"); |
| 681 | }else if( !g.localOpen ){ |
| 682 | vid = name_to_typed_rid(db_get("main-branch", 0), "ci"); |
| 683 | }else{ |
| 684 | vid = db_lget_int("checkout", 0); |
| 685 | if( !is_a_version(vid) ){ |
| 686 | zRevision = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid); |
| 687 | if( zRevision ){ |
| 688 |
+1
-1
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -365,11 +365,11 @@ | ||
| 365 | 365 | } |
| 366 | 366 | n = strlen(g.argv[2]); |
| 367 | 367 | if( n>=2 && strncmp(g.argv[2],"new",n)==0 ){ |
| 368 | 368 | Blob passwd, login, caps, contact; |
| 369 | 369 | char *zPw; |
| 370 | - blob_init(&caps, db_get("default-perms", "u"), -1); | |
| 370 | + blob_init(&caps, db_get("default-perms", 0), -1); | |
| 371 | 371 | |
| 372 | 372 | if( g.argc>=4 ){ |
| 373 | 373 | blob_init(&login, g.argv[3], -1); |
| 374 | 374 | }else{ |
| 375 | 375 | prompt_user("login: ", &login); |
| 376 | 376 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -365,11 +365,11 @@ | |
| 365 | } |
| 366 | n = strlen(g.argv[2]); |
| 367 | if( n>=2 && strncmp(g.argv[2],"new",n)==0 ){ |
| 368 | Blob passwd, login, caps, contact; |
| 369 | char *zPw; |
| 370 | blob_init(&caps, db_get("default-perms", "u"), -1); |
| 371 | |
| 372 | if( g.argc>=4 ){ |
| 373 | blob_init(&login, g.argv[3], -1); |
| 374 | }else{ |
| 375 | prompt_user("login: ", &login); |
| 376 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -365,11 +365,11 @@ | |
| 365 | } |
| 366 | n = strlen(g.argv[2]); |
| 367 | if( n>=2 && strncmp(g.argv[2],"new",n)==0 ){ |
| 368 | Blob passwd, login, caps, contact; |
| 369 | char *zPw; |
| 370 | blob_init(&caps, db_get("default-perms", 0), -1); |
| 371 | |
| 372 | if( g.argc>=4 ){ |
| 373 | blob_init(&login, g.argv[3], -1); |
| 374 | }else{ |
| 375 | prompt_user("login: ", &login); |
| 376 |