Lines Matching defs:name

19  * 3. Neither the name of the University nor the names of its contributors
79 * file and a character device or fifo exists with the same name, we
87 if ((fd = open(arcn->name, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL,
96 if (unlnk_exist(arcn->name, arcn->type) != 0)
105 if ((fd = open(arcn->name, O_WRONLY | O_CREAT | O_TRUNC,
109 if (nodirs || chk_path(arcn->name,arcn->sb.st_uid,arcn->sb.st_gid) < 0) {
110 syswarn(1, oerrno, "Unable to create %s", arcn->name);
134 arcn->name);
142 res = set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid);
152 set_pmode(arcn->name, arcn->sb.st_mode);
154 set_ftime(arcn->name, arcn->sb.st_mtime, arcn->sb.st_atime, 0);
159 * Create a hard link to arcn->ln_name from arcn->name. arcn->ln_name
176 arcn->name);
186 return(mk_link(arcn->ln_name, &sb, arcn->name, 0));
191 * Create a hard link to arcn->org_name from arcn->name. Only used in copy
209 return(mk_link(arcn->org_name, &(arcn->sb), arcn->name, 1));
232 if (lstat(arcn->name, &sb) < 0)
242 arcn->name);
354 res = mkdir(arcn->name, file_mode);
360 res = mknod(arcn->name, file_mode, arcn->sb.st_rdev);
364 res = mknod(arcn->name, file_mode, arcn->sb.st_rdev);
367 res = mkfifo(arcn->name, file_mode);
375 arcn->name);
378 res = symlink(arcn->ln_name, arcn->name);
389 arcn->name);
405 if ((ign = unlnk_exist(arcn->name, arcn->type)) < 0)
411 if (nodirs || chk_path(arcn->name,arcn->sb.st_uid,arcn->sb.st_gid) < 0) {
412 syswarn(1, oerrno, "Could not create: %s", arcn->name);
421 res = set_ids(arcn->name, arcn->sb.st_uid, arcn->sb.st_gid);
433 set_pmode(arcn->name, arcn->sb.st_mode);
445 if (access(arcn->name, R_OK | W_OK | X_OK) < 0) {
446 if (lstat(arcn->name, &sb) < 0) {
448 arcn->name);
449 set_pmode(arcn->name,file_mode | S_IRWXU);
457 set_pmode(arcn->name,
467 add_dir(arcn->name, arcn->nlen, &(arcn->sb), 1);
469 add_dir(arcn->name, arcn->nlen, &(arcn->sb), 0);
473 set_ftime(arcn->name, arcn->sb.st_mtime, arcn->sb.st_atime, 0);
479 * Remove node from file system with the specified name. We pass the type
484 * 0 is ok to proceed, no file with the specified name exists
490 unlnk_exist(char *name, int type)
497 if (lstat(name, &sb) < 0)
507 if (rmdir(name) < 0) {
510 syswarn(1,errno,"Unable to remove directory %s", name);
519 if (unlink(name) < 0) {
520 syswarn(1, errno, "Could not unlink %s", name);
541 chk_path( char *name, uid_t st_uid, gid_t st_gid)
543 char *spt = name;
571 if (lstat(name, &sb) == 0) {
580 if (mkdir(name, S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
593 (void)set_ids(name, st_uid, st_gid);
601 if ((access(name, R_OK | W_OK | X_OK) < 0) &&
602 (lstat(name, &sb) == 0)) {
603 set_pmode(name, ((sb.st_mode & FILEBITS) | S_IRWXU));
604 add_dir(name, spt - name, &sb, 1);
743 char *name)
791 name);
807 syswarn(1, errno, "Failed write to file %s", name);