80 char* temp_date = NULL;
81 char* temp_pre_date = NULL;
82 char* temp_repo = NULL;
83 int temp_backup_req = 0;
86 StrAppend(&sql,
"select distinct k.backup, s.name, k.pre_backup from keypairs k, securitymodules s ");
87 StrAppend(&sql,
"where s.id = k.securitymodule_id ");
101 if (verbose_flag == 1) {
102 printf(
"Pre Backup Date: Backup Date: Repository:\n");
104 printf(
"Date: Repository:\n");
106 while (status == 0) {
112 if (verbose_flag == 1) {
113 if (temp_date != NULL || temp_pre_date != NULL) {
114 printf(
"%-24s %-24s %s\n", temp_pre_date, temp_date, temp_repo);
117 if (temp_date != NULL) {
118 printf(
"%-24s %s\n", temp_date, temp_repo);
143 StrAppend(&sql2,
"select s.name, s.requirebackup from keypairs k, securitymodules s ");
144 StrAppend(&sql2,
"where s.id = k.securitymodule_id ");
150 StrAppend(&sql2,
" and k.backup is null");
151 StrAppend(&sql2,
" group by s.name order by s.name");
159 while (status == 0) {
162 DbInt(row2, 1, &temp_backup_req);
164 if (temp_backup_req == 0) {
165 printf(
"Repository %s has unbacked up keys (that can be used)\n", temp_repo);
167 printf(
"Repository %s has unbacked up keys (that will not be used)\n", temp_repo);
188 StrAppend(&sql3,
"select s.name from keypairs k, securitymodules s ");
189 StrAppend(&sql3,
"where s.id = k.securitymodule_id ");
195 StrAppend(&sql3,
" and k.backup is null");
196 StrAppend(&sql3,
" and k.pre_backup is not null");
197 StrAppend(&sql3,
" group by s.name order by s.name");
205 while (status == 0) {
209 printf(
"Repository %s has keys prepared for back up which have not been committed\n", temp_repo);
251 char* temp_name = NULL;
252 char* temp_cap = NULL;
256 StrAppend(&sql,
"select name, capacity, requirebackup from securitymodules ");
265 printf(
"Name: Capacity: RequireBackup:\n");
266 while (status == 0) {
270 DbInt(row, 2, &temp_back);
272 printf(
"%-32s %-12s %s\n", temp_name, (strlen(temp_cap) == 0) ?
"unset" : temp_cap, (temp_back == 0) ?
"No" :
"Yes");
315 char* temp_name = NULL;
316 char* temp_desc = NULL;
319 StrAppend(&sql,
"select name, description from policies ");
328 printf(
"Name: Description:\n");
329 while (status == 0) {
334 printf(
"%-32s %s\n", temp_name, (strlen(temp_desc) == 0) ?
"unset" : temp_desc);
379 char* temp_zone = NULL;
381 char* temp_date = NULL;
384 StrAppend(&sql,
"select z.name, k.keytype, k.retire from zones z, KEYDATA_VIEW k where z.id = k.zone_id and k.state = 4 ");
398 printf(
"Zone: Keytype: Rollover expected:\n");
399 while (status == 0) {
402 DbInt(row, 1, &temp_type);
405 printf(
"%-31s %-13s %s\n", temp_zone, (temp_type ==
KSM_TYPE_KSK) ?
"KSK" :
"ZSK", (temp_date == NULL) ?
"(not scheduled)" : temp_date);