summaryrefslogtreecommitdiff
path: root/tests/fchmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/fchmod.c')
-rw-r--r--tests/fchmod.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/tests/fchmod.c b/tests/fchmod.c
index 4da4f0658..0b0570cfe 100644
--- a/tests/fchmod.c
+++ b/tests/fchmod.c
@@ -18,6 +18,8 @@
# include <stdio.h>
# include <unistd.h>
+# include "secontext.h"
+
int
main(void)
{
@@ -27,6 +29,8 @@ main(void)
*/
create_and_enter_subdir("fchmod_subdir");
+ char *my_secontext = SECONTEXT_PID_MY();
+
static const char sample[] = "fchmod_sample_file";
(void) unlink(sample);
int fd = open(sample, O_CREAT|O_RDONLY, 0400);
@@ -37,16 +41,19 @@ main(void)
char *sample_realpath = get_fd_path(fd);
# endif
+ const char *sample_secontext = SECONTEXT_FILE(sample);
long rc = syscall(__NR_fchmod, fd, 0600);
# ifdef YFLAG
- printf("fchmod(%d<%s>, 0600) = %s\n",
+ printf("%s%s(%d<%s>%s, 0600) = %s\n",
# else
- printf("fchmod(%d, 0600) = %s\n",
+ printf("%s%s(%d%s, 0600) = %s\n",
# endif
+ my_secontext, "fchmod",
fd,
# ifdef YFLAG
sample_realpath,
# endif
+ sample_secontext,
sprintrc(rc));
if (unlink(sample))
@@ -54,26 +61,30 @@ main(void)
rc = syscall(__NR_fchmod, fd, 051);
# ifdef YFLAG
- printf("fchmod(%d<%s (deleted)>, 051) = %s\n",
+ printf("%s%s(%d<%s (deleted)>%s, 051) = %s\n",
# else
- printf("fchmod(%d, 051) = %s\n",
+ printf("%s%s(%d%s, 051) = %s\n",
# endif
+ my_secontext, "fchmod",
fd,
# ifdef YFLAG
sample_realpath,
# endif
+ sample_secontext,
sprintrc(rc));
rc = syscall(__NR_fchmod, fd, 004);
# ifdef YFLAG
- printf("fchmod(%d<%s (deleted)>, 004) = %s\n",
+ printf("%s%s(%d<%s (deleted)>%s, 004) = %s\n",
# else
- printf("fchmod(%d, 004) = %s\n",
+ printf("%s%s(%d%s, 004) = %s\n",
# endif
+ my_secontext, "fchmod",
fd,
# ifdef YFLAG
sample_realpath,
# endif
+ sample_secontext,
sprintrc(rc));
leave_and_remove_subdir();