The Samba-Bugzilla – Attachment 9786 Details for
Bug 10501
Setting modification time do not follow referral in case of DFS junction
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix the SMBC_utimes() issue for files on AD DFS referral
libsmbclient_set_utimes.diff (text/plain), 2.83 KB, created by
hargagan
on 2014-03-18 08:30:27 UTC
(
hide
)
Description:
Patch to fix the SMBC_utimes() issue for files on AD DFS referral
Filename:
MIME Type:
Creator:
hargagan
Created:
2014-03-18 08:30:27 UTC
Size:
2.83 KB
patch
obsolete
>diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c >index 8fb7a2e..1d2d4da 100644 >--- a/source3/libsmb/libsmb_file.c >+++ b/source3/libsmb/libsmb_file.c >@@ -631,6 +631,20 @@ SMBC_setatr(SMBCCTX * context, SMBCSRV *srv, char *path, > uint16_t fd; > int ret; > TALLOC_CTX *frame = talloc_stackframe(); >+ char *targetpath = NULL; >+ struct cli_state *targetcli = NULL; >+ >+ if (!cli_resolve_path(frame, "", context->internal->auth_info, >+ srv->cli, path, >+ &targetcli, &targetpath)) { >+ d_printf("Could not resolve %s\n", path); >+ errno = ENOENT; >+ if (targetcli == NULL) { >+ errno = EHOSTUNREACH; >+ } >+ TALLOC_FREE(frame); >+ return -1; >+ } > > /* > * First, try setpathinfo (if qpathinfo succeeded), for it is the >@@ -639,7 +653,7 @@ SMBC_setatr(SMBCCTX * context, SMBCSRV *srv, char *path, > * attributes manipulated. > */ > if (srv->no_pathinfo || >- !NT_STATUS_IS_OK(cli_setpathinfo_basic(srv->cli, path, >+ !NT_STATUS_IS_OK(cli_setpathinfo_basic(targetcli, targetpath, > create_time, > access_time, > write_time, >@@ -660,20 +674,20 @@ SMBC_setatr(SMBCCTX * context, SMBCSRV *srv, char *path, > srv->no_pathinfo = True; > > /* Open the file */ >- if (!NT_STATUS_IS_OK(cli_open(srv->cli, path, O_RDWR, DENY_NONE, &fd))) { >- errno = SMBC_errno(context, srv->cli); >+ if (!NT_STATUS_IS_OK(cli_open(targetcli, targetpath, O_RDWR, DENY_NONE, &fd))) { >+ errno = SMBC_errno(context, targetcli); > TALLOC_FREE(frame); > return -1; > } > > /* Set the new attributes */ >- ret = NT_STATUS_IS_OK(cli_setattrE(srv->cli, fd, >+ ret = NT_STATUS_IS_OK(cli_setattrE(targetcli, fd, > change_time, > access_time, > write_time)); > > /* Close the file */ >- cli_close(srv->cli, fd); >+ cli_close(targetcli, fd); > > /* > * Unfortunately, setattrE() doesn't have a provision for >@@ -682,11 +696,11 @@ SMBC_setatr(SMBCCTX * context, SMBCSRV *srv, char *path, > * seems to work on win98. > */ > if (ret && mode != (uint16) -1) { >- ret = NT_STATUS_IS_OK(cli_setatr(srv->cli, path, mode, 0)); >+ ret = NT_STATUS_IS_OK(cli_setatr(targetcli, targetpath, mode, 0)); > } > > if (! ret) { >- errno = SMBC_errno(context, srv->cli); >+ errno = SMBC_errno(context, targetcli); > TALLOC_FREE(frame); > return False; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 10501
: 9786