libsemanage/libsemanage-rhat.patch
2006-01-13 22:36:39 +00:00

46 lines
1.2 KiB
Diff

diff --exclude-from=exclude -N -u -r nsalibsemanage/src/fcontext_record.c libsemanage-1.5.9/src/fcontext_record.c
--- nsalibsemanage/src/fcontext_record.c 2006-01-06 10:33:10.000000000 -0500
+++ libsemanage-1.5.9/src/fcontext_record.c 2006-01-06 13:40:38.000000000 -0500
@@ -81,8 +81,18 @@
const semanage_fcontext_t* fcontext,
const semanage_fcontext_key_t* key) {
- return strcmp(fcontext->expr, key->expr) &&
- (fcontext->type == key->type);
+ int rv = strcmp(fcontext->expr, key->expr);
+ if (rv != 0)
+ return rv;
+ else {
+ if (fcontext->type < key->type)
+ return -1;
+
+ else if (key->type < fcontext->type)
+ return 1;
+
+ else return 0;
+ }
}
hidden_def(semanage_fcontext_compare)
@@ -90,8 +100,18 @@
const semanage_fcontext_t* fcontext,
const semanage_fcontext_t* fcontext2) {
- return strcmp(fcontext->expr, fcontext2->expr) &&
- (fcontext->type == fcontext2->type);
+ int rv = strcmp(fcontext->expr, fcontext2->expr);
+ if (rv != 0)
+ return rv;
+ else {
+ if (fcontext->type < fcontext2->type)
+ return -1;
+
+ else if (fcontext2->type < fcontext->type)
+ return 1;
+
+ else return 0;
+ }
}
hidden_def(semanage_fcontext_compare2)