118 sql =
DqsSpecifyInit(
"policies p, parameters_policies x, parameters y, categories c ",
"y.name, c.name, x.value");
208 else if (status == -1) {}
239 if (policy == NULL) {
251 while (status == 0) {
252 if (strncmp(data.
category,
"enforcer", 8) == 0) {
257 if (strncmp(data.
category,
"zone", 4) == 0) {
267 if (strncmp(data.
category,
"parent", 6) == 0) {
273 if (strncmp(data.
category,
"signature", 9) == 0) {
281 if (strncmp(data.
category,
"denial", 6) == 0) {
290 if (strncmp(data.
category,
"zsk", 3) == 0) {
293 if (strncmp(data.
name,
"repository",10) == 0) policy->
zsk->
sm=data.
value;
299 if (strncmp(data.
category,
"ksk", 3) == 0) {
302 if (strncmp(data.
name,
"repository",10) == 0) policy->
ksk->
sm=data.
value;
310 if (strncmp(data.
category,
"keys", 4) == 0) {
386 else if (status == -1) {}
432 if (policy == NULL) {
458 else if (status == -1) {}
505 char* hex_chars =
"0123456789abcdef";
508 if (policy == NULL) {
515 if (datetime_now == NULL) {
516 printf(
"Couldn't turn \"now\" into a date, quitting...\n");
553 else if (status == -1) {
593 #ifdef HAVE_ARC4RANDOM
595 salt[i] = hex_chars[arc4random()%strlen(hex_chars)];
600 salt[i] = hex_chars[rand()%strlen(hex_chars)];
616 nchar = snprintf(buffer,
sizeof(buffer),
617 "UPDATE policies SET salt = '%s', salt_stamp = '%s' WHERE ID = %lu",
620 nchar = snprintf(buffer,
sizeof(buffer),
621 "UPDATE policies SET salt = '%s', salt_stamp = DATETIME('%s') WHERE ID = %lu",
624 if (nchar <
sizeof(buffer)) {
681 nchar = snprintf(buffer,
sizeof(buffer),
682 "UPDATE policies SET salt_stamp = NULL WHERE ID = %lu",
683 (
unsigned long) policy_id);
685 if (nchar <
sizeof(buffer)) {
713 if (policy == NULL) {
740 else if (status == -1) {}
777 else if (status == -1) {}
809 if (policy == NULL || policy->
name[0] ==
'\0') {
822 else if (status == -1) {
885 DbInt(row, 1, policy_id);
887 else if (status == -1) {}
922 if (policy_id <= 0) {
950 if (policy == NULL) {
970 policy->
keys == NULL ||
971 policy->
ksk == NULL ||
972 policy->
zsk == NULL ||
974 policy->
zone == NULL ||