You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
2.0 KiB
53 lines
2.0 KiB
9 years ago
|
diff -u -r ../dpkg-1.18.2/src/archives.c ./src/archives.c
|
||
|
--- ../dpkg-1.18.2/src/archives.c 2015-07-13 09:53:37.000000000 -0400
|
||
|
+++ ./src/archives.c 2015-08-25 17:59:35.594992908 -0400
|
||
|
@@ -352,8 +352,10 @@
|
||
10 years ago
|
namenode->statoverride->uid,
|
||
|
namenode->statoverride->gid,
|
||
|
namenode->statoverride->mode);
|
||
|
+#ifndef __ANDROID__
|
||
|
if (fchown(fd, st->uid, st->gid))
|
||
9 years ago
|
ohshite(_("error setting ownership of '%.255s'"), te->name);
|
||
10 years ago
|
+#endif
|
||
|
if (fchmod(fd, st->mode & ~S_IFMT))
|
||
9 years ago
|
ohshite(_("error setting permissions of '%.255s'"), te->name);
|
||
10 years ago
|
|
||
9 years ago
|
@@ -465,11 +467,15 @@
|
||
10 years ago
|
return; /* Already handled using the file descriptor. */
|
||
|
|
||
|
if (te->type == TAR_FILETYPE_SYMLINK) {
|
||
|
+#ifndef __ANDROID__
|
||
|
if (lchown(path, st->uid, st->gid))
|
||
9 years ago
|
ohshite(_("error setting ownership of symlink '%.255s'"), path);
|
||
10 years ago
|
+#endif
|
||
|
} else {
|
||
|
+#ifndef __ANDROID__
|
||
|
if (chown(path, st->uid, st->gid))
|
||
9 years ago
|
ohshite(_("error setting ownership of '%.255s'"), path);
|
||
10 years ago
|
+#endif
|
||
|
if (chmod(path, st->mode & ~S_IFMT))
|
||
9 years ago
|
ohshite(_("error setting permissions of '%.255s'"), path);
|
||
10 years ago
|
}
|
||
9 years ago
|
@@ -1022,14 +1028,19 @@
|
||
10 years ago
|
varbuf_end_str(&symlinkfn);
|
||
|
if (symlink(symlinkfn.buf,fnametmpvb.buf))
|
||
9 years ago
|
ohshite(_("unable to make backup symlink for '%.255s'"), ti->name);
|
||
10 years ago
|
+#ifndef __ANDROID__
|
||
|
if (lchown(fnametmpvb.buf,stab.st_uid,stab.st_gid))
|
||
9 years ago
|
ohshite(_("unable to chown backup symlink for '%.255s'"), ti->name);
|
||
10 years ago
|
+#endif
|
||
|
tarobject_set_se_context(fnamevb.buf, fnametmpvb.buf, stab.st_mode);
|
||
|
} else {
|
||
|
debug(dbg_eachfiledetail, "tarobject nondirectory, 'link' backup");
|
||
9 years ago
|
+ /* Termux modification: Try with rename(2) for systems not supporting hardlinks. */
|
||
10 years ago
|
if (link(fnamevb.buf,fnametmpvb.buf))
|
||
9 years ago
|
- ohshite(_("unable to make backup link of '%.255s' before installing new version"),
|
||
10 years ago
|
- ti->name);
|
||
9 years ago
|
+ if (rename(fnamevb.buf,fnametmpvb.buf)) {
|
||
|
+ ohshite(_("unable to make backup link of '%.255s' before installing new version"),
|
||
|
+ ti->name);
|
||
|
+ }
|
||
10 years ago
|
}
|
||
|
}
|
||
|
|