Lines Matching refs:tar
20 /* Actually, tar header allows leading spaces also.
24 bb_error_msg_and_die("corrupted octal value in tar header");
29 bb_error_msg_and_die("corrupted octal value in tar header");
59 } tar;
67 if (sizeof(tar) != 512)
78 xread(archive_handle->src_fd, &tar, 512);
82 if (tar.name[0] == 0) {
87 while (full_read(archive_handle->src_fd, &tar, 512) == 512)
96 /* Check header has valid magic, "ustar" is for the proper tar
97 * 0's are for the old tar format
99 if (strncmp(tar.magic, "ustar", 5) != 0) {
101 if (memcmp(tar.magic, "\0\0\0\0", 5) != 0)
103 bb_error_msg_and_die("invalid tar magic");
109 * GNU tar source. */
111 sum_s = ' ' * sizeof(tar.chksum);
113 sum_u = ' ' * sizeof(tar.chksum);
115 sum_u += ((unsigned char*)&tar)[i];
117 sum_s += ((signed char*)&tar)[i];
121 sum_u += ((unsigned char*)&tar)[i];
123 sum_s += ((signed char*)&tar)[i];
127 sum = strtoul(tar.chksum, &cp, 8);
131 bb_error_msg_and_die("invalid tar header checksum");
135 sum = xstrtoul(tar.chksum, 8);
137 bb_error_msg_and_die("invalid tar header checksum");
142 if (!tar.typeflag) tar.typeflag = '0';
143 parse_names = (tar.typeflag >= '0' && tar.typeflag <= '7');
147 if (tar.devmajor[0]) {
148 unsigned minor = GET_OCTAL(tar.devminor);
149 unsigned major = GET_OCTAL(tar.devmajor);
153 if (!linkname && parse_names && tar.linkname[0]) {
155 tar.linkname[sizeof(tar.linkname)] = '\0';
156 file_header->link_target = xstrdup(tar.linkname);
159 file_header->mtime = GET_OCTAL(tar.mtime);
160 file_header->size = GET_OCTAL(tar.size);
161 file_header->gid = GET_OCTAL(tar.gid);
162 file_header->uid = GET_OCTAL(tar.uid);
164 file_header->mode = 07777 & GET_OCTAL(tar.mode);
169 tar.name[sizeof(tar.name)] = '\0';
170 if (tar.prefix[0]) {
172 tar.prefix[sizeof(tar.prefix)] = '\0';
173 file_header->name = concat_path_file(tar.prefix, tar.name);
175 file_header->name = xstrdup(tar.name);
180 switch (tar.typeflag) {
212 /* free: paranoia: tar with several consecutive longnames */
239 bb_error_msg("warning: skipping header '%c'", tar.typeflag);
244 xread(archive_handle->src_fd, &tar, 512);
249 bb_error_msg_and_die("unknown typeflag: 0x%x", tar.typeflag);
276 /* (like GNU tar 1.15.1: verbose mode outputs "dir/dir/") */