Subject: Re: sftp_mkdir() with server default permissions

Re: sftp_mkdir() with server default permissions

From: Daniel Stenberg <>
Date: Tue, 6 Nov 2018 19:23:02 +0100 (CET)

On Tue, 6 Nov 2018, Will Cosgrove wrote:

> There are several possible solutions, my current super simple solution is to
> pass -1 as the mode which then causes sftp_mkdir to not set the permissions
> on the folder. That works, but it’s a bit ‘magical’ if you’re not reading
> the source.

I could imagine a LIBSSH2_MKDIR_DEFAULT_MODE (name to be bike-shedded) define
to be provided for the API, which very well could have a value of -1 if we
treat the mode signed internally or it could be some otherwise insane (large)
value that is unlikely to every actually be used as a real mode.


Received on 2018-11-06