diff options
Diffstat (limited to 'src/verify.c')
-rw-r--r-- | src/verify.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/src/verify.c b/src/verify.c index d419df5..15a2d8b 100644 --- a/src/verify.c +++ b/src/verify.c @@ -73,22 +73,6 @@ fill_project_name (struct file_triplet *trp) return 0; } -void -make_default_meta (struct metadef def[5], const char *user, - const char *project) -{ - memset (def, 0, 5 * sizeof(def[0])); - def[0].kw = "u"; - def[0].value = (char*) user; - def[1].kw = "user"; - def[1].value = (char*) user; - def[2].kw = "p"; - def[2].value = (char*) project; - def[3].kw = "project"; - def[3].value = (char*) project; - def[4].kw = NULL; -} - /* Verify if USER has upload rights on the directory (project) requested by TRP */ int @@ -99,7 +83,6 @@ check_access_rights (struct file_triplet *trp, const struct spool *spool, int rc; char *command; const char *result; - struct metadef def[5]; void *md; struct group *grp; @@ -119,11 +102,7 @@ check_access_rights (struct file_triplet *trp, const struct spool *spool, if (!md) return 1; - make_default_meta (def, user, trp->project); - - meta_escape (method, md, def); - command = meta_expand_string (method->query, def, NULL); - meta_free (def); + command = triplet_expand_method_query (method, md, trp); rc = method_run (method, md, command); free (command); @@ -156,7 +135,6 @@ verify_directive_file (struct file_triplet *trp, const struct spool *spool) struct access_method *method = spool->access_method[gpg_key_method]; const char *pubkey; int rc; - struct metadef def[5]; void *md; if (!trp->file[file_directive].name) @@ -176,10 +154,7 @@ verify_directive_file (struct file_triplet *trp, const struct spool *spool) trp->gid = pw->pw_gid; trp->user = xstrdup (pw->pw_name); - make_default_meta (def, trp->user, NULL); - meta_escape (method, md, def); - command = meta_expand_string (method->query, def, NULL); - meta_free (def); + command = triplet_expand_method_query (method, md, trp); rc = method_run (method, md, command); free (command); |