Bugzilla – Attachment 166 Details for
Bug 426
sftp adds write permission when doing get -p
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Change for sftp to preserve permissions
5 (text/plain), 1.54 KB, created by
gfernandez
on 2002-11-07 00:59:13 AEDT
(
hide
)
Description:
Change for sftp to preserve permissions
Filename:
MIME Type:
Creator:
gfernandez
Created:
2002-11-07 00:59:13 AEDT
Size:
1.54 KB
patch
obsolete
>diff -u ../openssh-3.4p1/sftp-client.c . >--- ../openssh-3.4p1/sftp-client.c Sun Jun 23 17:27:19 2002 >+++ ./sftp-client.c Tue Nov 5 10:42:49 2002 >@@ -746,7 +796,7 @@ > int local_fd, status, num_req, max_req, write_error; > int read_error, write_errno; > u_int64_t offset, size; >- u_int handle_len, mode, type, id, buflen; >+ u_int handle_len, mode, type, id, buflen, savemode; > struct request { > u_int id; > u_int len; >@@ -763,11 +813,14 @@ > return(-1); > > /* XXX: should we preserve set[ug]id? */ >- if (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) >+ if (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) { > mode = S_IWRITE | (a->perm & 0777); >- else >+ savemode = (a->perm & 0777); >+ } >+ else { > mode = 0666; >- >+ savemode = 0666; >+ } > if ((a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) && > (a->perm & S_IFDIR)) { > error("Cannot download a directory: %s", remote_path); >@@ -931,9 +984,9 @@ > > /* Override umask and utimes if asked */ > #ifdef HAVE_FCHMOD >- if (pflag && fchmod(local_fd, mode) == -1) >+ if (pflag && fchmod(local_fd, savemode) == -1) > #else >- if (pflag && chmod(local_path, mode) == -1) >+ if (pflag && chmod(local_path, savemode) == -1) > #endif /* HAVE_FCHMOD */ > error("Couldn't set mode on \"%s\": %s", local_path, > strerror(errno));
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 426
:
165
|
166
|
190