]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- more
authorJakub Bogusz <qboosh@pld-linux.org>
Tue, 19 Jul 2005 19:03:38 +0000 (19:03 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-file-update.patch -> 1.2

rpm-file-update.patch

index 2c20128ec84ce6915019286ef5d88d0ba32d9072..3c6766c193915034f119b1d5af88eda0bb1a7dd9 100644 (file)
@@ -1,3 +1,179 @@
+--- rpm-4.4.1/file/src/apprentice.c.orig       2005-01-26 04:39:56.000000000 +0100
++++ rpm-4.4.1/file/src/apprentice.c    2005-07-19 20:52:58.981441608 +0200
+@@ -45,7 +45,7 @@
+ #endif
+ #ifndef       lint
+-FILE_RCSID("@(#)$Id$")
++FILE_RCSID("@(#)$Id$")
+ #endif        /* lint */
+ #define       EATAB {while (isascii((unsigned char) *l) && \
+@@ -74,13 +74,11 @@
+ #define MAXPATHLEN    1024
+ #endif
+-#define IS_STRING(t) ((t) == FILE_STRING || (t) == FILE_PSTRING || \
++#define IS_PLAINSTRING(t) ((t) == FILE_STRING || (t) == FILE_PSTRING || \
+     (t) == FILE_BESTRING16 || (t) == FILE_LESTRING16)
+-
+-/*@unchecked@*/
+-private size_t maxmagic = 0;
+-/*@unchecked@*/
+-private size_t magicsize = sizeof(struct magic);
++    
++#define IS_STRING(t) (IS_PLAINSTRING(t) || (t) == FILE_REGEX || \
++    (t) == FILE_SEARCH)
+ private int getvalue(struct magic_set *ms, struct magic *m, char **p)
+       /*@globals fileSystem @*/
+@@ -124,6 +122,12 @@
+       /*@globals fileSystem @*/
+       /*@modifies fileSystem @*/;
++
++/*@unchecked@*/
++private size_t maxmagic = 0;
++/*@unchecked@*/
++private size_t magicsize = sizeof(struct magic);
++
+ #ifdef COMPILE_ONLY
+ int main(int, char *[]);
+@@ -400,8 +404,8 @@
+               case FILE_PSTRING:
+               case FILE_BESTRING16:
+               case FILE_LESTRING16:
+-                      break;
+               case FILE_REGEX:
++              case FILE_SEARCH:
+                       break;
+               default:
+                       if (ms->flags & MAGIC_CHECK)
+@@ -451,9 +455,15 @@
+               m->cont_level++; 
+       }
++      if (m->cont_level != 0 && *l == '&') {
++                ++l;            /* step over */
++                m->flag |= OFFADD;
++        }
+       if (m->cont_level != 0 && *l == '(') {
+               ++l;            /* step over */
+               m->flag |= INDIR;
++              if (m->flag & OFFADD)
++                      m->flag = (m->flag & ~OFFADD) | INDIROFFADD;
+       }
+       if (m->cont_level != 0 && *l == '&') {
+                 ++l;            /* step over */
+@@ -506,7 +516,7 @@
+                       l++;
+               }
+               if (*l == '~') {
+-                      m->in_op = FILE_OPINVERSE;
++                      m->in_op |= FILE_OPINVERSE;
+                       l++;
+               }
+               switch (*l) {
+@@ -543,11 +553,16 @@
+                       l++;
+                       break;
+               }
+-              if (isdigit((unsigned char)*l)) 
+-                      m->in_offset = (uint32_t)strtoul(l, &t, 0);
++              if (*l == '(') {
++                      m->in_op |= FILE_OPINDIRECT;
++                      l++;
++              }
++              if (isdigit((unsigned char)*l) || *l == '-') 
++                      m->in_offset = (int32_t)strtol(l, &t, 0);
+               else
+                       t = l;
+-              if (*t++ != ')') 
++              if (*t++ != ')' ||
++                  ((m->in_op & FILE_OPINDIRECT) && *t++ != ')')) 
+                       if (ms->flags & MAGIC_CHECK)
+                               file_magwarn(ms,
+                                   "missing ')' in indirect offset");
+@@ -577,6 +592,7 @@
+ #define NREGEX                5
+ #define NBESTRING16   10
+ #define NLESTRING16   10
++#define NSEARCH               6
+       if (*l == 'u') {
+               ++l;
+@@ -641,6 +657,9 @@
+       } else if (strncmp(l, "lestring16", NLESTRING16)==0) {
+               m->type = FILE_LESTRING16;
+               l += NLESTRING16;
++      } else if (strncmp(l, "search", NSEARCH)==0) {
++              m->type = FILE_SEARCH;
++              l += NSEARCH;
+       } else {
+               if (ms->flags & MAGIC_CHECK)
+                       file_magwarn(ms, "type `%s' invalid", l);
+@@ -650,12 +669,12 @@
+       /* New and improved: ~ & | ^ + - * / % -- exciting, isn't it? */
+       if (*l == '~') {
+               if (!IS_STRING(m->type))
+-                      m->mask_op = FILE_OPINVERSE;
++                      m->mask_op |= FILE_OPINVERSE;
+               ++l;
+       }
+       if ((t = strchr(fops,  *l)) != NULL) {
+               uint32_t op = (uint32_t)(t - fops);
+-              if (op != FILE_OPDIVIDE || !IS_STRING(m->type)) {
++              if (op != FILE_OPDIVIDE || !IS_PLAINSTRING(m->type)) {
+                       ++l;
+                       m->mask_op |= op;
+                       val = (uint32_t)strtoul(l, &l, 0);
+@@ -683,6 +702,7 @@
+                                       return -1;
+                               }
+                       }
++                      ++l;
+               }
+       }
+       /*
+@@ -706,15 +726,12 @@
+               }
+               break;
+       case '!':
+-              if (!IS_STRING(m->type)) {
+-                      m->reln = *l;
+-                      ++l;
+-                      break;
+-              }
+-              /*@fallthrough@*/
++              m->reln = *l;
++              ++l;
++              break;
+       default:
+-              if (*l == 'x' && isascii((unsigned char)l[1]) && 
+-                  isspace((unsigned char)l[1])) {
++              if (*l == 'x' && ((isascii((unsigned char)l[1]) && 
++                  isspace((unsigned char)l[1])) || !l[1])) {
+                       m->reln = *l;
+                       ++l;
+                       goto GetDesc;   /* Bill The Cat */
+@@ -833,6 +850,7 @@
+       case FILE_STRING:
+       case FILE_PSTRING:
+       case FILE_REGEX:
++      case FILE_SEARCH:
+               *p = getstr(ms, *p, m->value.s, sizeof(m->value.s), &slen);
+               if (*p == NULL) {
+                       if (ms->flags & MAGIC_CHECK)
+@@ -1259,7 +1277,7 @@
+       m->cont_level = swap2(m->cont_level);
+       m->offset = swap4((uint32_t)m->offset);
+       m->in_offset = swap4((uint32_t)m->in_offset);
+-      if (IS_STRING(m->type))
++      if (!IS_STRING(m->type))
+               m->value.l = swap4(m->value.l);
+       m->mask = swap4(m->mask);
+ }
 --- rpm-4.4.1/file/src/file.h.orig     2005-01-03 00:11:30.000000000 +0100
 +++ rpm-4.4.1/file/src/file.h  2005-07-19 19:22:21.264100296 +0200
 @@ -27,7 +27,7 @@
This page took 0.118017 seconds and 4 git commands to generate.