|
| const char * | tmpdir (void) |
| | Find a suitable temporary directory for Netatalk.
|
| |
| static void | fail (const char *name, const char *what) |
| |
| static void | write_sidecar (const struct adent *ents, size_t nents, const char *tail, size_t taillen) |
| |
| static void | save_sidecar (void) |
| |
| static int | sidecar_unchanged (void) |
| |
| static int | open_rf_write (void) |
| |
| static int | init_meta (void) |
| |
| static off_t | file_size (const char *p) |
| |
| static ssize_t | read_sidecar (unsigned char *buf, size_t buflen) |
| |
| static void | expect_reject (const char *name, enum reject_reason reason, const struct adent *ents, size_t nents, const char *tail, size_t taillen) |
| |
| static void | expect_short_header_after_stat (void) |
| |
| static int | find_entry (const unsigned char *buf, size_t buflen, uint32_t eid, uint32_t *off, uint32_t *len) |
| |
| static void | expect_legit_conversion (void) |
| |
| static void | expect_empty_rfork (void) |
| |
| static void | expect_declared_len_wins (void) |
| |
| static void | expect_null_path_refresh (void) |
| |
| int | main (void) |
| |
Crafted ._ sidecars are opened through ad_open() with resource-fork write intent, mirroring the afpd call sequence. Malformed entries must be rejected with errno EIO and leave the sidecar untouched. A well-formed sidecar must be rewritten to the canonical OS X layout with its resource fork payload preserved byte for byte.