summaryrefslogtreecommitdiff
path: root/client/internal.h
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2010-02-20 19:55:05 -0800
committerRuss Allbery <rra@stanford.edu>2010-02-20 19:55:05 -0800
commita3ee976840e97d37022ec117bae09fef25ac4385 (patch)
treea2422d730079e2ce72f0245f5497685f27377960 /client/internal.h
parent77581a6a1620118ca17e26ec8b549603ab67b91b (diff)
Add support in the wallet client for store of binary data
Refactor the wallet client code to use remctl_commandv and send stores with data containing nul.
Diffstat (limited to 'client/internal.h')
-rw-r--r--client/internal.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/client/internal.h b/client/internal.h
index 7fe962b..d82196c 100644
--- a/client/internal.h
+++ b/client/internal.h
@@ -17,6 +17,7 @@
/* Forward declarations to avoid unnecessary includes. */
struct remctl;
+struct iovec;
BEGIN_DECLS
@@ -29,14 +30,18 @@ void kinit(krb5_context, const char *principal);
void kdestroy(void);
/*
- * Given a remctl object, run a remctl command. If data is non-NULL, saves
- * the standard output from the command into data with the length in length.
- * Otherwise, prints it to standard output. Either way, prints standard error
- * output and errors to standard error and returns the exit status or 255 for
- * a remctl internal error.
+ * Given a remctl object, either a NULL-terminated array of strings or an
+ * array of iovecs and the number of elements in the array, and optional data
+ * and size output variables, run a remctl command. If data is non-NULL,
+ * saves the standard output from the command into data with the length in
+ * length. Otherwise, prints it to standard output. Either way, prints
+ * standard error output and errors to standard error and returns the exit
+ * status or 255 for a remctl internal error.
*/
int run_command(struct remctl *, const char **command, char **data,
size_t *length);
+int run_commandv(struct remctl *, const struct iovec *command, size_t count,
+ char **data, size_t *length);
/*
* Check whether an object exists using the exists wallet interface. Returns
@@ -91,12 +96,12 @@ void write_srvtab(krb5_context, const char *srvtab, const char *principal,
const char *keytab);
/*
- * Read all of a file into memory and return the contents as a newly allocated
- * string. Handles a file name of "-" to mean standard input. Dies on any
- * failure. This will need modification later when we want to handle nul
- * characters.
+ * Read all of a file into memory and return the contents in newly allocated
+ * memory. Handles a file name of "-" to mean standard input. Stores the
+ * length of the data in the second argument if it isn't NULL. Dies on any
+ * failure.
*/
-char *read_file(const char *);
+void *read_file(const char *, size_t *);
END_DECLS