aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2010-02-24 00:25:38 +0100
committerAndreas Schneider <mail@cynapses.org>2010-02-24 00:26:51 +0100
commitf857d4aff78fb79a532fe0b4f726d689d83a7917 (patch)
tree8ff672c81480bd33cc2a0485c4976343a7c2ffce
parent39d6ef884a6b66e8fb1773fe01e361703224ab73 (diff)
downloadlibssh-f857d4aff78fb79a532fe0b4f726d689d83a7917.tar.gz
libssh-f857d4aff78fb79a532fe0b4f726d689d83a7917.tar.xz
libssh-f857d4aff78fb79a532fe0b4f726d689d83a7917.zip
Fixed longname parsing, this only workings with readdir.
-rw-r--r--libssh/sftp.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/libssh/sftp.c b/libssh/sftp.c
index 4f2f4eb3..f737958e 100644
--- a/libssh/sftp.c
+++ b/libssh/sftp.c
@@ -1196,6 +1196,19 @@ static sftp_attributes sftp_parse_attr_3(sftp_session sftp, ssh_buffer buf,
break;
}
string_free(longname);
+
+ /* Set owner and group if we talk to openssh and have the longname */
+ if (ssh_get_openssh_version(sftp->session)) {
+ attr->owner = sftp_parse_longname(attr->longname, SFTP_LONGNAME_OWNER);
+ if (attr->owner == NULL) {
+ break;
+ }
+
+ attr->group = sftp_parse_longname(attr->longname, SFTP_LONGNAME_GROUP);
+ if (attr->group == NULL) {
+ break;
+ }
+ }
}
if (buffer_get_u32(buf, &flags) != sizeof(uint32_t)) {
@@ -1225,18 +1238,6 @@ static sftp_attributes sftp_parse_attr_3(sftp_session sftp, ssh_buffer buf,
}
attr->uid = ntohl(attr->uid);
attr->gid = ntohl(attr->gid);
-
- if (ssh_get_openssh_version(sftp->session)) {
- attr->owner = sftp_parse_longname(attr->longname, SFTP_LONGNAME_OWNER);
- if (attr->owner == NULL) {
- break;
- }
-
- attr->group = sftp_parse_longname(attr->longname, SFTP_LONGNAME_GROUP);
- if (attr->group == NULL) {
- break;
- }
- }
}
if (flags & SSH_FILEXFER_ATTR_PERMISSIONS) {