Comments (1)
Hm… we’ve had to deal with this before, with windows, plan9 and js/wasm. https://github.com/pkg/sftp/blob/master/syscall_fixed.go#L4-L6
I’m afraid that “convert the stat packet response to the standardized fs.FileInfo” won’t be as easy as it is said. Considering various other syscall values are going to break just as much in the conversion: https://github.com/pkg/sftp/blob/master/stat_posix.go#L56-L71
Unfortunately, it looks like simply adding zos
to the list of build tags for syscall_fixed.god
won’t be enough, since while that will get us the “right” S_IFMT
, the other syscall.S_IF*
parameters are going to still be different.
It might just be necessary to implement a new stat_zos.go
file and build-tag exclude zos from stat_posix.go
. A lot of code might be copied, but it will allow you more control over ensuring that you’re using the proper “linux” format values (probably more so these are the openbsd values, which just happened to be the same as linux when openssh was released). It looks like they eventually realized just how incompatible type values of the permissions could be, later defining a whole new field to hold that type information in a formalized, codified, and consistent way.
😩 Unfortunately, this is some of the most painstaking work in the repo, ensuring compliance for all the various operating systems shoving values through the I-Assumed-The-POSIX-Standards-Set-Specific-Values-For-This standardized-by-implementation fields.
We’ll kind of need to audit all the syscall use for the large number of OS-dependent files (fortunately, we can ignore windows and plan9 specific stuff at least)… or maybe we accelerate our integration of https://github.com/pkg/sftp/blob/master/internal/encoding/ssh/filexfer/permissions.go which just blanket defines all the OpenBSD filemode values for the wire, and ignore whatever is in the syscall package.
P.S.: Also, thanks so much for looking into what’s wrong here. Narrowing it down the S_IFMT
gave me enough lead to know exactly where things have gone wrong, considering we’ve had to address this stuff for plan9 as well.
from sftp.
Related Issues (20)
- Question about getwd() method HOT 1
- IETF Link has rotted HOT 2
- Support for the Afero interface HOT 5
- mandatory workDir even for absolute paths HOT 1
- Unable to delete the selected user: Not Found HOT 3
- Change current working directory? HOT 2
- proposal/exposeRemoveFile HOT 2
- Request attributes are not being propagated for SSH_FXP_OPEN operation HOT 5
- Should Seek() io.SeekStart and io.SeekCurrent do the different things? HOT 1
- sftp client hang when exit in sftp server example HOT 2
- Connection lost when using library with limited bandwidth HOT 5
- In Windows, `Server` should allow a pseudo-directory for `/` which enumerates available drives HOT 22
- How can I perform sftp download and upload feature for multiple files at root directory and within nested subfolder using https://github.com/pkg/sftp HOT 3
- close file double time sometimes cause copy problem wh HOT 10
- how to handle binary and ascii file transfer to and from sftp server? HOT 1
- The performance of transferring file is bad HOT 1
- getting error while creating a client in a multithreaded usecase "Failed to create SFTP client: error receiving version packet from server: server unexpectedly closed connection: unexpected EOF" HOT 8
- Does this package Support z/OS (s390x) or not? HOT 2
- Performance is much slower than a Java implementation when running in z/OS HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sftp.