[FFmpeg-devel] [PATCH 1/2] lavf/libssh: fix file mode

Nicolas George george at nsup.org
Sat Dec 28 19:41:47 CET 2013


L'octidi 8 nivôse, an CCXXII, Lukasz Marek a écrit :
> Signed-off-by: Lukasz Marek <lukasz.m.luki at gmail.com>
> ---
>  libavformat/libssh.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/libssh.c b/libavformat/libssh.c
> index 4a9b867..611fc24 100644
> --- a/libavformat/libssh.c
> +++ b/libavformat/libssh.c
> @@ -121,7 +121,7 @@ static int libssh_open(URLContext *h, const char *url, int flags)
>          access = O_RDONLY;
>      }
>  
> -    if (!(s->file = sftp_open(s->sftp, path, access, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH))) {
> +    if (!(s->file = sftp_open(s->sftp, path, access, 0666))) {
>          av_log(h, AV_LOG_ERROR, "Error opening sftp file: %s\n", ssh_get_error(s->session));
>          ret = AVERROR(EIO);
>          goto fail;

It looks right, after the recent discussion, assuming you checked it is
indeed affected by the umask setting.

Maybe add a comment to explain that 0666 is not invoking the Beast, and that
the file will not be world-writeable due to umask:

+    /* 0666 = -rw-rw-rw- = read+write for everyone, minus umask */

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/c36b4ee9/attachment.asc>


More information about the ffmpeg-devel mailing list