]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Allow trailings slashes for the filenames in deb packages
authorMichael Schroeder <mls@suse.de>
Tue, 1 Sep 2015 11:12:43 +0000 (13:12 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 1 Sep 2015 11:12:43 +0000 (13:12 +0200)
Trailing slashes ar used by sysv ar to allow spaces in
filenames...

ext/repo_deb.c

index 26c73b0feac774c9c4f96ec0c8d0b401cb2a5f31..35dcc8483b028ed1bd7ae9f2f887215055f1b0e1 100644 (file)
@@ -475,7 +475,7 @@ repo_add_deb(Repo *repo, const char *deb, int flags)
       return 0;
     }
   l = fread(buf, 1, sizeof(buf), fp);
-  if (l < 8 + 60 || strncmp((char *)buf, "!<arch>\ndebian-binary   ", 8 + 16) != 0)
+  if (l < 8 + 60 || (strncmp((char *)buf, "!<arch>\ndebian-binary   ", 8 + 16) != 0 && strncmp((char *)buf, "!<arch>\ndebian-binary/  ", 8 + 16) != 0))
     {
       pool_error(pool, -1, "%s: not a deb package", deb);
       fclose(fp);
@@ -495,7 +495,7 @@ repo_add_deb(Repo *repo, const char *deb, int flags)
       fclose(fp);
       return 0;
     }
-  if (strncmp((char *)buf + 8 + 60 + vlen, "control.tar.gz  ", 16) != 0)
+  if (strncmp((char *)buf + 8 + 60 + vlen, "control.tar.gz  ", 16) != 0 && strncmp((char *)buf + 8 + 60 + vlen, "control.tar.gz/ ", 16) != 0)
     {
       pool_error(pool, -1, "%s: control.tar.gz is not second entry", deb);
       fclose(fp);