| 539 | DST_NAME if defined. */ |
| 540 | |
| 541 | static void |
| 542 | set_author (MAYBE_UNUSED char const *dst_name, MAYBE_UNUSED int dest_desc, |
| 543 | MAYBE_UNUSED const struct stat *src_sb) |
| 544 | { |
| 545 | #if HAVE_STRUCT_STAT_ST_AUTHOR |
| 546 | /* FIXME: Modify the following code so that it does not |
| 547 | follow symbolic links. */ |
| 548 | |
| 549 | /* Preserve the st_author field. */ |
| 550 | file_t file = (dest_desc < 0 |
| 551 | ? file_name_lookup (dst_name, 0, 0) |
| 552 | : getdport (dest_desc)); |
| 553 | if (file == MACH_PORT_NULL) |
| 554 | error (0, errno, _("failed to lookup file %s"), quoteaf (dst_name)); |
| 555 | else |
| 556 | { |
| 557 | error_t err = file_chauthor (file, src_sb->st_author); |
| 558 | if (err) |
| 559 | error (0, err, _("failed to preserve authorship for %s"), |
| 560 | quoteaf (dst_name)); |
| 561 | mach_port_deallocate (mach_task_self (), file); |
| 562 | } |
| 563 | #endif |
| 564 | } |
| 565 | |
| 566 | /* Set the default security context for the process. New files will |
| 567 | have this security context set. Also existing files can have their |
no outgoing calls
no test coverage detected