|
@@ -55,8 +55,7 @@ static inline int init_tty_handle (struct shim_handle * hdl, bool write)
|
|
/* XXX: Try getting the root FS from current thread? */
|
|
/* XXX: Try getting the root FS from current thread? */
|
|
assert(cur_thread);
|
|
assert(cur_thread);
|
|
assert(cur_thread->root);
|
|
assert(cur_thread->root);
|
|
- if ((ret = path_lookupat(cur_thread->root, "/dev/tty", LOOKUP_OPEN, &dent,
|
|
|
|
- cur_thread->root->fs)) < 0)
|
|
|
|
|
|
+ if ((ret = path_lookupat(NULL, "/dev/tty", LOOKUP_OPEN, &dent, NULL)) < 0)
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
int flags = (write ? O_WRONLY : O_RDONLY)|O_APPEND;
|
|
int flags = (write ? O_WRONLY : O_RDONLY)|O_APPEND;
|
|
@@ -95,8 +94,15 @@ static inline int init_exec_handle (struct shim_thread * thread)
|
|
|
|
|
|
struct shim_mount * fs = find_mount_from_uri(PAL_CB(executable));
|
|
struct shim_mount * fs = find_mount_from_uri(PAL_CB(executable));
|
|
if (fs) {
|
|
if (fs) {
|
|
- path_lookupat(fs->root, PAL_CB(executable) + fs->uri.len, 0,
|
|
|
|
- &exec->dentry, fs);
|
|
|
|
|
|
+ const char * p = PAL_CB(executable) + fs->uri.len;
|
|
|
|
+ /*
|
|
|
|
+ * Lookup for PAL_CB(executable) needs to be done under a given
|
|
|
|
+ * mount point. which requires a relative path name.
|
|
|
|
+ * On the other hand, the one in manifest file can be absolute path.
|
|
|
|
+ */
|
|
|
|
+ while (*p == '/')
|
|
|
|
+ p++;
|
|
|
|
+ path_lookupat(fs->root, p, 0, &exec->dentry, fs);
|
|
set_handle_fs(exec, fs);
|
|
set_handle_fs(exec, fs);
|
|
if (exec->dentry) {
|
|
if (exec->dentry) {
|
|
size_t len;
|
|
size_t len;
|