You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm going to close my own issue. I don't particularly like it, but it's not the fault of net-sftp.
The call to #mkdir! issues an SSH_FXP_MKDIR packet. Upon receipt of this the sftp-server (I checked OpenSSH source) performs a mkdir(2). The mode parameter to that system call is interpreted in the context of the sftp-server's umask (settable system wide with the -u flag to OpenSSH's sftp-server).
This is in contrast to userland command mkdir(1), which ignores umask (and which one uses directly more often than mkdir(2)...). Workaround: #setstat can set file permissions explicitly (analogous to chmod(2)) after directory creation.
I'm trying to use :permissions with #mkdir but the results
are affected by umask and I can't see a way to set that via the API.
Client:
(net/sftp, net/ssh installed by rubygems, ubuntu stock libnet-ssh-ruby
and libnet-sftp-ruby packages not installed)
Server:
Minimal test:
Results:
0560 as above, gives:
dr-xr----- 2 martin martin 4096 2011-05-05 06:07 /tmp/mydir
(0540)
0666 gives:
drw-r----- 2 martin martin 4096 2011-05-05 06:09 /tmp/mydir
(0640)
0777 gives:
drwxr-x--- 2 martin martin 4096 2011-05-05 06:10 /tmp/mydir
(0750)
The text was updated successfully, but these errors were encountered: