[FFmpeg-devel] Patch: libssh on Windows

Nicolas George george at nsup.org
Sat Dec 28 16:05:48 CET 2013


L'octidi 8 nivôse, an CCXXII, Lukasz M a écrit :
> I know what you mean, but libssh.c code use these perms to define
> permissions of newly created file on remote host (local also is possible
> when you use localhost as host address), and remote host can be non Windows.

The documentation for sftp_open states that the mode argument is "POSIX
file permissions". Using the windows-specific values instead would be wrong,
even for the owner ones.

(I am not sure that POSIX actually defines the values, but the draft RFC for
the SFTP protocol does.)

> Other options would be to define S_IRGRP, S_IWGRP, S_IROTH to non-zero
> inside libssh,c only, or just use hardcoded value as sftp_open param.
> Last one may seem to be ugly, but almost sure I saw such a thing inside
> ffmpeg.

Since the values are mandated by the protocol, writing 0666 directly in the
source code would IMHO be fine.

Another solution would be to use LIBSSH2_SFTP_S_IRUSR defined in
libssh2_sftp.h.

As a side note, I believe the mode currently used in lavf is wrong: it is
"-rw-rw-r--": if it is not masked by the umask setting, then it will lead to
publicly writable files on systems that do not have one group per user; and
if it is, it should be "-rw-rw-rw-" to let the user completely control it
with umask. I need to test which one it is.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20131228/5c30ee07/attachment.asc>


More information about the ffmpeg-devel mailing list