From 1e40a57d1689b4943f67db5e249008d7f0969208 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Mon, 2 Dec 2013 10:47:26 -0500 Subject: gfapi: backport handles to 3.4 for nfs-ganesha nfs-ganesha-2.0 will ship shortly. It depends on the gfapi handle support, which won't otherwise be released until 3.5 sometime in 2014. Change-Id: I104d6fb275bb2c710790340fdc7d998446403026 Signed-off-by: Kaleb S. KEITHLEY Reviewed-on: http://review.gluster.org/6394 Tested-by: Gluster Build System Reviewed-by: Shyamsundar Ranganathan Reviewed-by: Vijay Bellur --- api/src/glfs.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'api/src/glfs.h') diff --git a/api/src/glfs.h b/api/src/glfs.h index 460edf1d02c..bf34ec6bf08 100644 --- a/api/src/glfs.h +++ b/api/src/glfs.h @@ -269,6 +269,32 @@ int glfs_fini (glfs_t *fs); struct glfs_fd; typedef struct glfs_fd glfs_fd_t; +/* + * PER THREAD IDENTITY MODIFIERS + * + * The following operations enable to set a per thread identity context + * for the glfs APIs to perform operations as. The calls here are kept as close + * to POSIX equivalents as possible. + * + * NOTES: + * + * - setgroups is a per thread setting, hence this is named as fsgroups to be + * close in naming to the fs(u/g)id APIs + * - Typical mode of operation is to set the IDs as required, with the + * supplementary groups being optionally set, make the glfs call and post the + * glfs operation set them back to eu/gid or uid/gid as appropriate to the + * caller + * - The groups once set, need to be unset by setting the size to 0 (in which + * case the list argument is a do not care) + * - Once a process for a thread of operation choses to set the IDs, all glfs + * calls made from that thread would default to the IDs set for the thread. + * As a result use these APIs with care and ensure that the set IDs are + * reverted to global process defaults as required. + * + */ +int glfs_setfsuid (uid_t fsuid); +int glfs_setfsgid (gid_t fsgid); +int glfs_setfsgroups (size_t size, const gid_t *list); /* SYNOPSIS -- cgit