mirror of
https://github.com/mpv-player/mpv
synced 2025-03-19 18:05:21 +00:00
input: avoid creating world-writeable file with --input-unix-socket
This requires fchmod(), which is not necessarily available everywhere. It also might not work at all. (It does work on Linux.)
This commit is contained in:
parent
0035dbdbb8
commit
a22de99544
@ -725,6 +725,10 @@ static void *ipc_thread(void *p)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HAVE_FCHMOD
|
||||||
|
fchmod(ipc_fd, 0600);
|
||||||
|
#endif
|
||||||
|
|
||||||
size_t path_len = strlen(arg->path);
|
size_t path_len = strlen(arg->path);
|
||||||
if (path_len >= sizeof(ipc_un.sun_path) - 1) {
|
if (path_len >= sizeof(ipc_un.sun_path) - 1) {
|
||||||
MP_ERR(arg, "Could not create IPC socket\n");
|
MP_ERR(arg, "Could not create IPC socket\n");
|
||||||
|
@ -972,6 +972,7 @@ cat > $TMPC << EOF
|
|||||||
#define HAVE_BSD_THREAD_NAME 0
|
#define HAVE_BSD_THREAD_NAME 0
|
||||||
#define HAVE_NETBSD_THREAD_NAME 0
|
#define HAVE_NETBSD_THREAD_NAME 0
|
||||||
#define HAVE_DXVA2_HWACCEL 0
|
#define HAVE_DXVA2_HWACCEL 0
|
||||||
|
#define HAVE_FCHMOD 0
|
||||||
|
|
||||||
#define DEFAULT_CDROM_DEVICE "/dev/cdrom"
|
#define DEFAULT_CDROM_DEVICE "/dev/cdrom"
|
||||||
#define DEFAULT_DVD_DEVICE "/dev/dvd"
|
#define DEFAULT_DVD_DEVICE "/dev/dvd"
|
||||||
|
4
wscript
4
wscript
@ -218,6 +218,10 @@ iconv support use --disable-iconv.",
|
|||||||
'deps_neg': [ 'glob' ],
|
'deps_neg': [ 'glob' ],
|
||||||
'deps_any': [ 'os-win32', 'os-cygwin' ],
|
'deps_any': [ 'os-win32', 'os-cygwin' ],
|
||||||
'func': check_true
|
'func': check_true
|
||||||
|
}, {
|
||||||
|
'name': 'fchmod',
|
||||||
|
'desc': 'fchmod()',
|
||||||
|
'func': check_statement('sys/stat.h', 'fchmod(0, 0)'),
|
||||||
}, {
|
}, {
|
||||||
'name': 'glibc-thread-name',
|
'name': 'glibc-thread-name',
|
||||||
'desc': 'GLIBC API for setting thread name',
|
'desc': 'GLIBC API for setting thread name',
|
||||||
|
Loading…
Reference in New Issue
Block a user