Lines Matching refs:arcn
69 file_creat(ARCHD *arcn) in file_creat() argument
86 file_mode = arcn->sb.st_mode & FILEBITS; in file_creat()
87 if ((fd = open(arcn->name, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, in file_creat()
96 if (unlnk_exist(arcn->name, arcn->type) != 0) in file_creat()
105 if ((fd = open(arcn->name, O_WRONLY | O_CREAT | O_TRUNC, in file_creat()
109 if (nodirs || chk_path(arcn->name,arcn->sb.st_uid,arcn->sb.st_gid) < 0) { in file_creat()
110 syswarn(1, oerrno, "Unable to create %s", arcn->name); in file_creat()
126 file_close(ARCHD *arcn, int fd) in file_close() argument
134 arcn->name); in file_close()
142 res = set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid); in file_close()
150 arcn->sb.st_mode &= ~(SETBITS); in file_close()
152 set_pmode(arcn->name, arcn->sb.st_mode); in file_close()
154 set_ftime(arcn->name, arcn->sb.st_mtime, arcn->sb.st_atime, 0); in file_close()
166 lnk_creat(ARCHD *arcn) in lnk_creat() argument
174 if (lstat(arcn->ln_name, &sb) < 0) { in lnk_creat()
175 syswarn(1,errno,"Unable to link to %s from %s", arcn->ln_name, in lnk_creat()
176 arcn->name); in lnk_creat()
182 arcn->ln_name); in lnk_creat()
186 return(mk_link(arcn->ln_name, &sb, arcn->name, 0)); in lnk_creat()
200 cross_lnk(ARCHD *arcn) in cross_lnk() argument
207 if (arcn->type == PAX_DIR) in cross_lnk()
209 return(mk_link(arcn->org_name, &(arcn->sb), arcn->name, 1)); in cross_lnk()
224 chk_same(ARCHD *arcn) in chk_same() argument
232 if (lstat(arcn->name, &sb) < 0) in chk_same()
240 if ((arcn->sb.st_dev == sb.st_dev) && (arcn->sb.st_ino == sb.st_ino)) { in chk_same()
242 arcn->name); in chk_same()
334 node_creat(ARCHD *arcn) in node_creat() argument
349 file_mode = arcn->sb.st_mode & FILEBITS; in node_creat()
352 switch(arcn->type) { in node_creat()
354 res = mkdir(arcn->name, file_mode); in node_creat()
360 res = mknod(arcn->name, file_mode, arcn->sb.st_rdev); in node_creat()
364 res = mknod(arcn->name, file_mode, arcn->sb.st_rdev); in node_creat()
367 res = mkfifo(arcn->name, file_mode); in node_creat()
375 arcn->name); in node_creat()
378 res = symlink(arcn->ln_name, arcn->name); in node_creat()
389 arcn->name); in node_creat()
405 if ((ign = unlnk_exist(arcn->name, arcn->type)) < 0) in node_creat()
411 if (nodirs || chk_path(arcn->name,arcn->sb.st_uid,arcn->sb.st_gid) < 0) { in node_creat()
412 syswarn(1, oerrno, "Could not create: %s", arcn->name); in node_creat()
421 res = set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid); in node_creat()
431 arcn->sb.st_mode &= ~(SETBITS); in node_creat()
433 set_pmode(arcn->name, arcn->sb.st_mode); in node_creat()
435 if (arcn->type == PAX_DIR && strcmp(NM_CPIO, argv0) != 0) { in node_creat()
445 if (access(arcn->name, R_OK | W_OK | X_OK) < 0) { in node_creat()
446 if (lstat(arcn->name, &sb) < 0) { in node_creat()
448 arcn->name); in node_creat()
449 set_pmode(arcn->name,file_mode | S_IRWXU); in node_creat()
457 set_pmode(arcn->name, in node_creat()
460 arcn->sb.st_mode = sb.st_mode; in node_creat()
467 add_dir(arcn->name, arcn->nlen, &(arcn->sb), 1); in node_creat()
469 add_dir(arcn->name, arcn->nlen, &(arcn->sb), 0); in node_creat()
473 set_ftime(arcn->name, arcn->sb.st_mtime, arcn->sb.st_atime, 0); in node_creat()
859 rdfile_close(ARCHD *arcn, int *fd) in rdfile_close() argument
875 set_ftime(arcn->org_name, arcn->sb.st_mtime, arcn->sb.st_atime, 1); in rdfile_close()
889 set_crc(ARCHD *arcn, int fd) in set_crc() argument
903 arcn->crc = 0L; in set_crc()
907 if ((size = (u_long)arcn->sb.st_blksize) > (u_long)sizeof(tbuf)) in set_crc()
926 if (cpcnt != arcn->sb.st_size) in set_crc()
927 paxwarn(1, "File changed size %s", arcn->org_name); in set_crc()
929 syswarn(1, errno, "Failed stat on %s", arcn->org_name); in set_crc()
930 else if (arcn->sb.st_mtime != sb.st_mtime) in set_crc()
931 paxwarn(1, "File %s was modified during read", arcn->org_name); in set_crc()
933 syswarn(1, errno, "File rewind failed on: %s", arcn->org_name); in set_crc()
935 arcn->crc = crc; in set_crc()