* Each file in the tarball has a block-sized header with its name and other, * largely hard-coded, properties. */
| 206 | * largely hard-coded, properties. |
| 207 | */ |
| 208 | void |
| 209 | textdump_mkustar(char *block_buffer, const char *filename, u_int size) |
| 210 | { |
| 211 | struct ustar_header *uhp; |
| 212 | |
| 213 | #ifdef TEXTDUMP_VERBOSE |
| 214 | if (textdump_error == 0) |
| 215 | printf("textdump: creating '%s'.\n", filename); |
| 216 | #endif |
| 217 | uhp = (struct ustar_header *)block_buffer; |
| 218 | bzero(uhp, sizeof(*uhp)); |
| 219 | strlcpy(uhp->uh_filename, filename, sizeof(uhp->uh_filename)); |
| 220 | strlcpy(uhp->uh_mode, TAR_MODE, sizeof(uhp->uh_mode)); |
| 221 | snprintf(uhp->uh_size, sizeof(uhp->uh_size), "%o", size); |
| 222 | strlcpy(uhp->uh_tar_owner, TAR_UID, sizeof(uhp->uh_tar_owner)); |
| 223 | strlcpy(uhp->uh_tar_group, TAR_GID, sizeof(uhp->uh_tar_group)); |
| 224 | strlcpy(uhp->uh_owner, TAR_USER, sizeof(uhp->uh_owner)); |
| 225 | strlcpy(uhp->uh_group, TAR_GROUP, sizeof(uhp->uh_group)); |
| 226 | snprintf(uhp->uh_mtime, sizeof(uhp->uh_mtime), "%lo", |
| 227 | (unsigned long)time_second); |
| 228 | uhp->uh_type = 0; |
| 229 | strlcpy(uhp->uh_ustar, TAR_USTAR, sizeof(uhp->uh_ustar)); |
| 230 | ustar_checksum(uhp); |
| 231 | } |
| 232 | |
| 233 | /* |
| 234 | * textdump_writeblock() writes TEXTDUMP_BLOCKSIZE-sized blocks of data to |
no test coverage detected