#include <sys/types.h>
#include <sys/wait.h>
+#ifndef CLONE_NEWNS
+# define CLONE_NEWNS 0x00020000
+#endif
+
#define LIBNAME "rpm-fake.so"
#define PLATFORM_FILE "/etc/rpm/platform"
{
if (is_initialized) return;
+#ifdef VC_ENABLE_API_LEGACY
+ {
+ extern void vc_init_internal_legacy(int ctx_rev, int ctx_number,
+ int ipv4_rev, int ipv4_number);
+
+ vc_init_internal_legacy(getAndClearEnv("RPM_FAKE_S_CONTEXT_REV", 0),
+ getAndClearEnv("RPM_FAKE_S_CONTEXT_NR", 280),
+ 3, 281);
+ }
+#else
+ (void)getAndClearEnv("RPM_FAKE_S_CONTEXT_REV", 0);
+ (void)getAndClearEnv("RPM_FAKE_S_CONTEXT_NR", 280);
+#endif
INIT(RTLD_NEXT, execv);
//INIT(RTLD_NEXT, open);
if (mnts==0) return execvWorker(path, argv);
{
- char buf[512 + 2*strlen(mnts)];
- int status;
- pid_t p;
- struct ExecvParams params = {
- .path = path,
- .argv = argv,
- .mnts = mnts,
- };
+ char buf[512 + 2*strlen(mnts)];
+ int status;
+ pid_t p, pid;
+ struct ExecvParams params;
+
+ params.path = path;
+ params.argv = argv;
+ params.mnts = mnts;
// the rpmlib signal-handler is still active; use the default one to
// make wait4() working...
signal(SIGCHLD, SIG_DFL);
- pid_t pid = clone(removeNamespaceMountsChild, buf+sizeof(buf)/2,
- CLONE_NEWNS|SIGCHLD|CLONE_VFORK, ¶ms);
+ pid = clone(removeNamespaceMountsChild, buf+sizeof(buf)/2,
+ CLONE_NEWNS|SIGCHLD|CLONE_VFORK, ¶ms);
if (pid==-1) return -1;
while ((p=wait4(pid, &status, 0,0))==-1 &&