src/server/daemon/vfs.c

changeset 593
d83dced6dd80
parent 592
2839d5e28c75
equal deleted inserted replaced
592:2839d5e28c75 593:d83dced6dd80
375 } 375 }
376 376
377 if(sysacl.acl) { 377 if(sysacl.acl) {
378 if(!fs_acl_check(&sysacl, ctx->user, path, access_mask)) { 378 if(!fs_acl_check(&sysacl, ctx->user, path, access_mask)) {
379 acl_set_error_status(ctx->sn, ctx->rq, sysacl.acl, ctx->user); 379 acl_set_error_status(ctx->sn, ctx->rq, sysacl.acl, ctx->user);
380 ctx->error_response_set = TRUE;
380 return NULL; 381 return NULL;
381 } 382 }
382 } 383 }
383 384
384 // open file 385 // open file
623 access_mask, 624 access_mask,
624 &sysacl->acl); 625 &sysacl->acl);
625 626
626 if(acl) { 627 if(acl) {
627 acl_set_error_status(ctx->sn, ctx->rq, acl, ctx->user); 628 acl_set_error_status(ctx->sn, ctx->rq, acl, ctx->user);
629 ctx->error_response_set = TRUE;
628 return 1; 630 return 1;
629 } 631 }
630 } 632 }
631 633
632 return 0; 634 return 0;
633 } 635 }
634 636
635 void sys_set_error_status(VFSContext *ctx) { 637 void sys_set_error_status(VFSContext *ctx) {
636 if(ctx->sn && ctx->rq && !ctx->error_response_set) { 638 if(ctx->sn && ctx->rq && !ctx->error_response_set) {
637 int status = util_errno2status(ctx->vfs_errno); 639 int status = ctx->vfs_errno != 0 ? util_errno2status(ctx->vfs_errno) : 500;
638 protocol_status(ctx->sn, ctx->rq, status, NULL); 640 protocol_status(ctx->sn, ctx->rq, status, NULL);
639 ctx->error_response_set = TRUE; 641 ctx->error_response_set = TRUE;
640 } 642 }
641 } 643 }
642 644

mercurial