##// END OF EJS Templates
chg: upgrade client to use "setumask2" command...
Yuya Nishihara -
r40145:413b6b10 default
parent child Browse files
Show More
@@ -32,7 +32,7 b' enum { CAP_GETENCODING = 0x0001,'
32 32 CAP_ATTACHIO = 0x0100,
33 33 CAP_CHDIR = 0x0200,
34 34 CAP_SETENV = 0x0800,
35 CAP_SETUMASK = 0x1000,
35 CAP_SETUMASK2 = 0x1000,
36 36 CAP_VALIDATE = 0x2000,
37 37 CAP_SETPROCNAME = 0x4000,
38 38 };
@@ -48,7 +48,7 b' static const cappair_t captable[] = {'
48 48 {"attachio", CAP_ATTACHIO},
49 49 {"chdir", CAP_CHDIR},
50 50 {"setenv", CAP_SETENV},
51 {"setumask", CAP_SETUMASK},
51 {"setumask2", CAP_SETUMASK2},
52 52 {"validate", CAP_VALIDATE},
53 53 {"setprocname", CAP_SETPROCNAME},
54 54 {NULL, 0}, /* terminator */
@@ -425,10 +425,11 b' static void forwardumask(hgclient_t *hgc'
425 425 mode_t mask = umask(0);
426 426 umask(mask);
427 427
428 static const char command[] = "setumask\n";
429 sendall(hgc->sockfd, command, sizeof(command) - 1);
430 428 uint32_t data = htonl(mask);
431 sendall(hgc->sockfd, &data, sizeof(data));
429 enlargecontext(&hgc->ctx, sizeof(data));
430 memcpy(hgc->ctx.data, &data, sizeof(data));
431 hgc->ctx.datasize = sizeof(data);
432 writeblockrequest(hgc, "setumask2");
432 433 }
433 434
434 435 /*!
@@ -508,7 +509,7 b' hgclient_t *hgc_open(const char *socknam'
508 509 attachio(hgc);
509 510 if (hgc->capflags & CAP_CHDIR)
510 511 chdirtocwd(hgc);
511 if (hgc->capflags & CAP_SETUMASK)
512 if (hgc->capflags & CAP_SETUMASK2)
512 513 forwardumask(hgc);
513 514
514 515 return hgc;
General Comments 0
You need to be logged in to leave comments. Login now