Your message dated Sun, 10 Dec 2006 00:17:08 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#399750: fixed in rpm 4.4.1-14
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: rpm
Severity: important
Version: 4.4.1-12
Tags: patch

Hi,

the current version still fails to build on GNU/kFreeBSD.
Unfortunately excluding libselinux1-dev from build-dep is not sufficient.

Enclosed please find two patches
11-matchpathcon.diff.noselinux and 21-kfreebsd.diff.
Current 11-matchpathcon.diff breaks non-selinux architectures.
So please revert the current one, replace with attached one and reapply.
After that please also add 21-kfreebsd.diff.

The 21-kfreebsd.diff have been sent to [EMAIL PROTECTED]
It should be included in (future) rpm-4.4.8 release available at http://wraptastic.org/pub/rpm-4.4.x/

Thanks in advance

                        Petr
diff -wur a/build/Makefile.am b/build/Makefile.am
--- a/build/Makefile.am 2006-11-21 21:04:26.000000000 +0100
+++ b/build/Makefile.am 2006-11-21 21:02:30.000000000 +0100
@@ -35,6 +35,7 @@
        $(top_builddir)/lib/librpm.la \
        $(top_builddir)/rpmdb/librpmdb.la \
        $(top_builddir)/rpmio/librpmio.la \
+       @WITH_SELINUX_LIB@ \
        @WITH_LIBELF_LIB@
 
 rpmfile.h:
diff -wur a/build/files.c b/build/files.c
--- a/build/files.c     2006-11-21 21:04:26.000000000 +0100
+++ b/build/files.c     2006-11-21 21:02:30.000000000 +0100
@@ -23,7 +23,11 @@
 #define        _RPMFI_INTERNAL
 #include "rpmfi.h"
 
+#ifdef WITH_SELINUX
+#include <selinux/selinux.h>
+#else
 #include "rpmsx.h"
+#endif
 
 #define        _RPMTE_INTERNAL
 #include "rpmte.h"
@@ -1122,7 +1126,11 @@
     int apathlen = 0;
     int dpathlen = 0;
     int skipLen = 0;
+#ifdef WITH_SELINUX    
+    security_context_t scon = NULL;
+#else
     rpmsx sx = NULL;
+#endif
     const char * sxfn;
     size_t fnlen;
     FileListRec flp;
@@ -1142,7 +1150,11 @@
 
     sxfn = rpmGetPath("%{?_build_file_context_path}", NULL);
     if (sxfn != NULL && *sxfn != '\0')
+#ifdef WITH_SELINUX    
+       matchpathcon_init(sxfn);
+#else
        sx = rpmsxNew(sxfn);
+#endif
 
     for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) {
        const char *s;
@@ -1324,7 +1336,18 @@
                               &(flp->flags), 1);
 
        /* Add file security context to package. */
-/[EMAIL PROTECTED]@*/
+#ifdef WITH_SELINUX    
+       mode_t fmode = (uint_16)flp->fl_mode;
+       int rc = matchpathcon(flp->fileURL, fmode, &scon);
+        if ( rc == 0 && scon != NULL) {
+           (void) headerAddOrAppendEntry(h, RPMTAG_FILECONTEXTS, 
RPM_STRING_ARRAY_TYPE, &scon, 1);
+           freecon(scon);
+        }
+        else  {
+            const char *nocon = "";
+           (void) headerAddOrAppendEntry(h, RPMTAG_FILECONTEXTS, 
RPM_STRING_ARRAY_TYPE, &nocon, 1);
+        }
+#else
        if (sx != NULL) {
            mode_t fmode = (uint_16)flp->fl_mode;
            s = rpmsxFContext(sx, flp->fileURL, fmode);
@@ -1332,10 +1355,12 @@
            (void) headerAddOrAppendEntry(h, RPMTAG_FILECONTEXTS, 
RPM_STRING_ARRAY_TYPE,
                               &s, 1);
        }
-/[EMAIL PROTECTED]@*/
-
+#endif
     }
+#ifdef WITH_SELINUX    
+#else
     sx = rpmsxFree(sx);
+#endif
     sxfn = _free(sxfn);
 
     (void) headerAddEntry(h, RPMTAG_SIZE, RPM_INT32_TYPE,
diff -wur a/lib/fsm.c b/lib/fsm.c
--- a/lib/fsm.c 2006-11-21 21:04:26.000000000 +0100
+++ b/lib/fsm.c 2006-11-21 21:02:30.000000000 +0100
@@ -634,12 +634,20 @@
     if (ts != NULL && rpmtsSELinuxEnabled(ts) == 1 &&
        !(rpmtsFlags(ts) & RPMTRANS_FLAG_NOCONTEXTS))
     {
+#ifdef WITH_SELINUX      
+       security_context_t scon = NULL;
+
+       if ( matchpathcon(fsm->path, st->st_mode, &scon) == 0 && scon != NULL) {
+           /* Get file security context from patterns. */
+           fsm->fcontext = scon;
+#else
        rpmsx sx = rpmtsREContext(ts);
 
        if (sx != NULL) {
            /* Get file security context from patterns. */
            fsm->fcontext = rpmsxFContext(sx, fsm->path, st->st_mode);
            sx = rpmsxFree(sx);
+#endif                     
        } else {
            int i = fsm->ix;
 
diff -wur a/lib/rpmfi.c b/lib/rpmfi.c
--- a/lib/rpmfi.c       2006-11-21 21:04:26.000000000 +0100
+++ b/lib/rpmfi.c       2006-11-21 21:08:33.000000000 +0100
@@ -16,7 +16,11 @@
 #define        _RPMFI_INTERNAL
 #include "rpmfi.h"
 
+#ifdef WITH_SELINUX   
+#include <selinux/selinux.h>
+#else
 #include "rpmsx.h"
+#endif
 
 #define        _RPMTE_INTERNAL /* relocations */
 #include "rpmte.h"
@@ -1645,7 +1649,11 @@
 {
     int scareMem = 0;
     rpmfi fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, scareMem);
+#ifdef WITH_SELINUX    
+    const char * myfn = rpmGetPath("%{?__file_context_path}", NULL);
+#else
     rpmsx sx = NULL;
+#endif    
     const char ** av = NULL;
     int ac;
     size_t nb;
@@ -1660,7 +1668,11 @@
     }
 
     /* Read security context patterns. */
+#ifdef WITH_SELINUX     
+    matchpathcon_init(myfn);
+#else
     sx = rpmsxNew(NULL);
+#endif
 
     /* Compute size of argv array blob, concatenating file contexts. */
     nb = ac * sizeof(*fcnb);
@@ -1671,10 +1683,16 @@
     while (rpmfiNext(fi) >= 0) {
        const char * fn = rpmfiFN(fi);
        mode_t fmode = rpmfiFMode(fi);
+#ifdef WITH_SELINUX    
+       security_context_t scon;
+
+       if (matchpathcon(fn, fmode, &scon) == 0) {
+#else
        const char * scon;
 
        scon = rpmsxFContext(sx, fn, fmode);
        if (scon != NULL) {
+#endif
            fcnb[ac] = strlen(scon) + 1;
 /[EMAIL PROTECTED]@*/
            if (fcnb[ac] > 0) {
@@ -1682,6 +1700,9 @@
                memcpy(fctxt+fctxtlen, scon, fcnb[ac]);
                fctxtlen += fcnb[ac];
            }
+#ifdef WITH_SELINUX        
+            freecon(scon); 
+#endif            
 /[EMAIL PROTECTED]@*/
        }
        ac++;
@@ -1707,7 +1728,10 @@
 
 exit:
     fi = rpmfiFree(fi);
+#ifdef WITH_SELINUX    
+#else
     sx = rpmsxFree(sx);
+#endif
     /[EMAIL PROTECTED]@*/
     if (fcontextp)
        *fcontextp = av;
diff -wur a/lib/rpminstall.c b/lib/rpminstall.c
--- a/lib/rpminstall.c  2006-11-21 21:04:26.000000000 +0100
+++ b/lib/rpminstall.c  2006-11-21 21:02:30.000000000 +0100
@@ -310,6 +310,12 @@
 
     /* Initialize security context patterns (if not already done). */
     if (!(ia->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
+#ifdef WITH_SELINUX    
+            const char *fn = rpmGetPath("%{?_install_file_context_path}", 
NULL);
+            if (fn != NULL && *fn != '\0') {
+                    matchpathcon_init(fn);
+            }
+#else
        rpmsx sx = rpmtsREContext(ts);
        if (sx == NULL) {
            const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
@@ -320,6 +326,7 @@
            fn = _free(fn);
        }
        sx = rpmsxFree(sx);
+#endif
     }
     (void) rpmtsSetFlags(ts, ia->transFlags);
 
diff -wur a/lib/verify.c b/lib/verify.c
--- a/lib/verify.c      2006-11-21 21:04:26.000000000 +0100
+++ b/lib/verify.c      2006-11-21 21:09:05.000000000 +0100
@@ -128,6 +128,20 @@
        if (rc == -1)
            *res |= (RPMVERIFY_LGETFILECONFAIL|RPMVERIFY_CONTEXTS);
        else {
+#ifdef WITH_SELINUX    
+           security_context_t fcontext;
+             
+           /* Get file security context from patterns. */
+           if (matchpathcon(fn,fmode,&fcontext) != 0)  {
+               /* Get file security context from package. */
+               fcontext = rpmfiFContext(fi);
+           }
+
+           if (fcontext == NULL || strcmp(fcontext, con))
+               *res |= RPMVERIFY_CONTEXTS;
+           freecon(con);
+           freecon(fcontext); 
+#else
            rpmsx sx = rpmtsREContext(ts);
            const char * fcontext;
 
@@ -142,6 +156,7 @@
            if (fcontext == NULL || strcmp(fcontext, con))
                *res |= RPMVERIFY_CONTEXTS;
            freecon(con);
+#endif            
        }
     }
 /[EMAIL PROTECTED]@*/
@@ -524,6 +539,13 @@
 
     /* Initialize security context patterns (if not already done). */
     if (qva->qva_flags & VERIFY_CONTEXTS) {
+#ifdef WITH_SELINUX    
+       arg = rpmGetPath("%{?_verify_file_context_path}", NULL);
+       if (arg != NULL && *arg != '\0') {
+           matchpathcon_init(arg);     
+          }
+       arg = _free(arg);
+#else
        rpmsx sx = rpmtsREContext(ts);
        if (sx == NULL) {
            arg = rpmGetPath("%{?_verify_file_context_path}", NULL);
@@ -534,6 +556,7 @@
            arg = _free(arg);
        }
        sx = rpmsxFree(sx);
+#endif
     }
 
     ovsflags = rpmtsSetVSFlags(ts, vsflags);
diff -wur a/python/Makefile.am b/python/Makefile.am
--- a/python/Makefile.am        2006-11-21 21:04:26.000000000 +0100
+++ b/python/Makefile.am        2006-11-21 21:02:30.000000000 +0100
@@ -34,6 +34,7 @@
        $(top_builddir)/rpmio/librpmio.la \
        $(top_builddir)/popt/libpopt.la \
        $(top_builddir)/build/librpmbuild.la \
+       @WITH_SELINUX_LIB@ \
        @WITH_LIBELF_LIB@
 
 LDADD =
diff -wur a/python/rpmts-py.c b/python/rpmts-py.c
--- a/python/rpmts-py.c 2006-11-21 21:04:26.000000000 +0100
+++ b/python/rpmts-py.c 2006-11-21 21:02:30.000000000 +0100
@@ -1182,6 +1182,13 @@
 
     /* Initialize security context patterns (if not already done). */
     if (!(s->ts->transFlags & RPMTRANS_FLAG_NOCONTEXTS)) {
+#ifdef WITH_SELINUX    
+       const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
+       if (fn != NULL && *fn != '\0') {
+                matchpathcon_init(fn);
+       }
+       fn = _free(fn);
+#else
        rpmsx sx = rpmtsREContext(s->ts);
        if (sx == NULL) {
            const char *fn = rpmGetPath("%{?_install_file_context_path}", NULL);
@@ -1192,6 +1199,7 @@
            fn = _free(fn);
        }
        sx = rpmsxFree(sx);
+#endif
     } 
 
 if (_rpmts_debug)
--- rpm-4.4.1/rpmio/rpmdav.c~   2006-11-20 12:16:47.000000000 +0100
+++ rpm-4.4.1/rpmio/rpmdav.c    2006-11-20 12:16:47.000000000 +0100
@@ -1406,7 +1406,7 @@
     dp->d_reclen = 0;          /* W2DO? */
 
 #if !defined(hpux) && !defined(sun)
-#if !defined(__APPLE__)
+#if !defined(__APPLE__) && !defined(__FreeBSD_kernel__)
     dp->d_off = 0;             /* W2DO? */
 #endif
 /[EMAIL PROTECTED]@*/
@@ -1530,7 +1530,7 @@
     dp->d_reclen = 0;          /* W2DO? */
 
 #if !defined(hpux) && !defined(sun)
-#if !defined(__APPLE__)
+#if !defined(__APPLE__) && !defined(__FreeBSD_kernel__)
     dp->d_off = 0;             /* W2DO? */
 #endif
 /[EMAIL PROTECTED]@*/

--- End Message ---
--- Begin Message ---
Source: rpm
Source-Version: 4.4.1-14

We believe that the bug you reported is fixed in the latest version of
rpm, which is due to be installed in the Debian FTP archive:

librpm-dev_4.4.1-14_i386.deb
  to pool/main/r/rpm/librpm-dev_4.4.1-14_i386.deb
librpm4_4.4.1-14_i386.deb
  to pool/main/r/rpm/librpm4_4.4.1-14_i386.deb
lsb-rpm_4.4.1-14_i386.deb
  to pool/main/r/rpm/lsb-rpm_4.4.1-14_i386.deb
python-rpm_4.4.1-14_i386.deb
  to pool/main/r/rpm/python-rpm_4.4.1-14_i386.deb
rpm_4.4.1-14.diff.gz
  to pool/main/r/rpm/rpm_4.4.1-14.diff.gz
rpm_4.4.1-14.dsc
  to pool/main/r/rpm/rpm_4.4.1-14.dsc
rpm_4.4.1-14_i386.deb
  to pool/main/r/rpm/rpm_4.4.1-14_i386.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Anibal Monsalve Salazar <[EMAIL PROTECTED]> (supplier of updated rpm package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sun, 10 Dec 2006 09:32:59 +1100
Source: rpm
Binary: python-rpm rpm librpm-dev lsb-rpm librpm4
Architecture: source i386
Version: 4.4.1-14
Distribution: unstable
Urgency: medium
Maintainer: Anibal Monsalve Salazar <[EMAIL PROTECTED]>
Changed-By: Anibal Monsalve Salazar <[EMAIL PROTECTED]>
Description: 
 librpm-dev - RPM shared library, development kit
 librpm4    - RPM shared library
 lsb-rpm    - Red Hat package manager for LSB package building
 python-rpm - Python bindings for RPM
 rpm        - Red Hat package manager
Closes: 399208 399750
Changes: 
 rpm (4.4.1-14) unstable; urgency=medium
 .
   * Fixed FTBFS on non-linux archs: build-depends on
     libselinux1-dev. Closes: #399208. Patch by Konstantinos
     Koukopoulos <[EMAIL PROTECTED]>.
   * Fixed FTBFS on GNU/kFreeBSD. Closes: #399750.
     Patches by Petr Salinger <[EMAIL PROTECTED]>.
     Removed: 11-matchpathcon.diff
     Added: 11-matchpathcon.noselinux.diff and 21-kfreebsd.diff
Files: 
 5777cffbb3efa5dad6c24041a27f59fe 1036 admin optional rpm_4.4.1-14.dsc
 602c40871f2f85ce3ff2212431bbce01 241795 admin optional rpm_4.4.1-14.diff.gz
 7e79fdc48550f16d3f7dfe9889b2ee00 829750 admin optional rpm_4.4.1-14_i386.deb
 33938bae797afaecfb0dc6ff917310d0 2463140 devel optional 
lsb-rpm_4.4.1-14_i386.deb
 489f21cdc5189ed601b8541b6affceb5 978192 libs optional librpm4_4.4.1-14_i386.deb
 469091a82a2166ec9c7147b6ac8defd2 1310398 libdevel extra 
librpm-dev_4.4.1-14_i386.deb
 a6cbe9fe7b2be5ebc2548bd64ba38f61 496876 python extra 
python-rpm_4.4.1-14_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFFe01VipBneRiAKDwRAjDDAKC3Hz9hUqKlQAd9CPStY8jbCKgUAQCffBBI
PyvNUOxszwN+vp8hASrUCbg=
=skR3
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to