Fossil SCM

Add the new "y" permission letter that gives authority to push unversioned files.

drh 2016-08-16 19:36 UTC unversioned-files
Commit 5d703ba2ad20b6f596d1e070778ccb318bdd9d3f
--- src/login.c
+++ src/login.c
@@ -1122,10 +1122,11 @@
11221122
case 'c': p->ApndTkt = 1; break;
11231123
case 'q': p->ModTkt = 1; break;
11241124
case 't': p->TktFmt = 1; break;
11251125
case 'b': p->Attach = 1; break;
11261126
case 'x': p->Private = 1; break;
1127
+ case 'y': p->WrUnver = 1; break;
11271128
11281129
/* The "u" privileges is a little different. It recursively
11291130
** inherits all privileges of the user named "reader" */
11301131
case 'u': {
11311132
if( (flags & LOGIN_IGNORE_UV)==0 ){
11321133
--- src/login.c
+++ src/login.c
@@ -1122,10 +1122,11 @@
1122 case 'c': p->ApndTkt = 1; break;
1123 case 'q': p->ModTkt = 1; break;
1124 case 't': p->TktFmt = 1; break;
1125 case 'b': p->Attach = 1; break;
1126 case 'x': p->Private = 1; break;
 
1127
1128 /* The "u" privileges is a little different. It recursively
1129 ** inherits all privileges of the user named "reader" */
1130 case 'u': {
1131 if( (flags & LOGIN_IGNORE_UV)==0 ){
1132
--- src/login.c
+++ src/login.c
@@ -1122,10 +1122,11 @@
1122 case 'c': p->ApndTkt = 1; break;
1123 case 'q': p->ModTkt = 1; break;
1124 case 't': p->TktFmt = 1; break;
1125 case 'b': p->Attach = 1; break;
1126 case 'x': p->Private = 1; break;
1127 case 'y': p->WrUnver = 1; break;
1128
1129 /* The "u" privileges is a little different. It recursively
1130 ** inherits all privileges of the user named "reader" */
1131 case 'u': {
1132 if( (flags & LOGIN_IGNORE_UV)==0 ){
1133
+1
--- src/main.c
+++ src/main.c
@@ -91,10 +91,11 @@
9191
char Attach; /* b: add attachments */
9292
char TktFmt; /* t: create new ticket report formats */
9393
char RdAddr; /* e: read email addresses or other private data */
9494
char Zip; /* z: download zipped artifact via /zip URL */
9595
char Private; /* x: can send and receive private content */
96
+ char WrUnver; /* y: can push unversioned content */
9697
};
9798
9899
#ifdef FOSSIL_ENABLE_TCL
99100
/*
100101
** All Tcl related context information is in this structure. This structure
101102
--- src/main.c
+++ src/main.c
@@ -91,10 +91,11 @@
91 char Attach; /* b: add attachments */
92 char TktFmt; /* t: create new ticket report formats */
93 char RdAddr; /* e: read email addresses or other private data */
94 char Zip; /* z: download zipped artifact via /zip URL */
95 char Private; /* x: can send and receive private content */
 
96 };
97
98 #ifdef FOSSIL_ENABLE_TCL
99 /*
100 ** All Tcl related context information is in this structure. This structure
101
--- src/main.c
+++ src/main.c
@@ -91,10 +91,11 @@
91 char Attach; /* b: add attachments */
92 char TktFmt; /* t: create new ticket report formats */
93 char RdAddr; /* e: read email addresses or other private data */
94 char Zip; /* z: download zipped artifact via /zip URL */
95 char Private; /* x: can send and receive private content */
96 char WrUnver; /* y: can push unversioned content */
97 };
98
99 #ifdef FOSSIL_ENABLE_TCL
100 /*
101 ** All Tcl related context information is in this structure. This structure
102
--- src/setup.c
+++ src/setup.c
@@ -294,10 +294,12 @@
294294
@ user <tt>developer</tt></td></tr>
295295
@ <tr><th valign="top">w</th>
296296
@ <td><i>Write-Tkt:</i> Edit tickets</td></tr>
297297
@ <tr><th valign="top">x</th>
298298
@ <td><i>Private:</i> Push and/or pull private branches</td></tr>
299
+ @ <tr><th valign="top">y</th>
300
+ @ <td><i>Write-Unver:</i> Push unversioned files</td></tr>
299301
@ <tr><th valign="top">z</th>
300302
@ <td><i>Zip download:</i> Download a ZIP archive or tarball</td></tr>
301303
@ </table>
302304
}
303305
@@ -714,10 +716,13 @@
714716
@ onchange="updateCapabilityString()" />
715717
@ Ticket Report%s(B('t'))</label><br />
716718
@ <label><input type="checkbox" name="ax"%s(oa['x'])
717719
@ onchange="updateCapabilityString()" />
718720
@ Private%s(B('x'))</label><br />
721
+ @ <label><input type="checkbox" name="ay"%s(oa['y'])
722
+ @ onchange="updateCapabilityString()" />
723
+ @ Write Unverioned%s(B('y'))</label><br />
719724
@ <label><input type="checkbox" name="az"%s(oa['z'])
720725
@ onchange="updateCapabilityString()" />
721726
@ Download Zip%s(B('z'))</label>
722727
@ </td></tr>
723728
@ </table>
724729
--- src/setup.c
+++ src/setup.c
@@ -294,10 +294,12 @@
294 @ user <tt>developer</tt></td></tr>
295 @ <tr><th valign="top">w</th>
296 @ <td><i>Write-Tkt:</i> Edit tickets</td></tr>
297 @ <tr><th valign="top">x</th>
298 @ <td><i>Private:</i> Push and/or pull private branches</td></tr>
 
 
299 @ <tr><th valign="top">z</th>
300 @ <td><i>Zip download:</i> Download a ZIP archive or tarball</td></tr>
301 @ </table>
302 }
303
@@ -714,10 +716,13 @@
714 @ onchange="updateCapabilityString()" />
715 @ Ticket Report%s(B('t'))</label><br />
716 @ <label><input type="checkbox" name="ax"%s(oa['x'])
717 @ onchange="updateCapabilityString()" />
718 @ Private%s(B('x'))</label><br />
 
 
 
719 @ <label><input type="checkbox" name="az"%s(oa['z'])
720 @ onchange="updateCapabilityString()" />
721 @ Download Zip%s(B('z'))</label>
722 @ </td></tr>
723 @ </table>
724
--- src/setup.c
+++ src/setup.c
@@ -294,10 +294,12 @@
294 @ user <tt>developer</tt></td></tr>
295 @ <tr><th valign="top">w</th>
296 @ <td><i>Write-Tkt:</i> Edit tickets</td></tr>
297 @ <tr><th valign="top">x</th>
298 @ <td><i>Private:</i> Push and/or pull private branches</td></tr>
299 @ <tr><th valign="top">y</th>
300 @ <td><i>Write-Unver:</i> Push unversioned files</td></tr>
301 @ <tr><th valign="top">z</th>
302 @ <td><i>Zip download:</i> Download a ZIP archive or tarball</td></tr>
303 @ </table>
304 }
305
@@ -714,10 +716,13 @@
716 @ onchange="updateCapabilityString()" />
717 @ Ticket Report%s(B('t'))</label><br />
718 @ <label><input type="checkbox" name="ax"%s(oa['x'])
719 @ onchange="updateCapabilityString()" />
720 @ Private%s(B('x'))</label><br />
721 @ <label><input type="checkbox" name="ay"%s(oa['y'])
722 @ onchange="updateCapabilityString()" />
723 @ Write Unverioned%s(B('y'))</label><br />
724 @ <label><input type="checkbox" name="az"%s(oa['z'])
725 @ onchange="updateCapabilityString()" />
726 @ Download Zip%s(B('z'))</label>
727 @ </td></tr>
728 @ </table>
729
+2 -2
--- src/xfer.c
+++ src/xfer.c
@@ -1226,11 +1226,11 @@
12261226
/* uvfile NAME MTIME HASH SIZE FLAGS \n CONTENT
12271227
**
12281228
** Accept an unversioned file from the client.
12291229
*/
12301230
if( blob_eq(&xfer.aToken[0], "uvfile") ){
1231
- xfer_accept_unversioned_file(&xfer, g.perm.Write);
1231
+ xfer_accept_unversioned_file(&xfer, g.perm.WrUnver);
12321232
if( blob_size(&xfer.err) ){
12331233
cgi_reset_content();
12341234
@ error %T(blob_str(&xfer.err))
12351235
nErr++;
12361236
break;
@@ -1518,11 +1518,11 @@
15181518
** The client wants to make sure that unversioned files are all synced.
15191519
** If the HASH does not match, send a complete catalog of
15201520
** "uvigot" cards.
15211521
*/
15221522
if( blob_eq(&xfer.aToken[1], "uv-hash") && blob_is_uuid(&xfer.aToken[2]) ){
1523
- if( g.perm.Read && g.perm.Write ){
1523
+ if( g.perm.Read && g.perm.WrUnver ){
15241524
@ pragma uv-push-ok
15251525
send_unversioned_catalog(&xfer);
15261526
}else if( g.perm.Read ){
15271527
@ pragma uv-pull-only
15281528
send_unversioned_catalog(&xfer);
15291529
--- src/xfer.c
+++ src/xfer.c
@@ -1226,11 +1226,11 @@
1226 /* uvfile NAME MTIME HASH SIZE FLAGS \n CONTENT
1227 **
1228 ** Accept an unversioned file from the client.
1229 */
1230 if( blob_eq(&xfer.aToken[0], "uvfile") ){
1231 xfer_accept_unversioned_file(&xfer, g.perm.Write);
1232 if( blob_size(&xfer.err) ){
1233 cgi_reset_content();
1234 @ error %T(blob_str(&xfer.err))
1235 nErr++;
1236 break;
@@ -1518,11 +1518,11 @@
1518 ** The client wants to make sure that unversioned files are all synced.
1519 ** If the HASH does not match, send a complete catalog of
1520 ** "uvigot" cards.
1521 */
1522 if( blob_eq(&xfer.aToken[1], "uv-hash") && blob_is_uuid(&xfer.aToken[2]) ){
1523 if( g.perm.Read && g.perm.Write ){
1524 @ pragma uv-push-ok
1525 send_unversioned_catalog(&xfer);
1526 }else if( g.perm.Read ){
1527 @ pragma uv-pull-only
1528 send_unversioned_catalog(&xfer);
1529
--- src/xfer.c
+++ src/xfer.c
@@ -1226,11 +1226,11 @@
1226 /* uvfile NAME MTIME HASH SIZE FLAGS \n CONTENT
1227 **
1228 ** Accept an unversioned file from the client.
1229 */
1230 if( blob_eq(&xfer.aToken[0], "uvfile") ){
1231 xfer_accept_unversioned_file(&xfer, g.perm.WrUnver);
1232 if( blob_size(&xfer.err) ){
1233 cgi_reset_content();
1234 @ error %T(blob_str(&xfer.err))
1235 nErr++;
1236 break;
@@ -1518,11 +1518,11 @@
1518 ** The client wants to make sure that unversioned files are all synced.
1519 ** If the HASH does not match, send a complete catalog of
1520 ** "uvigot" cards.
1521 */
1522 if( blob_eq(&xfer.aToken[1], "uv-hash") && blob_is_uuid(&xfer.aToken[2]) ){
1523 if( g.perm.Read && g.perm.WrUnver ){
1524 @ pragma uv-push-ok
1525 send_unversioned_catalog(&xfer);
1526 }else if( g.perm.Read ){
1527 @ pragma uv-pull-only
1528 send_unversioned_catalog(&xfer);
1529

Keyboard Shortcuts

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