On 18 August 2014 10:44, Panu Matilainen <pmati...@redhat.com> wrote:
> As usual, the full details & download info are at
>
>     http://rpm.org/wiki/Releases/4.12.0

The attached program shows a regression that is affecting URPM.
Now Fclose() returns -2 in the same code path where rpm-4.11.x returned 0:


# RPM-4.11:
$ gcc -D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe
-fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wall
-Wextra -fno-strict-aliasing -DRPM490 -O2 -g -pipe -Wformat
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
--param=ssp-buffer-size=4 -fPIC -lrpm -lrpmio -lrpmbuild t.c -o tt
&&./tt
Fclose() ==0
START=1; END=

# RPM-4.12:
$ ./tt
Fclose() ==-2
close() 1 => OK=0
NOT OK


(just put any compressed string in the target path.eg: "echo toto
|xz>t/synthesis.sample-xz.cz")
#include <sys/utsname.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <unistd.h>
#include <libintl.h>
#include <stdio.h>

#include <string.h>
#include <stdlib.h>
#include <errno.h>

#include <rpm/rpmio.h>
#include <rpm/rpmdb.h>
#include <rpm/rpmts.h>
#include <rpm/rpmte.h>
#include <rpm/rpmps.h>
#include <rpm/rpmpgp.h>
#include <rpm/rpmcli.h>
#include <rpm/rpmbuild.h>
#include <rpm/rpmlog.h>


// fix compiling (error: conflicting types for ‘fflush’):
#undef Fflush
#undef Mkdir
#undef Stat
#undef Fstat


int main () {
  char *filename = "./t/synthesis.sample-xz.cz";
  FD_t f = NULL;
  char *t;
  int start_id = 1;
  rpmCompressedMagic compressed = COMPRESSED_OTHER;

  int rc = rpmFileIsCompressed (filename, &compressed);

  switch (compressed) {
  case COMPRESSED_BZIP2:
    t = "r.bzip2";
    break;
  case COMPRESSED_LZMA:
  case COMPRESSED_XZ:
    t = "r.xz";
    break;
  case COMPRESSED_OTHER:
  default:
    t = "r.gzip";
    break;
  }
  f = Fopen (filename, "r.fdio");

  int ok = 1;
  if (!rc && (f = Fdopen (f, t)) != NULL && !Ferror (f)) {
    int res = Fclose (f);
    fprintf (stderr, "Fclose() ==%d\n", res);
    if (res != 0) {
      ok = 0;
      fprintf (stderr, "close() 1 => OK=0\n");
    }
    if (ok)
      printf ("START=%d; END=\n", start_id);
    else
      fprintf (stderr, "NOT OK\n");
  }
}
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to