Home | History | Annotate | Download | only in pax

Lines Matching defs:hd

112 check_sum(char *hd, size_t hdlen, char *bl, size_t bllen, int quiet)
116 hdck = asc_u32(hd, hdlen, OCT);
379 HD_TAR *hd;
385 hd = (HD_TAR *)blk;
395 if (hd->name[0] == '\0')
407 return check_sum(hd->chksum, sizeof(hd->chksum), blk, BLKMULT, 1);
459 HD_TAR *hd;
475 hd = (HD_TAR *)buf;
476 if (hd->linkflag != LONGLINKTYPE && hd->linkflag != LONGNAMETYPE) {
478 &gnu_name_string, &gnu_name_length, hd->name,
479 sizeof(hd->name));
481 &gnu_link_string, &gnu_link_length, hd->linkname,
482 sizeof(hd->linkname));
484 arcn->sb.st_mode = (mode_t)(asc_u32(hd->mode,sizeof(hd->mode),OCT) &
486 arcn->sb.st_uid = (uid_t)asc_u32(hd->uid, sizeof(hd->uid), OCT);
487 arcn->sb.st_gid = (gid_t)asc_u32(hd->gid, sizeof(hd->gid), OCT);
488 arcn->sb.st_size = (off_t)ASC_OFFT(hd->size, sizeof(hd->size), OCT);
491 arcn->sb.st_mtime = (time_t)(int32_t)asc_u32(hd->mtime, sizeof(hd->mtime), OCT);
501 switch(hd->linkflag) {
530 if (hd->linkflag != LONGLINKTYPE)
546 if (*pt == '/' || hd->linkflag == DIRTYPE) {
592 HD_TAR *hd;
625 if (arcn->ln_nlen > (int)sizeof(hd->linkname)) {
643 if (len >= (int)sizeof(hd->name)) {
657 hd = (HD_TAR *)hdblk;
658 strlcpy(hd->name, arcn->name, sizeof(hd->name));
667 hd->linkflag = AREGTYPE;
668 hd->name[len-1] = '/';
669 if (u32_oct((uintmax_t)0L, hd->size, sizeof(hd->size), 1))
675 hd->linkflag = SYMTYPE;
676 strlcpy(hd->linkname, arcn->ln_name, sizeof(hd->linkname));
677 if (u32_oct((uintmax_t)0L, hd->size, sizeof(hd->size), 1))
683 hd->linkflag = LNKTYPE;
684 strlcpy(hd->linkname, arcn->ln_name, sizeof(hd->linkname));
685 if (u32_oct((uintmax_t)0L, hd->size, sizeof(hd->size), 1))
691 hd->linkflag = AREGTYPE;
692 if (OFFT_OCT(arcn->sb.st_size, hd->size, sizeof(hd->size), 1)) {
704 if (u32_oct((uintmax_t)arcn->sb.st_mode, hd->mode, sizeof(hd->mode), 0) ||
705 u32_oct((uintmax_t)arcn->sb.st_uid, hd->uid, sizeof(hd->uid), 0) ||
706 u32_oct((uintmax_t)arcn->sb.st_gid, hd->gid, sizeof(hd->gid), 0) ||
707 u32_oct(mtime, hd->mtime, sizeof(hd->mtime), 1))
715 if (u32_oct(tar_chksm(hdblk, sizeof(HD_TAR)), hd->chksum,
716 sizeof(hd->chksum), 3))
780 HD_USTAR *hd;
784 hd = (HD_USTAR *)blk;
792 if (hd->name[0] == '\0')
794 if (strncmp(hd->magic, TMAGIC, TMAGLEN - 1) != 0)
797 if (strncmp(hd->magic, "ustar ", 8) == 0 && !is_gnutar &&
803 return check_sum(hd->chksum, sizeof(hd->chksum), blk, BLKMULT, 0);
817 HD_USTAR *hd;
833 hd = (HD_USTAR *)buf;
840 if (*(hd->prefix) != '\0') {
841 cnt = strlcpy(arcn->name, hd->prefix, sizeof(arcn->name));
849 if (hd->typeflag != LONGLINKTYPE && hd->typeflag != LONGNAMETYPE) {
851 &gnu_name_string, &gnu_name_length, hd->name,
852 sizeof(hd->name)) + cnt;
855 hd->linkname, sizeof(hd->linkname));
862 arcn->sb.st_mode = (mode_t)(asc_u32(hd->mode, sizeof(hd->mode), OCT) &
864 arcn->sb.st_size = (off_t)ASC_OFFT(hd->size, sizeof(hd->size), OCT);
867 arcn->sb.st_mtime = (time_t)(int32_t)asc_u32(hd->mtime, sizeof(hd->mtime), OCT);
876 hd->gname[sizeof(hd->gname) - 1] = '\0';
877 if (gid_from_group(hd->gname, &(arcn->sb.st_gid)) < 0)
878 arcn->sb.st_gid = (gid_t)asc_u32(hd->gid, sizeof(hd->gid), OCT);
879 hd->uname[sizeof(hd->uname) - 1] = '\0';
880 if (uid_from_user(hd->uname, &(arcn->sb.st_uid)) < 0)
881 arcn->sb.st_uid = (uid_t)asc_u32(hd->uid, sizeof(hd->uid), OCT);
893 switch(hd->typeflag) {
916 if (hd->typeflag == BLKTYPE) {
923 devmajor = (dev_t)asc_u32(hd->devmajor,sizeof(hd->devmajor),OCT);
924 devminor = (dev_t)asc_u32(hd->devminor,sizeof(hd->devminor),OCT);
929 if (hd->typeflag == SYMTYPE) {
948 if (hd->typeflag != LONGLINKTYPE)
956 hd->typeflag == LONGLINKTYPE ? "Link" : "File");
964 hd->typeflag == FILEXTYPE ? "File" : "Global");
1055 HD_USTAR *hd;
1077 if (arcn->ln_nlen >= (int)sizeof(hd->linkname)) {
1110 hd = (HD_USTAR *)hdblk;
1122 strlcpy(hd->prefix, arcn->name, sizeof(hd->prefix));
1130 strlcpy(hd->name, pt, sizeof(hd->name));
1137 hd->typeflag = DIRTYPE;
1138 if (u32_oct((uintmax_t)0L, hd->size, sizeof(hd->size), 3))
1144 hd->typeflag = CHRTYPE;
1146 hd->typeflag = BLKTYPE;
1147 if (u32_oct((uintmax_t)MAJOR(arcn->sb.st_rdev), hd->devmajor,
1148 sizeof(hd->devmajor), 3) ||
1149 u32_oct((uintmax_t)MINOR(arcn->sb.st_rdev), hd->devminor,
1150 sizeof(hd->devminor), 3) ||
1151 u32_oct((uintmax_t)0L, hd->size, sizeof(hd->size), 3))
1155 hd->typeflag = FIFOTYPE;
1156 if (u32_oct((uintmax_t)0L, hd->size, sizeof(hd->size), 3))
1164 hd->typeflag = SYMTYPE;
1166 hd->typeflag = LONGLINKTYPE;
1168 hd->typeflag = LNKTYPE;
1169 strlcpy(hd->linkname, arcn->ln_name, sizeof(hd->linkname));
1170 if (u32_oct((uintmax_t)gnu_hack_len, hd->size,
1171 sizeof(hd->size), 3))
1182 hd->typeflag = LONGNAMETYPE;
1184 if (OFFT_OCT((uint32_t)gnu_hack_len, hd->size,
1185 sizeof(hd->size), 3)) {
1192 hd->typeflag = CONTTYPE;
1194 hd->typeflag = REGTYPE;
1196 if (OFFT_OCT(arcn->sb.st_size, hd->size,
1197 sizeof(hd->size), 3)) {
1206 strncpy(hd->magic, TMAGIC, TMAGLEN);
1208 hd->magic[TMAGLEN - 1] = hd->version[0] = ' ';
1210 strncpy(hd->version, TVERSION, TVERSLEN);
1216 if (u32_oct((uintmax_t)arcn->sb.st_mode, hd->mode, sizeof(hd->mode), 3))
1218 if (u32_oct((uintmax_t)arcn->sb.st_uid, hd->uid, sizeof(hd->uid), 3))
1220 if (u32_oct((uintmax_t)arcn->sb.st_gid, hd->gid, sizeof(hd->gid), 3))
1223 if (u32_oct(mtime, hd->mtime, sizeof(hd->mtime), 3))
1227 strncpy(hd->uname, user ? user : "", sizeof(hd->uname));
1228 strncpy(hd->gname, group ? group : "", sizeof(hd->gname));
1235 if (u32_oct(tar_chksm(hdblk, sizeof(HD_USTAR)), hd->chksum,
1236 sizeof(hd->chksum), 3))