]> git.alsa-project.org Git - alsa-utils.git/commitdiff
topology: fix the file permissions for the generated files
authorJaroslav Kysela <perex@perex.cz>
Sun, 12 Dec 2021 18:57:38 +0000 (19:57 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 12 Dec 2021 18:58:54 +0000 (19:58 +0100)
The owner r/w file permissions are too restrictive.
Let umask do it's work and set the r/w permissions to any.

Fixes: https://github.com/alsa-project/alsa-utils/issues/126
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
topology/topology.c

index 962e2e870e378985faf6da5674dc0fd1c9be7bc8..e172dd6e224b5ba0b5aed087aca090dccbd29029 100644 (file)
@@ -169,7 +169,7 @@ static int save(const char *output_file, void *buf, size_t size)
                fname = alloca(strlen(output_file) + 5);
                strcpy(fname, output_file);
                strcat(fname, ".new");
-               fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
+               fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
                if (fd < 0) {
                        fprintf(stderr, _("Unable to open output file '%s': %s\n"),
                                fname, strerror(-errno));