Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1:kernel-2.6.32
libssh
0001-Map-permission-field-to-type-field.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Map-permission-field-to-type-field.patch of Package libssh
From a07e57e2ed6d402d1f3d4b8449ee4f4ab2108ce7 Mon Sep 17 00:00:00 2001 From: Andreas Schneider <mail@cynapses.org> Date: Wed, 20 Aug 2008 18:37:33 +0200 Subject: [PATCH] Map permission field to type field. --- libssh/sftp.c | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) Index: libssh-0.2/libssh/sftp.c =================================================================== --- libssh-0.2.orig/libssh/sftp.c +++ libssh-0.2/libssh/sftp.c @@ -24,6 +24,8 @@ MA 02111-1307, USA. */ #include <stdlib.h> #include <string.h> +#include <sys/types.h> +#include <sys/stat.h> #include <fcntl.h> #include <netdb.h> #include "libssh/priv.h" @@ -580,6 +582,27 @@ SFTP_ATTRIBUTES *sftp_parse_attr_3(SFTP_ if(buffer_get_u32(buf,&attr->permissions)!=sizeof(u32)) break; attr->permissions=ntohl(attr->permissions); + + switch (attr->permissions & S_IFMT) { + case S_IFSOCK: + case S_IFBLK: + case S_IFCHR: + case S_IFIFO: + attr->type = SSH_FILEXFER_TYPE_SPECIAL; + break; + case S_IFLNK: + attr->type = SSH_FILEXFER_TYPE_SYMLINK; + break; + case S_IFREG: + attr->type = SSH_FILEXFER_TYPE_REGULAR; + break; + case S_IFDIR: + attr->type = SSH_FILEXFER_TYPE_DIRECTORY; + break; + default: + attr->type = SSH_FILEXFER_TYPE_UNKNOWN; + break; + } } if(flags & SSH_FILEXFER_ATTR_ACMODTIME){ if(buffer_get_u32(buf,&attr->atime)!=sizeof(u32))
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor