Commit 2edb7ae
committed
Return success for empty check-trustdb
fapolicyd-cli --check-trustdb could not distinguish an empty trust database from a database walk failure because walk_database_start() returned the same non-zero value for both cases. That made an empty trust database look like CLI_EXIT_DB_ERROR.
The database walk API now has explicit success, error, and empty statuses. The walk start path closes the database before returning empty or error, and --check-trustdb maps the empty status to CLI_EXIT_SUCCESS while preserving database errors for real failures.1 parent a6971d1 commit 2edb7ae
3 files changed
Lines changed: 28 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
929 | 929 | | |
930 | 930 | | |
931 | 931 | | |
| 932 | + | |
| 933 | + | |
932 | 934 | | |
933 | 935 | | |
934 | 936 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6082 | 6082 | | |
6083 | 6083 | | |
6084 | 6084 | | |
6085 | | - | |
| 6085 | + | |
6086 | 6086 | | |
6087 | 6087 | | |
6088 | 6088 | | |
6089 | 6089 | | |
6090 | 6090 | | |
6091 | 6091 | | |
6092 | 6092 | | |
6093 | | - | |
| 6093 | + | |
6094 | 6094 | | |
6095 | | - | |
| 6095 | + | |
| 6096 | + | |
6096 | 6097 | | |
6097 | | - | |
| 6098 | + | |
| 6099 | + | |
| 6100 | + | |
| 6101 | + | |
| 6102 | + | |
6098 | 6103 | | |
6099 | 6104 | | |
6100 | 6105 | | |
6101 | 6106 | | |
6102 | 6107 | | |
6103 | | - | |
| 6108 | + | |
| 6109 | + | |
6104 | 6110 | | |
6105 | 6111 | | |
6106 | 6112 | | |
6107 | 6113 | | |
6108 | 6114 | | |
6109 | | - | |
| 6115 | + | |
6110 | 6116 | | |
6111 | | - | |
| 6117 | + | |
6112 | 6118 | | |
| 6119 | + | |
| 6120 | + | |
| 6121 | + | |
| 6122 | + | |
| 6123 | + | |
6113 | 6124 | | |
6114 | 6125 | | |
6115 | | - | |
| 6126 | + | |
| 6127 | + | |
6116 | 6128 | | |
6117 | 6129 | | |
6118 | 6130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
84 | 90 | | |
85 | 91 | | |
86 | 92 | | |
| |||
0 commit comments