Skip to contentSkip to conversation

topology: fix output file unlinking

PATCH New Liam Girdwood 2 participants 3 messages Aug 11, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 topology: fix output file unlinking

Unlinking is unecessary as the old file will be overwritten with the new as intended.

---
 src/topology/parser.c | 3 ---
 1 file changed, 3 deletions(-)
src/topology/parser.c +0 -3
index ed25bb8..5544517 100644
@@ -266,9 +266,6 @@ int snd_tplg_build_file(snd_tplg_t *tplg, const char *infile,
 	snd_config_t *cfg = NULL;
 	int err = 0;
 
-	/* delete any old output files */
-	unlink(outfile);
-
 	tplg->out_fd =
 		open(outfile, O_RDWR | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO);
 	if (tplg->out_fd < 0) {
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 topology: fix file permissions for output file to 0600

File was incorrectly world rwx.

---
 src/topology/parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/topology/parser.c +1 -1
index 5544517..993f70d 100644
@@ -267,7 +267,7 @@ int snd_tplg_build_file(snd_tplg_t *tplg, const char *infile,
 	int err = 0;
 
 	tplg->out_fd =
-		open(outfile, O_RDWR | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO);
+		open(outfile, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
 	if (tplg->out_fd < 0) {
 		SNDERR("error: failed to open %s err %d\n",
 			outfile, -errno);
Signature · 1 line
2.1.4
#2 lore raw

Re: [PATCH] topology: fix file permissions for output file to 0600

Quoted 4 lines · Liam Girdwood

File was incorrectly world rwx.

Because of the problems I reported in the previous mail, I applied only the first patch (renaming OBJECT_TYPE_*) in v2 series, so far.

So, it's better to fold these two fixes into the last patch. Then submit v3 after fixing other reported issues.

thanks,

Takashi

Quoted 20 lines
---
 src/topology/parser.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/topology/parser.c +1 -1
index 5544517..993f70d 100644
@@ -267,7 +267,7 @@ int snd_tplg_build_file(snd_tplg_t *tplg, const char *infile,
 	int err = 0;
 
 	tplg->out_fd =
-		open(outfile, O_RDWR | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO);
+		open(outfile, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
 	if (tplg->out_fd < 0) {
 		SNDERR("error: failed to open %s err %d\n",
 			outfile, -errno);
Signature · 1 line
2.1.4