Copy attributes from parameter keys.
[u/mdw/catacomb] / keyutil.c
index 0251b43..13b8784 100644 (file)
--- a/keyutil.c
+++ b/keyutil.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: keyutil.c,v 1.24 2004/04/08 01:36:15 mdw Exp $
+ * $Id: keyutil.c,v 1.25 2004/04/21 00:38:22 mdw Exp $
  *
  * Simple key manager program
  *
@@ -248,6 +248,8 @@ static void mpkey(key_data *kd, const char *tag, mp *m, unsigned f)
 static int copyparam(keyopts *k, const char **pp)
 {
   key_filter kf;
+  key_attriter i;
+  const char *n, *v;
 
   /* --- Quick check if no parameters supplied --- */
 
@@ -271,6 +273,14 @@ static int copyparam(keyopts *k, const char **pp)
   kf.m = KF_CATMASK;
   if (!key_copy(&k->k->k, &k->p->k, &kf))
     die(EXIT_FAILURE, "unexpected failure while copying parameters");
+
+  /* --- Copy over attributes --- */
+
+  for (key_mkattriter(&i, k->p); key_nextattr(&i, &n, &v); )
+    key_putattr(k->kf, k->k, n, v);
+
+  /* --- Done --- */
+
   return (1);
 }