mirror of
https://github.com/gryf/gryf-overlay.git
synced 2026-01-04 12:54:14 +01:00
Removed old unadf, cleaned up version 0.7.12.
This commit is contained in:
@@ -1,11 +1,6 @@
|
||||
AUX 64-bit-fixes 75874 BLAKE2B f0f232525d9c45c04f85847c521c58028e5ea95faf302d4b970e6a788c78caf62876ab1a61a133a032ca9085a4155047f91b4bd921082a2c907ba3c2fadbc682 SHA512 3fb6aa0818bf08ab7d4a775ba1028d214e1476f130dca94f205749a6c3dca99908fedda94e59c84ff29926c5aaebfa54e84d4e2d4d2d1b5be3543c215b504648
|
||||
AUX add-hardening-flags-in-compiler-options 1219 BLAKE2B 258c90f237a6cdeed67a0578e0fde2ebcade00f63ebce1c3d9a6f8ad126a56c2c81a71cce7b2e169498240e28435f228516176767c3864480489eb44b1095607 SHA512 e664f526a4cc66109f718dabda4236260b5fd0adbdce0ef9766a0893df6922eb725eb733fb44a594387b7589671d2a5977c1f5ff65889e9ea95e57246ebcda48
|
||||
AUX adflib-0.7.12_separate_comment.patch 5444 BLAKE2B 2c864eab3ca72695a99e4916bd5d0564a1b01b51bce6cf760c95c06602bc93dadaa32f78a1ac1b5692df005478a75cd3b3a06151d04eb30ba704048a78f4f58a SHA512 5a149664736821997831ce22522b77bab7792beae98cdf42952a34217be16e2aa8ca1f378bf39c11137d36db99570efdde59142a4a64524b1116a1701a2d39c1
|
||||
AUX source-code-fixes 2260 BLAKE2B 1a019c8ed75bff6cd398ae1e4a6e44bdea8316b1d9ed2aad003908a2f0c9264d92d2e6c0d8f38a672a16c64d27c6851a3785705f5f7eafac5dbb442c37713729 SHA512 3f044ff72499765f5dc54dd617084514df69bdbccda120da94192fe922fdb1716b4e72858d30edbea2b304d26512c03d18bf735ddea0f3e0f243057aa82311d3
|
||||
AUX unadf_separate_comment.patch 4473 BLAKE2B f3814c6d7a4e2492e404863ad22205ab6311cec817a26af7779a7703f31795763f224648c28be6b3eef48a43a2efb2af0cde492889380ca599f27d067570a873 SHA512 46a0e159ef2e03de731ecb652c55c690a858261afd453da2fdd1f8f4cdaf9869bff83966a4b1ccd608b402d4649713eeceabaaee689ccbd97d4980ed59fc30be
|
||||
AUX unadf-0.7.12-CVE-2016-1243_CVE-2016-1244.patch 5191 BLAKE2B f888e30e1a4d7caefbb407e1cb0fc76345deb960fce974f5ad80e3cad41d3dfde78e34370bdedc11f5dc2729c6695a339db1eab3d37ed5f0bfae9e104c0d2949 SHA512 d1c9a8efcf026d58eaee61e92ee99304c52672836a63dd69f5e1e0472c9b2278521b5a2597f55449ffd23dd307e2c045324bed9b5bf89d160ab517542706aca3
|
||||
AUX unadf-0.7.12_separate_comment.patch 4846 BLAKE2B a58dfab3190e02ddb41c2632c62ebf40eaf8240430e8c2e146c34a30bda5956706c1927d3236d73fa8d0b2731a574b3402f25a8ebab6ba0fc11d2f92982449ef SHA512 9d1e608eae1e8cbd20051c18dff8f53aee7c3d7ef57c1c5527006c6f3af3d72dd92f8b0aee62f3ea06872d00a6a42f89105800f6fbff385830bd10486ceedbf0
|
||||
DIST adflib-0.7.12.tar.bz2 135412 BLAKE2B 964ef195c0539779c33acb2f3c103f97f7fd7f78bb32a83af9d586157700664f5e531908121aea8234592bb00fb8bff2e8f754e620f989d6d4e52537675c030e SHA512 d63846f0780bd57cae5ff667eb70f98a0ba3659cfd0b12b3ae2f29ac96631e522088f911b1ba6e5ee3b00620a28a802f14d93cdf8462e18a7e3f749915ab5af3
|
||||
DIST unadf_0.7.11a.orig.tar.gz 209458 BLAKE2B 9384d6c200ced0ddf4faa1e60e19089a48c90de2200ff9a1c78006e559c3d165a194052e27af80e8c904e865a84a42bcd111419a73349f3cb31b7512bc7d939c SHA512 f4b45438eaa875d96b42958a74a59b1a7605d3cbb91a7301fa58bf3a6cb617530c972d4496497e3e9395ca7916600bd60a56e4941512250018d3524e5af5bfe9
|
||||
EBUILD unadf-0.7.11a.ebuild 1022 BLAKE2B 5662bf5e7236b46b8522a9a6b364f290ea1e0dd6f126c23b0b3bc7e0b3ecf8072df1581591b9b87fa8dc9c7067b402a39833da1a4931681cb569159fda6ad8cf SHA512 3ffc114484dd4c50c0369fa3a34c81b7a922fed306bcf37ac151570310945a34232b9a22e3ff53403142771b049882893a84785f589a33a2a84264ffe6efc46e
|
||||
EBUILD unadf-0.7.12-r10.ebuild 864 BLAKE2B 3e032f9f01a9c740e18b430e4b5c063adcfb525b28118428556aff95df31129834215b524a4f10e301c162433406d280fc6d178de338e979caddf4fc475ff7cf SHA512 55fe1b106761fad8b822433c36522798007d0f86f217cae1fe49f706135e9ebd57fb37c428e1a9fd4c6d4635bc2e7f4608b929031ade4362b33072d8555074ee
|
||||
EBUILD unadf-0.7.12-r10.ebuild 768 BLAKE2B 8d7e3bb62b8915090a3a3eeb7397c80d79d06108dd9954600df3fdb1980080e5e4133c586468ec6cc81ae09b9a5e58a94da71cb0d2758950f61dd9bbe2c284fa SHA512 95898d438bb8359016ab92fed48594108ca2dffbc15406a2bf77ded77c2fd6842238674dc38bcb8d0dae75d91f911cca28e73955b9e57da2d5ab96885c010fbf
|
||||
MISC ChangeLog 1480 BLAKE2B ca87a21e58b00f17ca11f50a66aca46e596cd7c4cd43a357bca0ce134efa7fe6a26800a942d50fbe02443dba62e0f9f987d26b2e19be1c64492649c92774f1d9 SHA512 9a6816cefb775f881fc0108b598264896119122dff24709a756935f4cc8df30f8757525b8a50a8bbb6e3f528de7d251375d4154db1a13f6c5a7e4b297f040416
|
||||
MISC metadata.xml 202 BLAKE2B 3fc88d79c4843991cb0f6685a4ffb8b174b6c21e55470c9e4c7d3c4e52f98d6b871fba53162c7bc811bb2043e52139a38ef201e3ee3690be2de409ce28dd93e7 SHA512 bd1c14da72bdd52e3bea3056f5b9f908c31d6915b651d15d80a0a7d26778c97cde493ae9ca4352bd313eb16ddbed9b169c6b620c7f4a9b77973f7077fa8d997c
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,44 +0,0 @@
|
||||
Description: Add hardening flags in compiler options
|
||||
Author: Boris Pek <tehnick-8@mail.ru>
|
||||
Last-Update: 2012-06-19
|
||||
|
||||
--- a/Demo/Makefile
|
||||
+++ b/Demo/Makefile
|
||||
@@ -8,6 +8,9 @@
|
||||
CFLAGS=-I$(LIBDIR) -Wall -Wno-uninitialized -pedantic -std=gnu99 -ggdb
|
||||
LDFLAGS=-L$(LIBDIR) -ladf
|
||||
|
||||
+CFLAGS+=$(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)
|
||||
+LDFLAGS+=$(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed
|
||||
+
|
||||
EXES= unadf
|
||||
|
||||
|
||||
--- a/Lib/Makefile
|
||||
+++ b/Lib/Makefile
|
||||
@@ -16,11 +16,13 @@
|
||||
DEFINES=
|
||||
|
||||
CFLAGS=$(DEFINES) -I${NATIV_DIR} -I.. -I. -Wall -ggdb -std=gnu99
|
||||
+CFLAGS+=$(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)
|
||||
|
||||
CC=gcc
|
||||
DEPEND=makedepend
|
||||
|
||||
LDFLAGS=-L. -ladf
|
||||
+LDFLAGS+=$(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed
|
||||
LDSHARED=$(CC)
|
||||
|
||||
OBJS= adf_hd.o adf_disk.o adf_raw.o adf_bitm.o adf_dump.o\
|
||||
--- a/Demo/unadf.c
|
||||
+++ b/Demo/unadf.c
|
||||
@@ -489,8 +489,7 @@
|
||||
|
||||
dev = adfMountDev( devname,TRUE );
|
||||
if (!dev) {
|
||||
- sprintf(strbuf,"Can't mount the dump device '%s'.\n", devname);
|
||||
- fprintf(stderr, strbuf);
|
||||
+ fprintf(stderr,"Can't mount the dump device '%s'.\n", devname);
|
||||
adfEnvCleanUp(); exit(1);
|
||||
}
|
||||
if (!qflag)
|
||||
@@ -1,100 +0,0 @@
|
||||
Description: fix header files
|
||||
Last-Update: 2012-05-31
|
||||
|
||||
--- unadf-0.7.11a.orig/Lib/adf_env.c
|
||||
+++ unadf-0.7.11a/Lib/adf_env.c
|
||||
@@ -33,7 +33,7 @@
|
||||
#include"adf_nativ.h"
|
||||
#include"adf_env.h"
|
||||
|
||||
-#include"defendian.h"
|
||||
+#include"Win32/defendian.h"
|
||||
|
||||
union u{
|
||||
long l;
|
||||
--- unadf-0.7.11a.orig/Lib/adf_file.c
|
||||
+++ unadf-0.7.11a/Lib/adf_file.c
|
||||
@@ -31,7 +31,7 @@
|
||||
#include"adf_util.h"
|
||||
#include"adf_file.h"
|
||||
#include"adf_str.h"
|
||||
-#include"defendian.h"
|
||||
+#include"Win32/defendian.h"
|
||||
#include"adf_raw.h"
|
||||
#include"adf_disk.h"
|
||||
#include"adf_dir.h"
|
||||
--- unadf-0.7.11a.orig/Lib/adf_dir.c
|
||||
+++ unadf-0.7.11a/Lib/adf_dir.c
|
||||
@@ -32,7 +32,7 @@
|
||||
#include"adf_dir.h"
|
||||
#include"adf_str.h"
|
||||
#include"adf_util.h"
|
||||
-#include"defendian.h"
|
||||
+#include"Win32/defendian.h"
|
||||
#include"adf_blk.h"
|
||||
#include"adf_raw.h"
|
||||
#include"adf_disk.h"
|
||||
--- unadf-0.7.11a.orig/Lib/adf_raw.c
|
||||
+++ unadf-0.7.11a/Lib/adf_raw.c
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "adf_disk.h"
|
||||
#include "adf_util.h"
|
||||
#include "adf_err.h"
|
||||
-#include "defendian.h"
|
||||
+#include "Win32/defendian.h"
|
||||
|
||||
extern struct Env adfEnv;
|
||||
|
||||
--- unadf-0.7.11a.orig/Lib/adf_bitm.c
|
||||
+++ unadf-0.7.11a/Lib/adf_bitm.c
|
||||
@@ -33,7 +33,7 @@
|
||||
#include"adf_err.h"
|
||||
#include"adf_disk.h"
|
||||
#include"adf_util.h"
|
||||
-#include"defendian.h"
|
||||
+#include"Win32/defendian.h"
|
||||
|
||||
extern unsigned long bitMask[32];
|
||||
|
||||
--- unadf-0.7.11a.orig/Lib/adf_cache.c
|
||||
+++ unadf-0.7.11a/Lib/adf_cache.c
|
||||
@@ -31,7 +31,7 @@
|
||||
#include"adf_defs.h"
|
||||
#include"adf_str.h"
|
||||
#include"adf_err.h"
|
||||
-#include"defendian.h"
|
||||
+#include"Win32/defendian.h"
|
||||
#include"adf_cache.h"
|
||||
#include"adf_raw.h"
|
||||
#include"adf_disk.h"
|
||||
--- unadf-0.7.11a.orig/Lib/adf_hd.c
|
||||
+++ unadf-0.7.11a/Lib/adf_hd.c
|
||||
@@ -41,7 +41,7 @@
|
||||
#include"adf_dump.h"
|
||||
#include"adf_err.h"
|
||||
|
||||
-#include"defendian.h"
|
||||
+#include"Win32/defendian.h"
|
||||
|
||||
extern struct Env adfEnv;
|
||||
|
||||
--- unadf-0.7.11a.orig/Lib/Generic/adf_nativ.c
|
||||
+++ unadf-0.7.11a/Lib/Generic/adf_nativ.c
|
||||
@@ -20,7 +20,6 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
- */
|
||||
|
||||
#include<stdio.h>
|
||||
#include<stdlib.h>
|
||||
--- unadf-0.7.11a.orig/Lib/Generic/adf_nativ.h
|
||||
+++ unadf-0.7.11a/Lib/Generic/adf_nativ.h
|
||||
@@ -20,7 +20,6 @@
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
- */
|
||||
|
||||
#ifndef ADF_NATIV_H
|
||||
#define ADF_NATIV_H
|
||||
@@ -0,0 +1,146 @@
|
||||
Description: Fix unsafe extraction by using mkdir() instead of shell command
|
||||
This commit fixes following vulnerabilities:
|
||||
|
||||
- CVE-2016-1243: stack buffer overflow caused by blindly trusting on
|
||||
pathname lengths of archived files
|
||||
|
||||
Stack allocated buffer sysbuf was filled with sprintf() without any
|
||||
bounds checking in extracTree() function.
|
||||
|
||||
- CVE-2016-1244: execution of unsanitized input
|
||||
|
||||
Shell command used for creating directory paths was constructed by
|
||||
concatenating names of archived files to the end of the command
|
||||
string.
|
||||
|
||||
So, if the user was tricked to extract a specially crafted .adf file,
|
||||
the attacker was able to execute arbitrary code with privileges of the
|
||||
user.
|
||||
|
||||
This commit fixes both issues by
|
||||
|
||||
1) replacing mkdir shell commands with mkdir() function calls
|
||||
2) removing redundant sysbuf buffer
|
||||
|
||||
Author: Tuomas Räsänen <tuomasjjrasanen@tjjr.fi>
|
||||
Last-Update: 2016-09-20
|
||||
--
|
||||
--- a/examples/unadf.c
|
||||
+++ b/examples/unadf.c
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
#define UNADF_VERSION "1.0"
|
||||
|
||||
+#include <sys/stat.h>
|
||||
+#include <sys/types.h>
|
||||
|
||||
#include<stdlib.h>
|
||||
#include<errno.h>
|
||||
@@ -31,17 +33,15 @@
|
||||
|
||||
#include "adflib.h"
|
||||
|
||||
-/* The portable way used to create a directory is to call the MKDIR command via the
|
||||
- * system() function.
|
||||
- * It is used to create the 'dir1' directory, like the 'dir1/dir11' directory
|
||||
+/* The portable way used to create a directory is to call mkdir()
|
||||
+ * which is defined by following standards: SVr4, BSD, POSIX.1-2001
|
||||
+ * and POSIX.1-2008
|
||||
*/
|
||||
|
||||
/* the portable way to check if a directory 'dir1' already exists i'm using is to
|
||||
* do fopen('dir1','rb'). NULL is returned if 'dir1' doesn't exists yet, an handle instead
|
||||
*/
|
||||
|
||||
-#define MKDIR "mkdir"
|
||||
-
|
||||
#ifdef WIN32
|
||||
#define DIRSEP '\\'
|
||||
#else
|
||||
@@ -51,6 +51,13 @@
|
||||
#define EXTBUFL 1024*8
|
||||
|
||||
|
||||
+static void mkdirOrLogErr(const char *const path)
|
||||
+{
|
||||
+ if (mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO))
|
||||
+ fprintf(stderr, "mkdir: cannot create directory '%s': %s\n",
|
||||
+ path, strerror(errno));
|
||||
+}
|
||||
+
|
||||
void help()
|
||||
{
|
||||
puts("unadf [-lrcsp -v n] dumpname.adf [files-with-path] [-d extractdir]");
|
||||
@@ -152,7 +159,6 @@ void extractTree(struct Volume *vol, str
|
||||
{
|
||||
struct Entry* entry;
|
||||
char *buf;
|
||||
- char sysbuf[200];
|
||||
|
||||
while(tree) {
|
||||
entry = (struct Entry*)tree->content;
|
||||
@@ -162,16 +168,14 @@ void extractTree(struct Volume *vol, str
|
||||
buf=(char*)malloc(strlen(path)+1+strlen(entry->name)+1);
|
||||
if (!buf) return;
|
||||
sprintf(buf,"%s%c%s",path,DIRSEP,entry->name);
|
||||
- sprintf(sysbuf,"%s %s",MKDIR,buf);
|
||||
if (!qflag) printf("x - %s%c\n",buf,DIRSEP);
|
||||
+ if (!pflag) mkdirOrLogErr(buf);
|
||||
}
|
||||
else {
|
||||
- sprintf(sysbuf,"%s %s",MKDIR,entry->name);
|
||||
if (!qflag) printf("x - %s%c\n",entry->name,DIRSEP);
|
||||
+ if (!pflag) mkdirOrLogErr(entry->name);
|
||||
}
|
||||
|
||||
- if (!pflag) system(sysbuf);
|
||||
-
|
||||
if (tree->subdir!=NULL) {
|
||||
if (adfChangeDir(vol,entry->name)==RC_OK) {
|
||||
if (buf!=NULL)
|
||||
@@ -301,21 +305,20 @@ void processFile(struct Volume *vol, cha
|
||||
extractFile(vol, name, path, extbuf, pflag, qflag);
|
||||
}
|
||||
else {
|
||||
- /* the all-in-one string : to call system(), to find the filename, the convert dir sep char ... */
|
||||
- bigstr=(char*)malloc(strlen(MKDIR)+1+strlen(path)+1+strlen(name)+1);
|
||||
+ bigstr=(char*)malloc(strlen(path)+1+strlen(name)+1);
|
||||
if (!bigstr) { fprintf(stderr,"processFile : malloc"); return; }
|
||||
|
||||
/* to build to extract path */
|
||||
if (strlen(path)>0) {
|
||||
- sprintf(bigstr,"%s %s%c%s",MKDIR,path,DIRSEP,name);
|
||||
- cdstr = bigstr+strlen(MKDIR)+1+strlen(path)+1;
|
||||
+ sprintf(bigstr,"%s%c%s",path,DIRSEP,name);
|
||||
+ cdstr = bigstr+strlen(path)+1;
|
||||
}
|
||||
else {
|
||||
- sprintf(bigstr,"%s %s",MKDIR,name);
|
||||
- cdstr = bigstr+strlen(MKDIR)+1;
|
||||
+ sprintf(bigstr,"%s",name);
|
||||
+ cdstr = bigstr;
|
||||
}
|
||||
/* the directory in which the file will be extracted */
|
||||
- fullname = bigstr+strlen(MKDIR)+1;
|
||||
+ fullname = bigstr;
|
||||
|
||||
/* finds the filename, and separates it from the path */
|
||||
filename = strrchr(bigstr,'/')+1;
|
||||
@@ -333,7 +336,7 @@ void processFile(struct Volume *vol, cha
|
||||
return;
|
||||
tfile = fopen(fullname,"r"); /* the only portable way to test if the dir exists */
|
||||
if (tfile==NULL) { /* does't exist : create it */
|
||||
- if (!pflag) system(bigstr);
|
||||
+ if (!pflag) mkdirOrLogErr(bigstr);
|
||||
if (!qflag) printf("x - %s%c\n",fullname,DIRSEP);
|
||||
}
|
||||
else
|
||||
@@ -350,7 +353,7 @@ void processFile(struct Volume *vol, cha
|
||||
return;
|
||||
tfile = fopen(fullname,"r");
|
||||
if (tfile==NULL) {
|
||||
- if (!pflag) system(bigstr);
|
||||
+ if (!pflag) mkdirOrLogErr(bigstr);
|
||||
if (!qflag) printf("x - %s%c\n",fullname,DIRSEP);
|
||||
}
|
||||
else
|
||||
@@ -1,14 +1,6 @@
|
||||
--- adflib-0.7.12/examples/unadf.c 2006-12-03 17:22:38.000000000 +0100
|
||||
+++ adflib-0.7.12-patched/examples/unadf.c 2014-02-23 09:45:29.315626096 +0100
|
||||
@@ -50,7 +50,6 @@
|
||||
|
||||
#define EXTBUFL 1024*8
|
||||
|
||||
-
|
||||
void help()
|
||||
{
|
||||
puts("unadf [-lrcsp -v n] dumpname.adf [files-with-path] [-d extractdir]");
|
||||
@@ -58,6 +57,7 @@
|
||||
--- adflib-0.7.12_a/examples/unadf.c 2021-07-09 17:38:47.980770205 +0200
|
||||
+++ adflib-0.7.12_b/examples/unadf.c 2021-07-09 17:54:32.548793259 +0200
|
||||
@@ -65,6 +65,7 @@
|
||||
puts(" -r : lists directory tree contents");
|
||||
puts(" -c : use dircache data (must be used with -l)");
|
||||
puts(" -s : display entries logical block pointer (must be used with -l)");
|
||||
@@ -16,7 +8,7 @@
|
||||
putchar('\n');
|
||||
puts(" -v n : mount volume #n instead of default #0 volume");
|
||||
putchar('\n');
|
||||
@@ -65,7 +65,8 @@
|
||||
@@ -72,7 +73,8 @@
|
||||
puts(" -d dir : extract to 'dir' directory");
|
||||
}
|
||||
|
||||
@@ -26,7 +18,7 @@
|
||||
{
|
||||
/* do not print the links entries, ADFlib do not support them yet properly */
|
||||
if (entry->type==ST_LFILE || entry->type==ST_LDIR || entry->type==ST_LSOFT)
|
||||
@@ -74,12 +75,12 @@
|
||||
@@ -81,12 +83,12 @@
|
||||
if (entry->type==ST_DIR)
|
||||
printf(" ");
|
||||
else
|
||||
@@ -41,7 +33,7 @@
|
||||
|
||||
if (strlen(path)>0)
|
||||
printf(" %s/",path);
|
||||
@@ -89,7 +90,7 @@
|
||||
@@ -96,7 +98,7 @@
|
||||
printf("%s/",entry->name);
|
||||
else
|
||||
printf("%s",entry->name);
|
||||
@@ -50,7 +42,7 @@
|
||||
printf(", %s",entry->comment);
|
||||
putchar('\n');
|
||||
|
||||
@@ -199,13 +200,14 @@
|
||||
@@ -203,13 +205,14 @@
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +59,7 @@
|
||||
if (tree->subdir!=NULL) {
|
||||
entry = (struct Entry*)tree->content;
|
||||
if (strlen(path)>0) {
|
||||
@@ -215,11 +217,11 @@
|
||||
@@ -219,11 +222,11 @@
|
||||
return;
|
||||
}
|
||||
sprintf(buf,"%s/%s", path, entry->name);
|
||||
@@ -81,7 +73,7 @@
|
||||
}
|
||||
tree = tree->next;
|
||||
}
|
||||
@@ -243,7 +245,7 @@
|
||||
@@ -247,7 +250,7 @@
|
||||
printf("???"); break;
|
||||
}
|
||||
|
||||
@@ -90,7 +82,7 @@
|
||||
|
||||
printf(". Volumes = %d\n",dev->nVol);
|
||||
}
|
||||
@@ -273,7 +275,7 @@
|
||||
@@ -277,7 +280,7 @@
|
||||
if (vol->volName!=NULL)
|
||||
printf(" \"%s\"", vol->volName);
|
||||
|
||||
@@ -99,7 +91,7 @@
|
||||
|
||||
printf(" %s ",isFFS(vol->dosType) ? "FFS" : "OFS");
|
||||
if (isINTL(vol->dosType))
|
||||
@@ -370,12 +372,10 @@
|
||||
@@ -373,7 +376,7 @@
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int i, j;
|
||||
@@ -107,43 +99,27 @@
|
||||
+ BOOL rflag, lflag, xflag, cflag, vflag, sflag, dflag, pflag, qflag, mflag;
|
||||
struct List* files, *rtfiles;
|
||||
char *devname, *dirname;
|
||||
- char strbuf[80];
|
||||
unsigned char *extbuf;
|
||||
- int vInd, dInd, fInd, aInd;
|
||||
BOOL nextArg;
|
||||
|
||||
struct Device *dev;
|
||||
@@ -389,8 +389,7 @@
|
||||
char strbuf[80];
|
||||
@@ -392,7 +395,7 @@
|
||||
exit(0);
|
||||
}
|
||||
|
||||
- rflag = lflag = cflag = vflag = sflag = dflag = pflag = qflag = FALSE;
|
||||
- vInd = dInd = fInd = aInd = -1;
|
||||
+ rflag = lflag = cflag = vflag = sflag = dflag = pflag = qflag = mflag = FALSE;
|
||||
vInd = dInd = fInd = aInd = -1;
|
||||
xflag = TRUE;
|
||||
dirname = NULL;
|
||||
devname = NULL;
|
||||
@@ -430,6 +429,9 @@
|
||||
@@ -433,6 +436,9 @@
|
||||
case 's':
|
||||
sflag = TRUE;
|
||||
break;
|
||||
+ case 'm':
|
||||
+ case 'm':
|
||||
+ mflag = TRUE;
|
||||
+ break;
|
||||
case 'c':
|
||||
cflag = TRUE;
|
||||
break;
|
||||
@@ -489,8 +491,7 @@
|
||||
|
||||
dev = adfMountDev( devname,TRUE );
|
||||
if (!dev) {
|
||||
- sprintf(strbuf,"Can't mount the dump device '%s'.\n", devname);
|
||||
- fprintf(stderr, strbuf);
|
||||
+ fprintf(stderr,"Can't mount the dump device '%s'.\n", devname);
|
||||
adfEnvCleanUp(); exit(1);
|
||||
}
|
||||
if (!qflag)
|
||||
@@ -523,13 +524,13 @@
|
||||
@@ -526,13 +532,13 @@
|
||||
if (!rflag) {
|
||||
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
|
||||
while(cell) {
|
||||
@@ -1,122 +0,0 @@
|
||||
diff -ur unadf-0.7.11a.orig/Demo/unadf.c unadf-0.7.11a/Demo/unadf.c
|
||||
--- unadf-0.7.11a.orig/Demo/unadf.c 2013-05-12 17:59:51.214905177 +0200
|
||||
+++ unadf-0.7.11a/Demo/unadf.c 2013-05-12 17:50:06.843420519 +0200
|
||||
@@ -58,6 +58,7 @@
|
||||
puts(" -r : lists directory tree contents");
|
||||
puts(" -c : use dircache data (must be used with -l)");
|
||||
puts(" -s : display entries logical block pointer (must be used with -l)");
|
||||
+ puts(" -m : display file comments, if exists (must be used with -l)");
|
||||
putchar('\n');
|
||||
puts(" -v n : mount volume #n instead of default #0 volume");
|
||||
putchar('\n');
|
||||
@@ -65,7 +66,8 @@
|
||||
puts(" -d dir : extract to 'dir' directory");
|
||||
}
|
||||
|
||||
-void printEnt(struct Volume *vol, struct Entry* entry, char *path, BOOL sect)
|
||||
+void printEnt(struct Volume *vol, struct Entry* entry, char *path, BOOL sect,
|
||||
+ BOOL comment)
|
||||
{
|
||||
/* do not print the links entries, ADFlib do not support them yet properly */
|
||||
if (entry->type==ST_LFILE || entry->type==ST_LDIR || entry->type==ST_LSOFT)
|
||||
@@ -89,7 +91,7 @@
|
||||
printf("%s/",entry->name);
|
||||
else
|
||||
printf("%s",entry->name);
|
||||
- if (entry->comment!=NULL && strlen(entry->comment)>0)
|
||||
+ if (comment && entry->comment!=NULL && strlen(entry->comment)>0)
|
||||
printf(", %s",entry->comment);
|
||||
putchar('\n');
|
||||
|
||||
@@ -199,13 +201,14 @@
|
||||
}
|
||||
|
||||
|
||||
-void printTree(struct Volume *vol, struct List* tree, char* path, BOOL sect)
|
||||
+void printTree(struct Volume *vol, struct List* tree, char* path, BOOL sect,
|
||||
+ BOOL comment)
|
||||
{
|
||||
char *buf;
|
||||
struct Entry* entry;
|
||||
|
||||
while(tree) {
|
||||
- printEnt(vol, tree->content, path, sect);
|
||||
+ printEnt(vol, tree->content, path, sect, comment);
|
||||
if (tree->subdir!=NULL) {
|
||||
entry = (struct Entry*)tree->content;
|
||||
if (strlen(path)>0) {
|
||||
@@ -215,11 +218,11 @@
|
||||
return;
|
||||
}
|
||||
sprintf(buf,"%s/%s", path, entry->name);
|
||||
- printTree(vol, tree->subdir, buf, sect);
|
||||
+ printTree(vol, tree->subdir, buf, sect, comment);
|
||||
free(buf);
|
||||
}
|
||||
else
|
||||
- printTree(vol, tree->subdir, entry->name, sect);
|
||||
+ printTree(vol, tree->subdir, entry->name, sect, comment);
|
||||
}
|
||||
tree = tree->next;
|
||||
}
|
||||
@@ -370,12 +373,10 @@
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int i, j;
|
||||
- BOOL rflag, lflag, xflag, cflag, vflag, sflag, dflag, pflag, qflag;
|
||||
+ BOOL rflag, lflag, xflag, cflag, vflag, sflag, dflag, pflag, qflag, mflag;
|
||||
struct List* files, *rtfiles;
|
||||
char *devname, *dirname;
|
||||
- char strbuf[80];
|
||||
unsigned char *extbuf;
|
||||
- int vInd, dInd, fInd, aInd;
|
||||
BOOL nextArg;
|
||||
|
||||
struct Device *dev;
|
||||
@@ -389,8 +390,7 @@
|
||||
exit(0);
|
||||
}
|
||||
|
||||
- rflag = lflag = cflag = vflag = sflag = dflag = pflag = qflag = FALSE;
|
||||
- vInd = dInd = fInd = aInd = -1;
|
||||
+ rflag = lflag = cflag = vflag = sflag = dflag = pflag = qflag = mflag = FALSE;
|
||||
xflag = TRUE;
|
||||
dirname = NULL;
|
||||
devname = NULL;
|
||||
@@ -430,6 +430,9 @@
|
||||
case 's':
|
||||
sflag = TRUE;
|
||||
break;
|
||||
+ case 'm':
|
||||
+ mflag = TRUE;
|
||||
+ break;
|
||||
case 'c':
|
||||
cflag = TRUE;
|
||||
break;
|
||||
@@ -522,13 +525,13 @@
|
||||
if (!rflag) {
|
||||
cell = list = adfGetDirEnt(vol,vol->curDirPtr);
|
||||
while(cell) {
|
||||
- printEnt(vol,cell->content,"", sflag);
|
||||
+ printEnt(vol,cell->content,"", sflag, mflag);
|
||||
cell = cell->next;
|
||||
}
|
||||
adfFreeDirList(list);
|
||||
} else {
|
||||
cell = list = adfGetRDirEnt(vol,vol->curDirPtr,TRUE);
|
||||
- printTree(vol,cell,"", sflag);
|
||||
+ printTree(vol,cell,"", sflag, mflag);
|
||||
adfFreeDirList(list);
|
||||
}
|
||||
}else if (xflag) {
|
||||
diff -ur unadf-0.7.11a.orig/Demo/unadf.usage unadf-0.7.11a/Demo/unadf.usage
|
||||
--- unadf-0.7.11a.orig/Demo/unadf.usage 2006-12-03 15:27:00.000000000 +0100
|
||||
+++ unadf-0.7.11a/Demo/unadf.usage 2013-05-12 17:40:23.116966854 +0200
|
||||
@@ -3,6 +3,7 @@
|
||||
-r : lists directory tree contents
|
||||
-c : use dircache data (must be used with -l)
|
||||
-s : display entries logical block pointer (must be used with -l)
|
||||
+ -m : display file comments, if exists (must be used with -l)
|
||||
|
||||
-v n : mount volume #n instead of default #0 volume
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
# Copyright 1999-2010 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-arch/unadf/unadf-0.7.9b.ebuild,v 1.11 2010/01/01 19:41:00 fauli Exp $
|
||||
|
||||
inherit eutils
|
||||
|
||||
DESCRIPTION="Extract files from Amiga adf disk images"
|
||||
SRC_URI="http://ftp.de.debian.org/debian/pool/main/u/unadf/unadf_0.7.11a.orig.tar.gz"
|
||||
HOMEPAGE="http://packages.debian.org/unstable/utils/unadf"
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~x86 ~amd64"
|
||||
IUSE=""
|
||||
DEPEND="app-arch/unzip
|
||||
x11-misc/makedepend"
|
||||
RDEPEND=""
|
||||
|
||||
src_unpack() {
|
||||
unpack ${A}
|
||||
cd "${S}"
|
||||
epatch "${FILESDIR}"/source-code-fixes
|
||||
epatch "${FILESDIR}"/64-bit-fixes
|
||||
epatch "${FILESDIR}"/add-hardening-flags-in-compiler-options
|
||||
epatch "${FILESDIR}"/unadf_separate_comment.patch
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
echo "** ${S} **"
|
||||
cd "${S}" && make || die "make failed"
|
||||
}
|
||||
|
||||
src_install() {
|
||||
dobin Demo/unadf
|
||||
dodoc README CHANGES Faq/adf_info.txt
|
||||
docinto Docs
|
||||
dodoc Docs/*
|
||||
docinto Faq
|
||||
dodoc Faq/*
|
||||
docinto Faq/image
|
||||
dodoc Faq/image/*
|
||||
}
|
||||
@@ -1,32 +1,29 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Copyright 1999-2018 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/app-arch/unadf/unadf-0.7.12.ebuild,v 1.1 2013/12/29 00:26:30 robbat2 Exp $
|
||||
|
||||
EAPI=5
|
||||
EAPI=6
|
||||
|
||||
inherit autotools eutils
|
||||
inherit autotools
|
||||
|
||||
MY_PN="adflib"
|
||||
|
||||
DESCRIPTION="Extract files from Amiga adf disk images"
|
||||
SRC_URI="http://lclevy.free.fr/${MY_PN}/${MY_PN}-${PV}.tar.bz2"
|
||||
HOMEPAGE="http://lclevy.free.fr/adflib/"
|
||||
SRC_URI="http://lclevy.free.fr/${MY_PN}/${MY_PN}-${PV}.tar.bz2"
|
||||
|
||||
LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~hppa ~ppc ~ppc-macos ~sparc-solaris ~x86 ~x86-interix ~x86-linux ~x86-solaris"
|
||||
KEYWORDS="~amd64 ~hppa ~ppc ~x86 ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
|
||||
IUSE="static-libs"
|
||||
DEPEND=""
|
||||
RDEPEND=""
|
||||
|
||||
S="${WORKDIR}/${MY_PN}-${PV}"
|
||||
|
||||
src_unpack() {
|
||||
unpack ${A}
|
||||
cd "${S}"
|
||||
epatch "${FILESDIR}"/adflib-0.7.12_separate_comment.patch
|
||||
}
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-0.7.12-CVE-2016-1243_CVE-2016-1244.patch"
|
||||
"${FILESDIR}/${PN}-0.7.12_separate_comment.patch"
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
eautoreconf
|
||||
}
|
||||
|
||||
@@ -36,5 +33,5 @@ src_configure() {
|
||||
|
||||
src_install() {
|
||||
default
|
||||
prune_libtool_files
|
||||
find "${D}" -name '*.la' -delete || die
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user