summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/ltp/ltp/0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch
blob: 350091a70c779c5a76901c364a400bec53d935ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 4b7db094d6fc5659001ae8dc17078bb65d46b9c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
Date: Fri, 13 May 2016 11:11:28 -0500
Subject: [PATCH] acl: Security fix on string printf
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes build error when compiled with -Werror=format-security:

acl1.c: In function ‘test_acl_default’:
acl1.c:305:2: error: format not a string literal and no format arguments [-Werror=format-security]
  305 |  printf(cmd);

Patch taken from openembedded-core,
original bug report: https://bugzilla.yoctoproject.org/9548

[YOCTO #9548]

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Upstream-Status: accepted in 4b7db094d6fc5659001ae8dc17078bb65d46b9c9
---
 testcases/network/nfsv4/acl/acl1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/network/nfsv4/acl/acl1.c b/testcases/network/nfsv4/acl/acl1.c
index aae9484e5..ad778cd33 100644
--- a/testcases/network/nfsv4/acl/acl1.c
+++ b/testcases/network/nfsv4/acl/acl1.c
@@ -302,7 +302,7 @@ void test_acl_default(char *dir, acl_t acl)
 	char *cmd = malloc(256);
 
 	strcpy(cmd, "chmod 7777 ");
-	printf(cmd);
+	printf(cmd, NULL);
 	strcat(cmd, dir);
 	system(cmd);
 	acl2 = acl_get_file(path, ACL_TYPE_ACCESS);
-- 
2.25.1