summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch')
-rw-r--r--meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch19
1 files changed, 15 insertions, 4 deletions
diff --git a/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch b/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
index 93d870443c..b88be87490 100644
--- a/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
+++ b/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
@@ -10,15 +10,16 @@ Upstream-Status: Inappropriate [OE Specific]
10RP 2011/12/07 10RP 2011/12/07
11ALIMON 2016/05/26 11ALIMON 2016/05/26
12ALIMON 2017/02/21 12ALIMON 2017/02/21
13KKang 2019/02/20
13--- 14---
14 src/script.c | 44 +++----------------------------------------- 15 src/script.c | 44 +++-----------------------------------------
15 1 file changed, 3 insertions(+), 41 deletions(-) 16 1 file changed, 3 insertions(+), 41 deletions(-)
16 17
17diff --git a/src/script.c b/src/script.c 18diff --git a/src/script.c b/src/script.c
18index 2f252ae..768a9d1 100644 19index 0865b95..73ed35d 100644
19--- a/src/script.c 20--- a/src/script.c
20+++ b/src/script.c 21+++ b/src/script.c
21@@ -97,48 +97,10 @@ setexecute(const char *path, struct stat *stab) 22@@ -96,58 +96,11 @@ setexecute(const char *path, struct stat *stab)
22 static const char * 23 static const char *
23 maintscript_pre_exec(struct command *cmd) 24 maintscript_pre_exec(struct command *cmd)
24 { 25 {
@@ -32,6 +33,8 @@ index 2f252ae..768a9d1 100644
32- changedir = "/"; 33- changedir = "/";
33- 34-
34- if (instdirlen > 0 && !fc_script_chrootless) { 35- if (instdirlen > 0 && !fc_script_chrootless) {
36- int rc;
37-
35- if (strncmp(admindir, instdir, instdirlen) != 0) 38- if (strncmp(admindir, instdir, instdirlen) != 0)
36- ohshit(_("admindir must be inside instdir for dpkg to work properly")); 39- ohshit(_("admindir must be inside instdir for dpkg to work properly"));
37- if (setenv("DPKG_ADMINDIR", admindir + instdirlen, 1) < 0) 40- if (setenv("DPKG_ADMINDIR", admindir + instdirlen, 1) < 0)
@@ -39,7 +42,12 @@ index 2f252ae..768a9d1 100644
39- if (setenv("DPKG_ROOT", "", 1) < 0) 42- if (setenv("DPKG_ROOT", "", 1) < 0)
40- ohshite(_("unable to setenv for subprocesses")); 43- ohshite(_("unable to setenv for subprocesses"));
41- 44-
42- if (chroot(instdir)) 45- rc = chroot(instdir);
46- if (rc && fc_nonroot && errno == EPERM)
47- ohshit(_("not enough privileges to change root "
48- "directory with --force-not-root, consider "
49- "using --force-script-chrootless?"));
50- else if (rc)
43- ohshite(_("failed to chroot to '%.250s'"), instdir); 51- ohshite(_("failed to chroot to '%.250s'"), instdir);
44+ if (*instdir) { 52+ if (*instdir) {
45+ setenv("D", instdir, 1); 53+ setenv("D", instdir, 1);
@@ -64,7 +72,10 @@ index 2f252ae..768a9d1 100644
64- if (instdirlen == 0 || fc_script_chrootless) 72- if (instdirlen == 0 || fc_script_chrootless)
65- return cmd->filename; 73- return cmd->filename;
66- 74-
67- assert(strlen(cmd->filename) >= instdirlen); 75- if (strlen(cmd->filename) < instdirlen)
76- internerr("maintscript name '%s' length < instdir length %zd",
77- cmd->filename, instdirlen);
78
68- return cmd->filename + instdirlen; 79- return cmd->filename + instdirlen;
69+ return cmd->filename; 80+ return cmd->filename;
70 } 81 }