[Rpm-maint] [PATCH 3/3] Reserving tags for MSSF

ext-tero.aho at nokia.com ext-tero.aho at nokia.com
Fri Jan 21 09:40:40 UTC 2011


- Adding MSSF manifest and domain tags into lib/rpmtag.h.
- Adding file attribute for the manifest file in lib/rpmfi.h.
  Note that it's exactly like RPMFILE_POLICY (and even has the
  same id) which was unfortunately removed in selinux collections
  plugin pathes.
---
 build/files.c         |   12 +++++++++++-
 build/parsePreamble.c |    1 +
 lib/rpmfi.h           |    1 +
 lib/rpmtag.h          |    2 ++
 4 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/build/files.c b/build/files.c
index 8d7fb2e..c86119c 100644
--- a/build/files.c
+++ b/build/files.c
@@ -847,6 +847,7 @@ static VFA_t virtualFileAttributes[] = {
     { "%readme",    0,    RPMFILE_README },
     { "%license",    0,    RPMFILE_LICENSE },
     { "%pubkey",    0,    RPMFILE_PUBKEY },
+    { "%mssf",    0,    RPMFILE_MSSF },
     { NULL, 0, 0 }
 };

@@ -914,7 +915,7 @@ static rpmRC parseForSimple(rpmSpec spec, Package pkg, char * buf,
         if (fl->currentFlags & RPMFILE_DOC) {
         rstrscat(&specialDocBuf, " ", s, NULL);
         } else
-        if (fl->currentFlags & RPMFILE_PUBKEY)
+        if (fl->currentFlags & (RPMFILE_PUBKEY|RPMFILE_MSSF))
         {
         *fileName = s;
         } else {
@@ -1612,6 +1613,13 @@ static rpmRC processMetadataFile(Package pkg, FileList fl,
     apkt = pgpArmorWrap(PGPARMOR_PUBKEY, pkt, pktlen);
     break;
     }
+    case RPMTAG_MSSFMANIFEST:
+    if ((xx = rpmioSlurp(fn, &pkt, &pktlen)) != 0 || pkt == NULL) {
+        rpmlog(RPMLOG_ERR, _("%s: MSSF manifest file read failed.\n"), fn);
+        goto exit;
+    }
+    apkt = b64encode(pkt, pktlen, -1);
+    break;
     }

     if (!apkt) {
@@ -1856,6 +1864,8 @@ static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
         dupAttrRec(&fl.cur_ar, specialDocAttrRec);
     } else if (fl.currentFlags & RPMFILE_PUBKEY) {
         (void) processMetadataFile(pkg, &fl, fileName, RPMTAG_PUBKEYS);
+    } else if (fl.currentFlags & RPMFILE_MSSF) {
+        (void) processMetadataFile(pkg, &fl, fileName, RPMTAG_MSSFMANIFEST);
     } else {
         (void) processBinaryFile(pkg, &fl, fileName);
     }
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index 3d8b859..44703c8 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -894,6 +894,7 @@ static struct PreambleRec_s const preambleList[] = {
     {RPMTAG_BUGURL,        0, 0, LEN_AND_STR("bugurl")},
     {RPMTAG_COLLECTIONS,    0, 0, LEN_AND_STR("collections")},
     {RPMTAG_ORDERFLAGS,        2, 0, LEN_AND_STR("orderwithrequires")},
+    {RPMTAG_MSSFMANIFEST,    0, 0, LEN_AND_STR("mssf")},
     {0, 0, 0, 0}
 };

diff --git a/lib/rpmfi.h b/lib/rpmfi.h
index 3dcf61b..56fb87e 100644
--- a/lib/rpmfi.h
+++ b/lib/rpmfi.h
@@ -60,6 +60,7 @@ enum rpmfileAttrs_e {
     RPMFILE_EXCLUDE    = (1 <<  9),    /*!< from %%exclude, internal */
     RPMFILE_UNPATCHED    = (1 << 10),    /*!< placeholder (SuSE) */
     RPMFILE_PUBKEY    = (1 << 11),    /*!< from %%pubkey */
+    RPMFILE_MSSF    = (1 << 12),    /*!< from %%mssf */
 };

 typedef rpmFlags rpmfileAttrs;
diff --git a/lib/rpmtag.h b/lib/rpmtag.h
index 50939c6..5e6b609 100644
--- a/lib/rpmtag.h
+++ b/lib/rpmtag.h
@@ -299,6 +299,8 @@ typedef enum rpmTag_e {
     RPMTAG_ORDERNAME        = 5035,    /* s[] */
     RPMTAG_ORDERVERSION        = 5036,    /* s[] */
     RPMTAG_ORDERFLAGS        = 5037,    /* i[] */
+    RPMTAG_MSSFMANIFEST        = 5038,    /* s[] mssf manifest file */
+    RPMTAG_MSSFDOMAIN        = 5039,    /* s[] mssf source domain */

     RPMTAG_FIRSTFREE_TAG    /*!< internal */
 } rpmTag;
--
1.7.2.3


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20110121/b8fc550a/attachment.html>


More information about the Rpm-maint mailing list