- silently add default %defattr(-,root,root) for all packages.
authorjbj <devnull@localhost>
Wed, 13 Oct 2004 21:03:29 +0000 (21:03 +0000)
committerjbj <devnull@localhost>
Wed, 13 Oct 2004 21:03:29 +0000 (21:03 +0000)
CVS patchset: 7461
CVS date: 2004/10/13 21:03:29

CHANGES
build/files.c
lib/rpmds.c
lib/rpmds.h

diff --git a/CHANGES b/CHANGES
index d6887a8..10c6baf 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -14,6 +14,7 @@
        - python: add rpm.ps() object to carry problem set info.
        - python: permit rpm.ds() analogue to hdr.dsFromHeader() creator.
        - python: permit rpm.fi() analogue to hdr.fiFromHeader() creator.
+       - silently add default %defattr(-,root,root) for all packages.
 
 4.3.1 -> 4.3.2:
        - use /etc/selinux/targeted/contexts/files/file_contexts for now.
index d95d3ab..cd3c013 100644 (file)
@@ -93,14 +93,23 @@ typedef struct FileListRec_s {
 /**
  */
 typedef struct AttrRec_s {
+/*@null@*/
     const char *ar_fmodestr;
+/*@null@*/
     const char *ar_dmodestr;
+/*@null@*/
     const char *ar_user;
+/*@null@*/
     const char *ar_group;
     mode_t     ar_fmode;
     mode_t     ar_dmode;
 } * AttrRec;
 
+/*@-readonlytrans@*/
+/*@unchecked@*/ /*@observer@*/
+static struct AttrRec_s root_ar = { NULL, NULL, "root", "root", 0, 0 };
+/*@=readonlytrans@*/
+
 /* list of files */
 /*@unchecked@*/ /*@only@*/ /*@null@*/
 static StringBuf check_fileList = NULL;
@@ -1991,6 +2000,7 @@ static int processPackageFiles(Spec spec, Package pkg,
 
     nullAttrRec(&fl.cur_ar);
     nullAttrRec(&fl.def_ar);
+    dupAttrRec(&root_ar, &fl.def_ar);  /* XXX assume %defattr(-,root,root) */
 
     fl.defVerifyFlags = RPMVERIFY_ALL;
     fl.nLangs = 0;
index 9149466..a668a6c 100644 (file)
@@ -854,7 +854,7 @@ assert(ods->Flags != NULL);
 
 }
 
-int rpmdsFind(rpmds ds, rpmds ods)
+int rpmdsFind(rpmds ds, const rpmds ods)
 {
     int comparison;
 
index 96a275c..124456c 100644 (file)
@@ -331,8 +331,8 @@ rpmds rpmdsInit(/*@null@*/ rpmds ds)
  * @return             dependency index (or -1 if not found)
  */
 /*@null@*/
-int rpmdsFind(rpmds ds, /*@null@*/ rpmds ods)
-       /*@modifies ds, ods @*/;
+int rpmdsFind(rpmds ds, /*@null@*/ const rpmds ods)
+       /*@modifies ds @*/;
 
 /**
  * Merge a dependency set maintaining (N,EVR,Flags) sorted order.