[rsbac] PATCH: rc_get_item/list_unused_*

Fix 4d876b82 at gmail.com
Sat Sep 8 10:19:28 CEST 2007


rc_get_item cannot correctly list_unused_*_nr on my system. The following patch fixes that.

// wbr
Fix
_____________

--- ./main/tools/src/rc_get_item.c.orig   2007-09-08 16:05:17.000000000 +0800
+++ ./main/tools/src/rc_get_item.c        2007-09-08 16:08:10.000000000 +0800
@@ -639,7 +639,8 @@
                 tid.role = j;
                 res = rsbac_rc_get_item(ta_number, RT_ROLE, &tid, &tid, item, &value, NULL);
               }
-            if((res == -1) && (errno == RSBAC_ENOTFOUND))
+            if((res == -1              && errno == RSBAC_ENOTFOUND) ||
+               (res == -RSBAC_ENOTFOUND && errno == 0 ))
               {
                 printf("%u\n", j);
                 res = 0;
@@ -694,7 +695,8 @@
                 tid.type = j;
                 res = rsbac_rc_get_item(ta_number, RT_TYPE, &tid, &tid, item, &value, NULL);
               }
-            if((res == -1) && (errno == RSBAC_ENOTFOUND))
+            if((res == -1              && errno == RSBAC_ENOTFOUND) ||
+               (res == -RSBAC_ENOTFOUND && errno == 0 ))
               {
                 printf("%u\n", j);
                 res = 0;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.rsbac.org/pipermail/rsbac/attachments/20070908/7628359c/attachment.pgp 


More information about the rsbac mailing list