making eprintfs include filename in symlink
This commit is contained in:
parent
f8885dbad0
commit
bacbf060e3
3 changed files with 21 additions and 9 deletions
|
|
@ -190,6 +190,11 @@ static void readdir_copy_full_dir_info(
|
||||||
IN PFILE_DIR_INFO_UNION info)
|
IN PFILE_DIR_INFO_UNION info)
|
||||||
{
|
{
|
||||||
readdir_copy_dir_info(entry, info);
|
readdir_copy_dir_info(entry, info);
|
||||||
|
/* for files with the FILE_ATTRIBUTE_REPARSE_POINT attribute,
|
||||||
|
* EaSize is used instead to specify its reparse tag. this makes
|
||||||
|
* the 'dir' command to show files as <SYMLINK>, and triggers a
|
||||||
|
* FSCTL_GET_REPARSE_POINT to query the symlink target
|
||||||
|
*/
|
||||||
info->fifdi.EaSize = entry->attr_info.type == NF4LNK ?
|
info->fifdi.EaSize = entry->attr_info.type == NF4LNK ?
|
||||||
IO_REPARSE_TAG_SYMLINK : 0;
|
IO_REPARSE_TAG_SYMLINK : 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,8 @@ static int handle_nfs41_rename(setattr_upcall_args *args)
|
||||||
/* replace the path with the symlink target's */
|
/* replace the path with the symlink target's */
|
||||||
status = nfs41_symlink_target(dst_session, &dst_dir, &dst_path);
|
status = nfs41_symlink_target(dst_session, &dst_dir, &dst_path);
|
||||||
if (status) {
|
if (status) {
|
||||||
eprintf("nfs41_symlink_target() failed with %d\n", status);
|
eprintf("nfs41_symlink_target() for %s failed with %d\n",
|
||||||
|
dst_dir.path->path, status);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -375,7 +376,8 @@ int handle_nfs41_link(setattr_upcall_args *args)
|
||||||
/* replace the path with the symlink target's */
|
/* replace the path with the symlink target's */
|
||||||
status = nfs41_symlink_target(dst_session, &dst_dir, &dst_path);
|
status = nfs41_symlink_target(dst_session, &dst_dir, &dst_path);
|
||||||
if (status) {
|
if (status) {
|
||||||
eprintf("nfs41_symlink_target() failed with %d\n", status);
|
eprintf("nfs41_symlink_target() for %s failed with %d\n",
|
||||||
|
dst_dir.path->path, status);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,8 @@ int nfs41_symlink_target(
|
||||||
/* read the link */
|
/* read the link */
|
||||||
status = nfs41_readlink(session, file, NFS41_MAX_PATH_LEN, link, &link_len);
|
status = nfs41_readlink(session, file, NFS41_MAX_PATH_LEN, link, &link_len);
|
||||||
if (status) {
|
if (status) {
|
||||||
eprintf("nfs41_readlink() failed with %s\n", nfs_error_string(status));
|
eprintf("nfs41_readlink() for %s failed with %s\n", file->path->path,
|
||||||
|
nfs_error_string(status));
|
||||||
status = ERROR_PATH_NOT_FOUND;
|
status = ERROR_PATH_NOT_FOUND;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
@ -135,7 +136,8 @@ int nfs41_symlink_target(
|
||||||
}
|
}
|
||||||
status = abs_path_link(target, target->path + path_offset, link, link_len);
|
status = abs_path_link(target, target->path + path_offset, link, link_len);
|
||||||
if (status) {
|
if (status) {
|
||||||
eprintf("abs_path_link() failed with %d\n", status);
|
eprintf("abs_path_link() for path %s with link %s failed with %d\n",
|
||||||
|
target->path, link, status);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
|
|
@ -238,6 +240,9 @@ int handle_symlink(nfs41_upcall *upcall)
|
||||||
if (state->file.fh.len) {
|
if (state->file.fh.len) {
|
||||||
/* the check in handle_open() didn't catch that we're creating
|
/* the check in handle_open() didn't catch that we're creating
|
||||||
* a symlink, so we have to remove the file it already created */
|
* a symlink, so we have to remove the file it already created */
|
||||||
|
eprintf("handle_symlink: attempting to create a symlink when "
|
||||||
|
"the file=%s was already created on open; sending REMOVE "
|
||||||
|
"first\n", state->file.path->path);
|
||||||
nfs41_remove(state->session, &state->parent, &state->file.name);
|
nfs41_remove(state->session, &state->parent, &state->file.name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -245,8 +250,8 @@ int handle_symlink(nfs41_upcall *upcall)
|
||||||
status = nfs41_create(state->session, NF4LNK, 0777,
|
status = nfs41_create(state->session, NF4LNK, 0777,
|
||||||
args->target_set, &state->parent, &state->file);
|
args->target_set, &state->parent, &state->file);
|
||||||
if (status) {
|
if (status) {
|
||||||
eprintf("nfs41_create() failed with %s\n",
|
eprintf("nfs41_create() for symlink=%s failed with %s\n",
|
||||||
nfs_error_string(status));
|
args->target_set, nfs_error_string(status));
|
||||||
status = map_symlink_errors(status);
|
status = map_symlink_errors(status);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
@ -257,8 +262,8 @@ int handle_symlink(nfs41_upcall *upcall)
|
||||||
status = nfs41_readlink(state->session, &state->file,
|
status = nfs41_readlink(state->session, &state->file,
|
||||||
NFS41_MAX_PATH_LEN, args->target_get.path, &len);
|
NFS41_MAX_PATH_LEN, args->target_get.path, &len);
|
||||||
if (status) {
|
if (status) {
|
||||||
eprintf("nfs41_readlink() failed with %s\n",
|
eprintf("nfs41_readlink() for filename=%s failed with %s\n",
|
||||||
nfs_error_string(status));
|
state->file.path->path, nfs_error_string(status));
|
||||||
status = map_symlink_errors(status);
|
status = map_symlink_errors(status);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue