Skip to contentSkip to conversation

Permissions of alsatplg -o output are hardcoded to S_IRUSR | S_IWUSR (600)

DISCUSSION GitHub issues - opened 1 participant 1 message Dec 11, 2021 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

alsa-project/alsa-utils issue #126 was opened from marc-hb:

Quoted 1 line

From https://github.com/alsa-project/alsa-utils/blob/c8c348e28a258f17e3/topology/topology.c#L172

```C
static int save(const char *output_file, void *buf, size_t size)
{

               fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);

```

When using alsatplg in a build system (e.g.: https://github.com/thesofproject/sof/blob/3e1c160e5053eae/tools/topology/topology1/CMakeLists.txt#L243), all other artefacts follow the process's umask **except** alsatplg output. This causes subtle and time-consuming errors when trying to share artefacts across different processes.

git blame finds:

commit cbabe7a3f0cc84ecd352d4cbf85148946fa6c0d5

Author: Jaroslav Kysela <[email protected]>
Date:   Thu Dec 19 15:36:05 2019 +0100

alsatplg: rewrite to use the new libatopology functions

Before cbabe7a3f0, opening the output file was delegated to library function snd_tplg_build_file(). Not sure what permissions were used then.

Workaround:

```shell
alsatplg -c intput.conf -o - > output.tplg
```

Issue URL : https://github.com/alsa-project/alsa-utils/issues/126
Repository URL: https://github.com/alsa-project/alsa-utils