Accepting request 195373 from home:dirkmueller:branches:shells
- rediff ksh-qemu.patch OBS-URL: https://build.opensuse.org/request/show/195373 OBS-URL: https://build.opensuse.org/package/show/shells/ksh?expand=0&rev=159
This commit is contained in:
parent
da1792b8d5
commit
9edf6f54d6
@ -1,6 +1,6 @@
|
||||
--- src/lib/libast/features/lib
|
||||
+++ src/lib/libast/features/lib 2007-03-28 15:49:29.000000000 +0000
|
||||
@@ -92,27 +92,6 @@ tst lib_poll_fd_1 note{ fd is first arg
|
||||
+++ src/lib/libast/features/lib
|
||||
@@ -92,27 +92,6 @@
|
||||
}
|
||||
}end
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
exp _lib_poll _lib_poll_fd_1||_lib_poll_fd_2
|
||||
|
||||
tst lib_poll_notimer note{ poll with no fds ignores timeout }end execute{
|
||||
@@ -241,74 +220,6 @@ tst real_vfork note{ vfork child shares
|
||||
@@ -241,120 +220,6 @@
|
||||
}
|
||||
}end
|
||||
|
||||
@ -40,11 +40,11 @@
|
||||
- #include <signal.h>
|
||||
- #include <fcntl.h>
|
||||
- #include <string.h>
|
||||
- #undef fork
|
||||
- /* if it uses fork() why bother? */
|
||||
- pid_t fork _ARG_((void)) { return -1; }
|
||||
- pid_t _fork _ARG_((void)) { return -1; }
|
||||
- pid_t __fork _ARG_((void)) { return -1; }
|
||||
- #undef fork
|
||||
- pid_t fork _ARG_((void)) { NOTE("uses fork()"); return -1; }
|
||||
- pid_t _fork _ARG_((void)) { NOTE("uses _fork()"); return -1; }
|
||||
- pid_t __fork _ARG_((void)) { NOTE("uses __fork()"); return -1; }
|
||||
- int
|
||||
- main(argc, argv)
|
||||
- int argc;
|
||||
@ -61,40 +61,86 @@
|
||||
- _exit(signal(SIGHUP, SIG_DFL) != SIG_IGN);
|
||||
- signal(SIGHUP, SIG_IGN);
|
||||
- if (posix_spawnattr_init(&attr))
|
||||
- {
|
||||
- NOTE("posix_spawnattr_init() FAILED");
|
||||
- _exit(0);
|
||||
- }
|
||||
- if (posix_spawnattr_setpgroup(&attr, 0))
|
||||
- {
|
||||
- NOTE("posix_spawnattr_setpgroup() FAILED");
|
||||
- _exit(0);
|
||||
- }
|
||||
- if (posix_spawnattr_setflags(&attr, POSIX_SPAWN_SETPGROUP))
|
||||
- {
|
||||
- NOTE("posix_spawnattr_setflags() FAILED");
|
||||
- _exit(0);
|
||||
- }
|
||||
- /* first try an a.out and verify that SIGHUP is ignored */
|
||||
- cmd[0] = argv[0];
|
||||
- cmd[1] = "test";
|
||||
- cmd[2] = 0;
|
||||
- if (posix_spawn(&pid, cmd[0], 0, &attr, cmd, 0))
|
||||
- {
|
||||
- NOTE("posix_spawn() FAILED");
|
||||
- _exit(0);
|
||||
- }
|
||||
- status = 1;
|
||||
- if (wait(&status) < 0 || status != 0)
|
||||
- if (wait(&status) < 0)
|
||||
- {
|
||||
- NOTE("wait() FAILED");
|
||||
- _exit(0);
|
||||
- /* passing ENOEXEC to the shell is bogus */
|
||||
- }
|
||||
- if (status != 0)
|
||||
- {
|
||||
- NOTE("SIGHUP ignored in parent not ignored in child");
|
||||
- _exit(0);
|
||||
- }
|
||||
- /* must return exec-type errors or its useless to us *unless* there is no [v]fork() */
|
||||
- n = strlen(cmd[0]);
|
||||
- if (n >= (sizeof(tmp) - 3))
|
||||
- {
|
||||
- NOTE("test executable path too long");
|
||||
- _exit(0);
|
||||
- }
|
||||
- strcpy(tmp, cmd[0]);
|
||||
- tmp[n] = '.';
|
||||
- tmp[n+1] = 's';
|
||||
- tmp[n+2] = 'h';
|
||||
- tmp[n+3] = 0;
|
||||
- if (close(open(tmp, O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO)) < 0 || chmod(tmp, S_IRWXU|S_IRWXG|S_IRWXO) < 0)
|
||||
- if ((n = open(tmp, O_CREAT|O_WRONLY, S_IRWXU|S_IRWXG|S_IRWXO)) < 0 ||
|
||||
- chmod(tmp, S_IRWXU|S_IRWXG|S_IRWXO) < 0 ||
|
||||
- write(n, "exit 99\n", 8) != 8 ||
|
||||
- close(n) < 0)
|
||||
- {
|
||||
- NOTE("test script create FAILED");
|
||||
- _exit(0);
|
||||
- }
|
||||
- cmd[0] = tmp;
|
||||
- n = 0;
|
||||
- n = 0; /* 0 means reject */
|
||||
- pid = -1;
|
||||
- if (posix_spawn(&pid, cmd[0], 0, &attr, cmd, 0))
|
||||
- {
|
||||
- n = 2;
|
||||
- NOTE("ENOEXEC produces posix_spawn() error (BEST)");
|
||||
- }
|
||||
- else if (pid == -1)
|
||||
- NOTE("ENOEXEC returns pid == -1");
|
||||
- else if (wait(&status) != pid)
|
||||
- NOTE("ENOEXEC produces no child process");
|
||||
- else if (!WIFEXITED(status))
|
||||
- NOTE("ENOEXEC produces signal exit");
|
||||
- else
|
||||
- {
|
||||
- n = pid != -1 && waitpid(pid, &status, WNOHANG|WNOWAIT) == pid && ((status>>8)&0x7f) == 127;
|
||||
- wait(&status);
|
||||
- status = WEXITSTATUS(status);
|
||||
- if (status == 127)
|
||||
- {
|
||||
- n = 1;
|
||||
- NOTE("ENOEXEC produces exit status 127 (GOOD)");
|
||||
- }
|
||||
- else if (status == 99)
|
||||
- NOTE("ENOEXEC invokes sh");
|
||||
- else if (status == 0)
|
||||
- NOTE("ENOEXEC reports no error");
|
||||
- }
|
||||
- _exit(n);
|
||||
- }
|
||||
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 13 09:59:45 UTC 2013 - dmueller@suse.com
|
||||
|
||||
- rediff ksh-qemu.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 1 12:32:53 UTC 2013 - werner@suse.de
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user