78 char* temp_date = NULL;
79 char* temp_pre_date = NULL;
80 char* temp_repo = NULL;
81 int temp_backup_req = 0;
84 StrAppend(&sql,
"select distinct k.backup, s.name, k.pre_backup from keypairs k, securitymodules s ");
85 StrAppend(&sql,
"where s.id = k.securitymodule_id ");
99 if (verbose_flag == 1) {
100 printf(
"Pre Backup Date: Backup Date: Repository:\n");
102 printf(
"Date: Repository:\n");
104 while (status == 0) {
110 if (verbose_flag == 1) {
111 if (temp_date != NULL || temp_pre_date != NULL) {
112 printf(
"%-24s %-24s %s\n", temp_pre_date, temp_date, temp_repo);
115 if (temp_date != NULL) {
116 printf(
"%-24s %s\n", temp_date, temp_repo);
141 StrAppend(&sql2,
"select s.name, s.requirebackup from keypairs k, securitymodules s ");
142 StrAppend(&sql2,
"where s.id = k.securitymodule_id ");
148 StrAppend(&sql2,
" and k.backup is null");
149 StrAppend(&sql2,
" group by s.name order by s.name");
157 while (status == 0) {
160 DbInt(row2, 1, &temp_backup_req);
162 if (temp_backup_req == 0) {
163 printf(
"Repository %s has unbacked up keys (that can be used)\n", temp_repo);
165 printf(
"Repository %s has unbacked up keys (that will not be used)\n", temp_repo);
186 StrAppend(&sql3,
"select s.name from keypairs k, securitymodules s ");
187 StrAppend(&sql3,
"where s.id = k.securitymodule_id ");
193 StrAppend(&sql3,
" and k.backup is null");
194 StrAppend(&sql3,
" and k.pre_backup is not null");
195 StrAppend(&sql3,
" group by s.name order by s.name");
203 while (status == 0) {
207 printf(
"Repository %s has keys prepared for back up which have not been committed\n", temp_repo);
249 char* temp_name = NULL;
250 char* temp_cap = NULL;
254 StrAppend(&sql,
"select name, capacity, requirebackup from securitymodules ");
263 printf(
"Name: Capacity: RequireBackup:\n");
264 while (status == 0) {
268 DbInt(row, 2, &temp_back);
270 printf(
"%-32s %-12s %s\n", temp_name, (strlen(temp_cap) == 0) ?
"unset" : temp_cap, (temp_back == 0) ?
"No" :
"Yes");
313 char* temp_name = NULL;
314 char* temp_desc = NULL;
317 StrAppend(&sql,
"select name, description from policies ");
326 printf(
"Name: Description:\n");
327 while (status == 0) {
332 printf(
"%-32s %s\n", temp_name, (strlen(temp_desc) == 0) ?
"unset" : temp_desc);
377 char* temp_zone = NULL;
379 char* temp_date = NULL;
384 StrAppend(&sql,
"select z.name, k.keytype, k.retire, k.state from zones z, KEYDATA_VIEW k where z.id = k.zone_id and k.state in (3,4,7) ");
398 printf(
"Zone: Keytype: Rollover expected:\n");
399 while (status == 0) {
402 DbInt(row, 1, &temp_type);
404 DbInt(row, 3, &temp_state);
407 printf(
"%-31s %-13s %s\n", temp_zone, (temp_type ==
KSM_TYPE_KSK) ?
"KSK" :
"ZSK", (temp_date == NULL) ?
"(not scheduled)" : temp_date);
410 printf(
"%-31s %-13s %s\n", temp_zone,
"KSK",
"waiting for ds-seen");
431 *ds_count = local_count;