1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-11-03 04:17:18 -05:00

Do not execute group-/world-writeable playlist and metadata scripts.

git-svn-id: https://svn.xiph.org/trunk/ezstream@12712 0101bb08-14d6-0310-b084-bc0e0c8e3800
This commit is contained in:
moritz 2007-03-10 21:23:15 +00:00
parent 6eb5d8f557
commit 1d4426e834
3 changed files with 13 additions and 0 deletions

1
NEWS
View File

@ -7,6 +7,7 @@ Changes in 0.4.0, (SVN trunk):
* src/playlist.*:
- [FIX] An error compareable to the one about xfree() in src/util.* has
been fixed.
- [MISC] Refuse to execute a group- or world-writeable playlist script.
* src/compat.c:
- [ADD] Implement a basename() function for Windows that behaves like the

View File

@ -364,6 +364,12 @@ metadata_program(const char *program)
metadata_free(&md);
return (NULL);
}
if (st.st_mode & (S_IWGRP | S_IWOTH)) {
printf("%s: Error: %s is group and/or world writeable\n",
__progname, program);
metadata_free(&md);
return (NULL);
}
if (!(st.st_mode & (S_IEXEC | S_IXGRP | S_IXOTH))) {
printf("%s: %s: Not an executable program\n", __progname, program);
metadata_free(&md);

View File

@ -218,6 +218,12 @@ playlist_program(const char *filename)
playlist_free(&pl);
return (NULL);
}
if (st.st_mode & (S_IWGRP | S_IWOTH)) {
printf("%s: Error: %s is group and/or world writeable\n",
__progname, filename);
playlist_free(&pl);
return (NULL);
}
if (!(st.st_mode & (S_IEXEC | S_IXGRP | S_IXOTH))) {
printf("%s: %s: Not an executable program\n", __progname, filename);
playlist_free(&pl);