Lines Matching defs:zp

99 static	int	parsedir (const char *dir, zone_t **zp, const zconf_t *conf);
100 static int dosigning (zone_t *zonelist, zone_t *zp);
104 static int sign_zone (const zone_t *zp);
144 zone_t *zp;
258 for ( zp = zonelist; zp; zp = zp->next )
259 zone_print ("in main: ", zp);
323 for ( zp = zonelist; zp; zp = zp->next )
324 if ( in_strarr (zp->zone, &argv[optind], argc - optind) )
326 dosigning (zonelist, zp);
327 verbmesg (1, zp->conf, "\n");
428 static int parsedir (const char *dir, zone_t **zp, const zconf_t *conf)
439 zone_readdir (dir, NULL, NULL, zp, conf, dynamic_zone);
455 parsedir (path, zp, conf);
461 static int dosigning (zone_t *zonelist, zone_t *zp)
473 verbmesg (1, zp->conf, "parsing zone \"%s\" in dir \"%s\"\n", zp->zone, zp->dir);
475 pathname (path, sizeof (path), zp->dir, zp->sfile, NULL);
479 error ("Not a secure zone directory (%s)!\n", zp->dir);
480 lg_mesg (LG_ERROR, "\"%s\": not a secure zone directory (%s)!", zp->zone, zp->dir);
485 pathname (path, sizeof (path), zp->dir, zp->file, NULL);
490 lg_mesg (LG_ERROR, "\"%s\": no zone file found (%s)!", zp->zone, path);
498 if ( is_defined (zp->conf->logdomaindir) ) /* parameter is not null or empty ? */
500 if ( strcmp (zp->conf->logdomaindir, ".") == 0 ) /* current (".") means zone directory */
501 lg_zone_start (zp->dir, zp->zone);
503 lg_zone_start (zp->conf->logdomaindir, zp->zone);
508 newkey = ksk5011status (&zp->keys, zp->dir, zp->zone, zp->conf);
511 verbmesg (2, zp->conf, "\t\t->not a rfc5011 zone, looking for a regular ksk rollover\n");
514 newkey |= kskstatus (zonelist, zp);
521 newkey += zskstatus (&zp->keys, zp->dir, zp->zone, zp->conf);
524 pathname (path, sizeof (path), zp->dir, zp->conf->keyfile, NULL);
527 newkey = check_keydb_timestamp (zp->keys, file_mtime (path));
533 newkeysetfile = new_keysetfiles (zp->dir, zfilesig_time);
536 if ( !newkey && zp->conf->keysetdir && strcmp (zp->conf->keysetdir, "..") == 0 )
537 newkeysetfile = new_keysetfiles (zp->dir, zfilesig_time);
560 else if ( (currtime - zfilesig_time) > zp->conf->resign - (OFFSET) )
562 str_delspace (age2str (zp->conf->resign)));
567 verbmesg (1, zp->conf, "\tRe-signing necessary: %s\n", mesg);
569 verbmesg (1, zp->conf, "\tRe-signing not necessary!\n");
572 lg_mesg (LG_NOTICE, "\"%s\": re-signing triggered: %s", zp->zone, mesg);
577 (currtime - zfilesig_time) > zp->conf->resign - (OFFSET) ||
580 verbmesg (2, zp->conf, "\tCheck if there is a parent file to copy\n");
581 if ( zp->conf->keysetdir && strcmp (zp->conf->keysetdir, "..") == 0 )
582 copy_keyset (zp->dir, zp->zone, zp->conf); /* copy the parent- file if it exist */
583 if ( is_defined (zp->conf->logdomaindir) )
592 pathname (path, sizeof (path), zp->dir, zp->conf->keyfile, NULL);
593 verbmesg (1, zp->conf, "\tWriting key file \"%s\"\n", path);
594 if ( !writekeyfile (path, zp->keys, zp->conf->key_ttl) )
597 lg_mesg (LG_ERROR, "\"%s\": can't create keyfile %s", zp->zone , path);
601 use_unixtime = ( zp->conf->serialform == Unixtime );
609 pathname (path, sizeof (path), zp->dir, zp->file, NULL);
616 zp->zone, path, inc_errstr (err));
619 zp->zone, path, inc_errstr (err));
622 verbmesg (1, zp->conf, "\tIncrementing serial number in file \"%s\"\n", path);
625 verbmesg (1, zp->conf, "\tIncrementing serial number in file \"%s\"\n", path);
633 verbmesg (1, zp->conf, "\tSigning zone \"%s\"\n", zp->zone);
642 dyn_update_freeze (zp->zone, zp->conf, 1); /* freeze dynamic zone ! */
644 pathname (zfile, sizeof (zfile), zp->dir, zp->file, NULL);
645 pathname (path, sizeof (path), zp->dir, zp->sfile, NULL);
648 verbmesg (1, zp->conf, "\tDynamic Zone signing: Initial signing request: Add DNSKEYs to zonefile\n");
649 copyfile (zfile, path, zp->conf->keyfile);
654 verbmesg (1, zp->conf, "\tDynamic Zone signing: zone file manually edited: Use it as new input file\n");
658 verbmesg (1, zp->conf, "\tDynamic Zone signing: copy old signed zone file %s to new input file %s\n",
663 copyzonefile (path, zfile, zp->conf->keyfile);
665 if ( zp->conf->dist_cmd )
666 dist_and_reload (zp, 2); /* ... and send to the name server */
674 if ( (err = sign_zone (zp)) < 0 )
676 error ("\tSigning of zone %s failed (%d)!\n", zp->zone, err);
677 lg_mesg (LG_ERROR, "\"%s\": signing failed!", zp->zone);
682 dyn_update_freeze (zp->zone, zp->conf, 0); /* thaw dynamic zone file */
690 verbmesg (1, zp->conf, "\tSigning completed after %s.\n", tstr);
694 copy_keyset (zp->dir, zp->zone, zp->conf);
698 if ( zp->conf->dist_cmd )
699 dist_and_reload (zp, 1);
701 reload_zone (zp->zone, zp->conf);
703 register_key (zp->keys, zp->conf);
706 if ( is_defined (zp->conf->logdomaindir) )
825 static int sign_zone (const zone_t *zp)
844 assert (zp != NULL);
845 dir = zp->dir;
846 domain = zp->zone;
847 file = zp->file;
848 conf = zp->conf;
910 kp = dki_find (zp->keys, DKI_ZSK, DKI_ACTIVE, 1);