projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release 2.1.2.
[u/mdw/catacomb]
/
keyutil.c
diff --git
a/keyutil.c
b/keyutil.c
index
bae57cf
..
cca075f
100644
(file)
--- a/
keyutil.c
+++ b/
keyutil.c
@@
-29,6
+29,8
@@
/*----- Header files ------------------------------------------------------*/
/*----- Header files ------------------------------------------------------*/
+#define _FILE_OFFSET_BITS 64
+
#include "config.h"
#include <ctype.h>
#include "config.h"
#include <ctype.h>
@@
-235,8
+237,12
@@
static int copyparam(keyopts *k, const char **pp)
{
key_filter kf;
key_attriter i;
{
key_filter kf;
key_attriter i;
+ key_data *kd;
const char *n, *v;
const char *n, *v;
+ kf.f = KCAT_SHARE;
+ kf.m = KF_CATMASK;
+
/* --- Quick check if no parameters supplied --- */
if (!k->p)
/* --- Quick check if no parameters supplied --- */
if (!k->p)
@@
-248,16
+254,17
@@
static int copyparam(keyopts *k, const char **pp)
key_data *kd = key_structfind(k->p->k, *pp);
if (!kd)
die(EXIT_FAILURE, "bad parameter key: parameter `%s' not found", *pp);
key_data *kd = key_structfind(k->p->k, *pp);
if (!kd)
die(EXIT_FAILURE, "bad parameter key: parameter `%s' not found", *pp);
- if (
(kd->e & KF_CATMASK) != KCAT_SHARE
)
+ if (
!KEY_MATCH(kd, &kf)
)
die(EXIT_FAILURE, "bad parameter key: subkey `%s' is not shared", *pp);
pp++;
}
/* --- Copy over the parameters --- */
die(EXIT_FAILURE, "bad parameter key: subkey `%s' is not shared", *pp);
pp++;
}
/* --- Copy over the parameters --- */
- kf.f = KCAT_SHARE;
- kf.m = KF_CATMASK;
- key_setkeydata(k->kf, k->k, k->p->k);
+ kd = key_copydata(k->p->k, &kf);
+ assert(kd);
+ key_setkeydata(k->kf, k->k, kd);
+ key_drop(kd);
/* --- Copy over attributes --- */
/* --- Copy over attributes --- */
@@
-1437,10
+1444,10
@@
static void showkey(key *k, listopts *o)
if (!o->v) {
if (!(o->f & f_newline)) {
if (!o->v) {
if (!(o->f & f_newline)) {
- printf("%8s %-20s %-20s
%-10s %-10
s\n",
+ printf("%8s %-20s %-20s
%-10s %
s\n",
"Id", "Tag", "Type", "Expire", "Delete");
}
"Id", "Tag", "Type", "Expire", "Delete");
}
- printf("%08lx %-20s %-20s
%-10s %-10
s\n",
+ printf("%08lx %-20s %-20s
%-10s %
s\n",
(unsigned long)k->id, k->tag ? k->tag : "<none>",
k->type, ebuf, dbuf);
o->f |= f_newline;
(unsigned long)k->id, k->tag ? k->tag : "<none>",
k->type, ebuf, dbuf);
o->f |= f_newline;