static int atalk_lchown(struct vfs_handle_struct *handle, const struct smb_filename *smb_fname, uid_t uid, gid_t gid) { int ret = 0; char *adbl_path = 0; char *orig_path = 0; SMB_STRUCT_STAT adbl_info; SMB_STRUCT_STAT orig_info; TALLOC_CTX *ctx; ret = SMB_VFS_NEXT_LCHOWN(handle, smb_fname, uid, gid); if (!(ctx = talloc_init("lchown_file"))) return ret; if (atalk_build_paths(ctx, handle->conn->cwd, smb_fname->base_name, &adbl_path, &orig_path, &adbl_info, &orig_info) != 0) goto exit_lchown; if (!S_ISDIR(orig_info.st_ex_mode) && !S_ISREG(orig_info.st_ex_mode)) { DEBUG(3, ("ATALK: %s has passed..\n", orig_path)); goto exit_lchown; } if (lchown(adbl_path, uid, gid) == -1) { DEBUG(3, ("ATALK: lchown error %s\n", strerror(errno))); } exit_lchown: talloc_destroy(ctx); return ret; }
static int skel_lchown(vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid) { return SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid); }