Browse code

Add copyright notice. Fix metadata ref bug.

git-svn: trunk@1484

Trog authored on 2005/04/19 20:32:41
Showing 15 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Apr 19 12:30:58 BST 2005 (trog)
2
+-----------------------------------
3
+  * libclamav/unrar: Add copyright notice. Fix metadata ref bug.
4
+
1 5
 Tue Apr 19 10:22:26 BST 2005 (njh)
2 6
 ----------------------------------
3 7
   * libclamav/mbox.c:	Some Sober.N were getting through, thanks to Christoph
... ...
@@ -1,3 +1,25 @@
1
+/*
2
+ *  Extract RAR archives
3
+ *
4
+ *  Copyright (C) 2005 trog@uncon.org
5
+ *
6
+ *  This code is based on the work of Alexander L. Roshal
7
+ *
8
+ *  This program is free software; you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation; either version 2 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program; if not, write to the Free Software
20
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ */
22
+
1 23
 #include <sys/types.h>
2 24
 #include <sys/stat.h>
3 25
 #include <fcntl.h>
... ...
@@ -1366,7 +1388,7 @@ rar_metadata_t *cli_unrar(int fd, const char *dirname, const struct cl_limits *l
1366 1366
 				}
1367 1367
 			}
1368 1368
 
1369
-			if (limits->maxfilesize && (metadata->unpack_size > (unsigned int) limits->maxfilesize)) {
1369
+			if (limits->maxfilesize && (file_header->unpack_size > (unsigned int) limits->maxfilesize)) {
1370 1370
 				free(file_header->filename);
1371 1371
 				free(file_header);
1372 1372
 				break;
... ...
@@ -1376,7 +1398,7 @@ rar_metadata_t *cli_unrar(int fd, const char *dirname, const struct cl_limits *l
1376 1376
 		if (file_header->flags & LHD_PASSWORD) {
1377 1377
 			cli_dbgmsg("PASSWORDed file: %s\n", file_header->filename);
1378 1378
 			metadata_tail->encrypted = TRUE;
1379
-		} else if (metadata->unpack_size) {
1379
+		} else if (file_header->unpack_size) {
1380 1380
 			snprintf(filename, 1024, "%s/%lu.ura", dirname, file_count);
1381 1381
 			ofd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0600);
1382 1382
 			if (ofd < 0) {
... ...
@@ -1,3 +1,25 @@
1
+/*
2
+ *  Extract RAR archives
3
+ *
4
+ *  Copyright (C) 2005 trog@uncon.org
5
+ *
6
+ *  This code is based on the work of Alexander L. Roshal
7
+ *
8
+ *  This program is free software; you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation; either version 2 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program; if not, write to the Free Software
20
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ */
22
+
1 23
 #ifndef UNRAR_H
2 24
 #define UNRAR_H 1
3 25
 
... ...
@@ -1,3 +1,25 @@
1
+/*
2
+ *  Extract RAR archives
3
+ *
4
+ *  Copyright (C) 2005 trog@uncon.org
5
+ *
6
+ *  This code is based on the work of Alexander L. Roshal
7
+ *
8
+ *  This program is free software; you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation; either version 2 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program; if not, write to the Free Software
20
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ */
22
+
1 23
 #include "unrar.h"
2 24
 
3 25
 #define STARTL1  2
... ...
@@ -1,3 +1,25 @@
1
+/*
2
+ *  Extract RAR archives
3
+ *
4
+ *  Copyright (C) 2005 trog@uncon.org
5
+ *
6
+ *  This code is based on the work of Alexander L. Roshal
7
+ *
8
+ *  This program is free software; you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation; either version 2 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program; if not, write to the Free Software
20
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ */
22
+
1 23
 #ifndef UNRAR15_H
2 24
 #define UNRAR15_H 1
3 25
 
... ...
@@ -1,3 +1,25 @@
1
+/*
2
+ *  Extract RAR archives
3
+ *
4
+ *  Copyright (C) 2005 trog@uncon.org
5
+ *
6
+ *  This code is based on the work of Alexander L. Roshal
7
+ *
8
+ *  This program is free software; you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation; either version 2 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program; if not, write to the Free Software
20
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ */
22
+
1 23
 #include "unrar.h"
2 24
 #include "unrar20.h"
3 25
 
... ...
@@ -1,3 +1,25 @@
1
+/*
2
+ *  Extract RAR archives
3
+ *
4
+ *  Copyright (C) 2005 trog@uncon.org
5
+ *
6
+ *  This code is based on the work of Alexander L. Roshal
7
+ *
8
+ *  This program is free software; you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation; either version 2 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program; if not, write to the Free Software
20
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ */
22
+
1 23
 #ifndef UNRAR20_H
2 24
 #define UNRAR20_H 1
3 25
 
... ...
@@ -1,3 +1,25 @@
1
+/*
2
+ *  Extract RAR archives
3
+ *
4
+ *  Copyright (C) 2005 trog@uncon.org
5
+ *
6
+ *  This code is based on the work of Alexander L. Roshal
7
+ *
8
+ *  This program is free software; you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation; either version 2 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program; if not, write to the Free Software
20
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ */
22
+
1 23
 #include <string.h>
2 24
 #include <stdlib.h>
3 25
 
... ...
@@ -1,3 +1,25 @@
1
+/*
2
+ *  Extract RAR archives
3
+ *
4
+ *  Copyright (C) 2005 trog@uncon.org
5
+ *
6
+ *  This code is based on the work of Alexander L. Roshal
7
+ *
8
+ *  This program is free software; you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation; either version 2 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program; if not, write to the Free Software
20
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ */
22
+
1 23
 #ifndef RAR_CMD_ARRAY_H
2 24
 #define RAR_CMD_ARRAY_H
3 25
 
... ...
@@ -1,3 +1,25 @@
1
+/*
2
+ *  Extract RAR archives
3
+ *
4
+ *  Copyright (C) 2005 trog@uncon.org
5
+ *
6
+ *  This code is based on the work of Alexander L. Roshal
7
+ *
8
+ *  This program is free software; you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation; either version 2 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program; if not, write to the Free Software
20
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ */
22
+
1 23
 #include <unistd.h>
2 24
 
3 25
 #include "unrar.h"
... ...
@@ -1,3 +1,25 @@
1
+/*
2
+ *  Extract RAR archives
3
+ *
4
+ *  Copyright (C) 2005 trog@uncon.org
5
+ *
6
+ *  This code is based on the work of Alexander L. Roshal
7
+ *
8
+ *  This program is free software; you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation; either version 2 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program; if not, write to the Free Software
20
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ */
22
+
1 23
 #ifndef RAR_FILTER_ARRAY_H
2 24
 #define RAR_FILTER_ARRAY_H
3 25
 
... ...
@@ -1,3 +1,25 @@
1
+/*
2
+ *  Extract RAR archives
3
+ *
4
+ *  Copyright (C) 2005 trog@uncon.org
5
+ *
6
+ *  This code is based on the work of Alexander L. Roshal
7
+ *
8
+ *  This program is free software; you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation; either version 2 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program; if not, write to the Free Software
20
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ */
22
+
1 23
 #include <stdio.h>
2 24
 #include <string.h>
3 25
 
... ...
@@ -1,3 +1,25 @@
1
+/*
2
+ *  Extract RAR archives
3
+ *
4
+ *  Copyright (C) 2005 trog@uncon.org
5
+ *
6
+ *  This code is based on the work of Alexander L. Roshal
7
+ *
8
+ *  This program is free software; you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation; either version 2 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program; if not, write to the Free Software
20
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ */
22
+
1 23
 #ifndef UNRAR_PPM_H
2 24
 #define UNRAR_PPM_H 1
3 25
 
... ...
@@ -1,3 +1,25 @@
1
+/*
2
+ *  Extract RAR archives
3
+ *
4
+ *  Copyright (C) 2005 trog@uncon.org
5
+ *
6
+ *  This code is based on the work of Alexander L. Roshal
7
+ *
8
+ *  This program is free software; you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation; either version 2 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program; if not, write to the Free Software
20
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ */
22
+
1 23
 #include <string.h>
2 24
 
3 25
 #include "unrar.h"
... ...
@@ -1,3 +1,25 @@
1
+/*
2
+ *  Extract RAR archives
3
+ *
4
+ *  Copyright (C) 2005 trog@uncon.org
5
+ *
6
+ *  This code is based on the work of Alexander L. Roshal
7
+ *
8
+ *  This program is free software; you can redistribute it and/or modify
9
+ *  it under the terms of the GNU General Public License as published by
10
+ *  the Free Software Foundation; either version 2 of the License, or
11
+ *  (at your option) any later version.
12
+ *
13
+ *  This program is distributed in the hope that it will be useful,
14
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
+ *  GNU General Public License for more details.
17
+ *
18
+ *  You should have received a copy of the GNU General Public License
19
+ *  along with this program; if not, write to the Free Software
20
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21
+ */
22
+
1 23
 #ifndef _RAR_VM_
2 24
 #define _RAR_VM_
3 25