Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 576577 Details for
Bug 811363
lua rpm scripts do not properly restore path after running
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
fix chroot handling for lua scripts
rpm-4.8.0-lua-chroot.patch (text/plain), 1.72 KB, created by
Chris Seawood
on 2012-04-10 19:53:07 UTC
(
hide
)
Description:
fix chroot handling for lua scripts
Filename:
MIME Type:
Creator:
Chris Seawood
Created:
2012-04-10 19:53:07 UTC
Size:
1.72 KB
patch
obsolete
>diff -up rpm-4.8.0/lib/psm.c.cls rpm-4.8.0/lib/psm.c >--- rpm-4.8.0/lib/psm.c.cls 2012-04-10 12:08:01.598236003 -0700 >+++ rpm-4.8.0/lib/psm.c 2012-04-10 12:27:01.544672045 -0700 >@@ -454,7 +454,6 @@ static rpmRC runLuaScript(rpmpsm psm, He > const rpmts ts = psm->ts; > #ifdef WITH_LUA > char *sname = NULL; >- int rootFd = -1; > int xx; > rpmlua lua = NULL; /* Global state. */ > rpmluav var; >@@ -466,13 +465,13 @@ static rpmRC runLuaScript(rpmpsm psm, He > psm->stepName, sname); > if (!rpmtsChrootDone(ts)) { > const char *rootDir = rpmtsRootDir(ts); >- xx = chdir("/"); >- rootFd = open(".", O_RDONLY, 0); >- if (rootFd >= 0) { >- if (rootDir != NULL && !rstreq(rootDir, "/") && *rootDir == '/') >- xx = chroot(rootDir); >- xx = rpmtsSetChrootDone(ts, 1); >- } >+ if (rootDir != NULL && !rstreq(rootDir, "/") && >+ !(rootDir[0] == '/' && rootDir[1] == '\0')) >+ { >+ xx = chroot(rootDir); >+ } >+ xx = chdir("/"); >+ xx = rpmtsSetChrootDone(ts, 1); > } > > /* Create arg variable */ >@@ -510,12 +509,16 @@ static rpmRC runLuaScript(rpmpsm psm, He > > rpmluaDelVar(lua, "arg"); > >- if (rootFd >= 0) { >+ if (rpmtsChrootDone(ts)) { > const char *rootDir = rpmtsRootDir(ts); >- xx = fchdir(rootFd); >- xx = close(rootFd); >- if (rootDir != NULL && !rstreq(rootDir, "/") && *rootDir == '/') >- xx = chroot("."); >+ const char *currDir = rpmtsCurrDir(ts); >+ if (rootDir != NULL && !rstreq(rootDir, "/") && >+ !(rootDir[0] == '/' && rootDir[1] == '\0')) >+ { >+ xx = chroot("."); >+ } >+ if (currDir != NULL) /* XXX can't happen */ >+ xx = chdir(currDir); > xx = rpmtsSetChrootDone(ts, 0); > } > free(sname);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 811363
:
576575
|
576576
|
576577
|
577219