Commit 05658caf authored by topjohnwu's avatar topjohnwu

Fix typo causing sbin clone failure

parent ff3710de
...@@ -223,15 +223,15 @@ void SARCommon::patch_rootdir() { ...@@ -223,15 +223,15 @@ void SARCommon::patch_rootdir() {
xreadlinkat(src, entry->d_name, buf, sizeof(buf)); xreadlinkat(src, entry->d_name, buf, sizeof(buf));
xsymlinkat(buf, dest, entry->d_name); xsymlinkat(buf, dest, entry->d_name);
} else { } else {
char tpath[256]; char spath[256];
sprintf(buf, "/sbin/%s", entry->d_name); sprintf(buf, "/sbin/%s", entry->d_name);
sprintf(tpath, ROOTMIR "/sbin/%s", entry->d_name); sprintf(spath, ROOTMIR "/sbin/%s", entry->d_name);
// Create dummy // Create dummy
if (S_ISDIR(st.st_mode)) if (S_ISDIR(st.st_mode))
xmkdir(tpath, st.st_mode & 0777); xmkdir(buf, st.st_mode & 0777);
else else
close(xopen(tpath, O_CREAT | O_WRONLY | O_CLOEXEC, st.st_mode & 0777)); close(xopen(buf, O_CREAT | O_WRONLY | O_CLOEXEC, st.st_mode & 0777));
xmount(tpath, buf, nullptr, MS_BIND, nullptr); xmount(spath, buf, nullptr, MS_BIND, nullptr);
} }
} }
close(src); close(src);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment