Return the Access Control List for the given filename. */
| 537 | |
| 538 | /* Return the Access Control List for the given filename. */ |
| 539 | int get_acl(const char *fname, stat_x *sxp) |
| 540 | { |
| 541 | sxp->acc_acl = create_racl(); |
| 542 | |
| 543 | if (S_ISREG(sxp->st.st_mode) || S_ISDIR(sxp->st.st_mode)) { |
| 544 | /* Everyone supports this. */ |
| 545 | } else if (S_ISLNK(sxp->st.st_mode)) { |
| 546 | return 0; |
| 547 | } else if (IS_SPECIAL(sxp->st.st_mode)) { |
| 548 | #ifndef NO_SPECIAL_ACLS |
| 549 | if (!preserve_specials) |
| 550 | #endif |
| 551 | return 0; |
| 552 | } else if (IS_DEVICE(sxp->st.st_mode)) { |
| 553 | #ifndef NO_DEVICE_ACLS |
| 554 | if (!preserve_devices) |
| 555 | #endif |
| 556 | return 0; |
| 557 | } else if (IS_MISSING_FILE(sxp->st)) |
| 558 | return 0; |
| 559 | |
| 560 | if (get_rsync_acl(fname, sxp->acc_acl, SMB_ACL_TYPE_ACCESS, |
| 561 | sxp->st.st_mode) < 0) { |
| 562 | free_acl(sxp); |
| 563 | return -1; |
| 564 | } |
| 565 | |
| 566 | if (S_ISDIR(sxp->st.st_mode)) { |
| 567 | sxp->def_acl = create_racl(); |
| 568 | if (get_rsync_acl(fname, sxp->def_acl, SMB_ACL_TYPE_DEFAULT, |
| 569 | sxp->st.st_mode) < 0) { |
| 570 | free_acl(sxp); |
| 571 | return -1; |
| 572 | } |
| 573 | } |
| 574 | |
| 575 | return 0; |
| 576 | } |
| 577 | |
| 578 | /* === Send functions === */ |
| 579 |
no test coverage detected