summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Henningsson <david.henningsson@canonical.com>2014-04-15 15:07:42 +0200
committerDavid Henningsson <david.henningsson@canonical.com>2014-06-27 14:16:32 +0200
commitcc7a317e858cbd64159e72bcbaf4796992591dc4 (patch)
treeb4c761ee8c73d96c3bf2cacad5a02b31ecf9b232
parent26908afff75aa3b86f81dd2f96c82182b5def205 (diff)
creds: Add struct for ancillary data
To support later patches that add sending/receiving file descriptors, let's add this struct. Signed-off-by: David Henningsson <david.henningsson@canonical.com>
-rw-r--r--src/pulsecore/creds.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pulsecore/creds.h b/src/pulsecore/creds.h
index aa1d56080..f09b35e80 100644
--- a/src/pulsecore/creds.h
+++ b/src/pulsecore/creds.h
@@ -29,8 +29,12 @@
#endif
#include <pulsecore/socket.h>
+#include <stdbool.h>
+
+#define MAX_ANCIL_FDS (2)
typedef struct pa_creds pa_creds;
+typedef struct pa_ancil pa_ancil;
#if defined(SCM_CREDENTIALS)
@@ -41,6 +45,15 @@ struct pa_creds {
uid_t uid;
};
+/* Struct for handling ancillary data, i e, extra data that can be sent together with a message
+ over unix pipes. Supports sending and receiving credentials and file descriptors. */
+struct pa_ancil {
+ pa_creds creds;
+ bool creds_valid;
+ int nfd;
+ int fds[MAX_ANCIL_FDS];
+};
+
#else
#undef HAVE_CREDS
#endif