Skip to content

Instantly share code, notes, and snippets.

@uyjulian
Created July 7, 2020 06:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uyjulian/8ba18d466f400750bdc67086e57f43e1 to your computer and use it in GitHub Desktop.
Save uyjulian/8ba18d466f400750bdc67086e57f43e1 to your computer and use it in GitHub Desktop.
diff -burN libarchive-3.4.3.orig/configure.ac libarchive-3.4.3/configure.ac
--- libarchive-3.4.3.orig/configure.ac 2020-05-19 20:09:29.000000000 -0500
+++ libarchive-3.4.3/configure.ac 2020-07-07 01:02:44.173341266 -0500
@@ -284,7 +284,7 @@
[AC_DEFINE_UNQUOTED([HAVE_WORKING_FS_IOC_GETFLAGS], [1],
[Define to 1 if you have a working FS_IOC_GETFLAGS])])
-AC_CHECK_HEADERS([locale.h membership.h paths.h poll.h pthread.h pwd.h])
+AC_CHECK_HEADERS([locale.h membership.h paths.h poll.h pwd.h])
AC_CHECK_HEADERS([readpassphrase.h signal.h spawn.h])
AC_CHECK_HEADERS([stdarg.h stdint.h stdlib.h string.h])
AC_CHECK_HEADERS([sys/acl.h sys/cdefs.h sys/ea.h sys/extattr.h])
@@ -615,7 +615,6 @@
AC_HEADER_MAJOR
AC_FUNC_FSEEKO
AC_FUNC_MEMCMP
-AC_FUNC_LSTAT
AC_FUNC_STAT
AC_FUNC_STRERROR_R
AC_FUNC_STRFTIME
@@ -631,7 +630,7 @@
AC_CHECK_FUNCS([futimens futimes futimesat])
AC_CHECK_FUNCS([geteuid getpid getgrgid_r getgrnam_r])
AC_CHECK_FUNCS([getpwnam_r getpwuid_r getvfsbyname gmtime_r])
-AC_CHECK_FUNCS([lchflags lchmod lchown link localtime_r lstat lutimes])
+AC_CHECK_FUNCS([lchflags lchmod lchown link localtime_r lutimes])
AC_CHECK_FUNCS([mbrtowc memmove memset])
AC_CHECK_FUNCS([mkdir mkfifo mknod mkstemp])
AC_CHECK_FUNCS([nl_langinfo openat pipe poll posix_spawnp readlink readlinkat])
@@ -662,19 +661,19 @@
# There are several variants of readdir_r around; we only
# accept the POSIX-compliant version.
-AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[#include <dirent.h>]],
- [[DIR *dir; struct dirent e, *r;
- return(readdir_r(dir, &e, &r));]])],
- [AC_DEFINE(HAVE_READDIR_R,1,[Define to 1 if you have a POSIX compatible readdir_r])]
-)
+# AC_COMPILE_IFELSE(
+# [AC_LANG_PROGRAM([[#include <dirent.h>]],
+# [[DIR *dir; struct dirent e, *r;
+# return(readdir_r(dir, &e, &r));]])],
+# [AC_DEFINE(HAVE_READDIR_R,1,[Define to 1 if you have a POSIX compatible readdir_r])]
+# )
# dirfd can be either a function or a macro.
-AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[#include <dirent.h>
- DIR *dir;]],
- [[return(dirfd(dir));]])],
- [AC_DEFINE(HAVE_DIRFD,1,[Define to 1 if you have a dirfd function or macro])]
-)
+# AC_COMPILE_IFELSE(
+# [AC_LANG_PROGRAM([[#include <dirent.h>
+# DIR *dir;]],
+# [[return(dirfd(dir));]])],
+# [AC_DEFINE(HAVE_DIRFD,1,[Define to 1 if you have a dirfd function or macro])]
+# )
# FreeBSD's nl_langinfo supports an option to specify whether the
# current locale uses month/day or day/month ordering. It makes the
diff -burN libarchive-3.4.3.orig/libarchive/archive_ppmd7.c libarchive-3.4.3/libarchive/archive_ppmd7.c
--- libarchive-3.4.3.orig/libarchive/archive_ppmd7.c 2020-01-16 15:05:41.000000000 -0600
+++ libarchive-3.4.3/libarchive/archive_ppmd7.c 2020-07-07 00:50:16.911601502 -0500
@@ -4,7 +4,7 @@
#include "archive_platform.h"
-#include <memory.h>
+#include <stdlib.h>
#include "archive_ppmd7_private.h"
diff -burN libarchive-3.4.3.orig/libarchive/archive_read_disk_posix.c libarchive-3.4.3/libarchive/archive_read_disk_posix.c
--- libarchive-3.4.3.orig/libarchive/archive_read_disk_posix.c 2020-04-29 20:45:35.000000000 -0500
+++ libarchive-3.4.3/libarchive/archive_read_disk_posix.c 2020-07-07 01:15:14.968790214 -0500
@@ -92,6 +92,7 @@
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
+#include <sys/unistd.h>
#include "archive.h"
#include "archive_string.h"
@@ -99,9 +100,6 @@
#include "archive_private.h"
#include "archive_read_disk_private.h"
-#ifndef HAVE_FCHDIR
-#error fchdir function required.
-#endif
#ifndef O_BINARY
#define O_BINARY 0
#endif
@@ -2309,7 +2307,10 @@
* descent.
*/
if (t->depth > 0 && (t->flags & onWorkingDir) == 0) {
+ // XXX: figure out a replacement for this!
+#if 0
r = fchdir(t->working_dir_fd);
+#endif
if (r == 0) {
t->flags &= ~onInitialDir;
t->flags |= onWorkingDir;
diff -burN libarchive-3.4.3.orig/libarchive/archive_write_disk_posix.c libarchive-3.4.3/libarchive/archive_write_disk_posix.c
--- libarchive-3.4.3.orig/libarchive/archive_write_disk_posix.c 2020-03-02 01:57:32.000000000 -0600
+++ libarchive-3.4.3/libarchive/archive_write_disk_posix.c 2020-07-07 01:10:46.480138446 -0500
@@ -477,6 +477,7 @@
return (ARCHIVE_OK);
}
#endif
+#if 0
/*
* XXX At this point, symlinks should not be hit, otherwise
* XXX a race occurred. Do we want to check explicitly for that?
@@ -485,6 +486,7 @@
a->pst = &a->st;
return (ARCHIVE_OK);
}
+#endif
archive_set_error(&a->archive, errno, "Couldn't stat file");
return (ARCHIVE_WARN);
}
@@ -2669,8 +2671,10 @@
!(defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT))
/* Platform doesn't have lstat, so we can't look for symlinks. */
(void)path; /* UNUSED */
+#if 0
(void)error_number; /* UNUSED */
(void)error_string; /* UNUSED */
+#endif
(void)flags; /* UNUSED */
return (ARCHIVE_OK);
#else
@@ -3297,6 +3301,7 @@
static int
set_ownership(struct archive_write_disk *a)
{
+#if 0
#if !defined(__CYGWIN__) && !defined(__linux__)
/*
* On Linux, a process may have the CAP_CHOWN capability.
@@ -3335,6 +3340,7 @@
return (ARCHIVE_OK);
}
#endif
+#endif
archive_set_error(&a->archive, errno,
"Can't set user=%jd/group=%jd for %s",
diff -burN libarchive-3.4.3.orig/libarchive/archive_write_set_format_iso9660.c libarchive-3.4.3/libarchive/archive_write_set_format_iso9660.c
--- libarchive-3.4.3.orig/libarchive/archive_write_set_format_iso9660.c 2020-01-31 18:09:37.000000000 -0600
+++ libarchive-3.4.3/libarchive/archive_write_set_format_iso9660.c 2020-07-07 01:17:14.306518181 -0500
@@ -2177,6 +2177,9 @@
#elif defined(_WIN32) && !defined(__CYGWIN__)
strncpy(system_id, "Windows", size-1);
system_id[size-1] = '\0';
+#elif 1
+ strncpy(system_id, "PS2", size-1);
+ system_id[size-1] = '\0';
#else
#error no way to get the system identifier on your platform.
#endif
@@ -2507,8 +2510,10 @@
_get_timezone(&offset);
#elif defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__)
offset = _timezone;
-#else
+#elif 0
offset = timezone;
+#else
+ offset = 0;
#endif
offset *= -1;
if (tm->tm_isdst)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment