|
From: Jiri J. <jja...@re...> - 2014-09-23 09:44:53
|
Signed-off-by: Jiri Jaburek <jja...@re...>
---
audit-test/utils/bin/ipc_common.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/audit-test/utils/bin/ipc_common.c b/audit-test/utils/bin/ipc_common.c
index 02f4977..32db2ae 100644
--- a/audit-test/utils/bin/ipc_common.c
+++ b/audit-test/utils/bin/ipc_common.c
@@ -61,6 +61,12 @@ int translate_ipc_flags(char *string, int *flags)
if (!strcmp(string, "create"))
/* use IPC_EXCL on create to catch cleanup problems */
*flags |= IPC_CREAT|IPC_EXCL|S_IRUSR|S_IWUSR;
+ else if (!strncmp(string, "create:", strlen("create:"))) {
+ /* create with custom mode */
+ *flags |= IPC_CREAT|IPC_EXCL;
+ *flags &= ~((int)0x01ff); /* reset 9 lsbits */
+ *flags |= strtol(string+strlen("create:"), NULL, 8);
+ }
else if (!strcmp(string, "read"))
*flags |= S_IRUSR;
else if (!strcmp(string, "write"))
--
1.8.3.1
|