MCPcopy Index your code
hub / github.com/RsyncProject/rsync / get_acl

Function get_acl

acls.c:539–576  ·  view source on GitHub ↗

Return the Access Control List for the given filename. */

Source from the content-addressed store, hash-verified

537
538/* Return the Access Control List for the given filename. */
539int 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

Callers 7

hard_link_checkFunction · 0.85
copy_valid_pathFunction · 0.85
make_backupFunction · 0.85
set_file_attrsFunction · 0.85
send_file_nameFunction · 0.85
acls_differFunction · 0.85
itemizeFunction · 0.85

Calls 3

create_raclFunction · 0.85
get_rsync_aclFunction · 0.85
free_aclFunction · 0.70

Tested by

no test coverage detected