topology: fix the file permissions for the generated files

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>
This commit is contained in:
Jaroslav Kysela 2021-12-12 19:57:38 +01:00
parent c8c348e28a
commit 8e71fba810

View 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));