aboutsummaryrefslogtreecommitdiff
path: root/stdlib/tst-system.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/tst-system.c')
-rw-r--r--stdlib/tst-system.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/stdlib/tst-system.c b/stdlib/tst-system.c
index 95a2615..178808e 100644
--- a/stdlib/tst-system.c
+++ b/stdlib/tst-system.c
@@ -26,6 +26,7 @@
#include <support/check.h>
#include <support/temp_file.h>
#include <support/support.h>
+#include <support/xunistd.h>
static char *tmpdir;
static long int namemax;
@@ -138,6 +139,22 @@ do_test (void)
support_capture_subprocess_check (&result, "system", 0, sc_allow_none);
}
+ {
+ struct stat64 st;
+ xstat (_PATH_BSHELL, &st);
+ mode_t mode = st.st_mode;
+ xchmod (_PATH_BSHELL, mode & ~(S_IXUSR | S_IXGRP | S_IXOTH));
+
+ struct support_capture_subprocess result;
+ result = support_capture_subprocess (call_system,
+ &(struct args) {
+ "exit 1", 127, 0
+ });
+ support_capture_subprocess_check (&result, "system", 0, sc_allow_none);
+
+ xchmod (_PATH_BSHELL, st.st_mode);
+ }
+
TEST_COMPARE (system (""), 0);
return 0;