diff options
author | Shirish Pargaonkar <shirishpargaonkar@gmail.com> | 2011-04-27 23:34:35 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-05-19 14:10:51 +0000 |
commit | 4d79dba0e00749fa40de8ef13a9b85ce57a1603b (patch) | |
tree | 55e377f53c761e70d5b90a1f901f70609ffcbcc7 /fs/cifs/cifsfs.c | |
parent | 9ad1506b42c828dff0b9d8f3914e1f837734e91c (diff) | |
download | op-kernel-dev-4d79dba0e00749fa40de8ef13a9b85ce57a1603b.zip op-kernel-dev-4d79dba0e00749fa40de8ef13a9b85ce57a1603b.tar.gz |
cifs: Add idmap key and related data structures and functions (try #17 repost)
Define (global) data structures to store ids, uids and gids, to which a
SID maps. There are two separate trees, one for SID/uid and another one
for SID/gid.
A new type of key, cifs_idmap_key_type, is used.
Keys are instantiated and searched using credential of the root by
overriding and restoring the credentials of the caller requesting the key.
Id mapping functions are invoked under config option of cifs acl.
Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 30fc505..6c1d738 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c @@ -1033,22 +1033,31 @@ init_cifs(void) if (rc) goto out_destroy_mids; - rc = register_filesystem(&cifs_fs_type); - if (rc) - goto out_destroy_request_bufs; #ifdef CONFIG_CIFS_UPCALL rc = register_key_type(&cifs_spnego_key_type); if (rc) - goto out_unregister_filesystem; -#endif + goto out_destroy_request_bufs; +#endif /* CONFIG_CIFS_UPCALL */ + +#ifdef CONFIG_CIFS_ACL + rc = init_cifs_idmap(); + if (rc) + goto out_destroy_request_bufs; +#endif /* CONFIG_CIFS_ACL */ + + rc = register_filesystem(&cifs_fs_type); + if (rc) + goto out_destroy_request_bufs; return 0; +out_destroy_request_bufs: +#ifdef CONFIG_CIFS_ACL + exit_cifs_idmap(); +#endif #ifdef CONFIG_CIFS_UPCALL -out_unregister_filesystem: - unregister_filesystem(&cifs_fs_type); + unregister_key_type(&cifs_spnego_key_type); #endif -out_destroy_request_bufs: cifs_destroy_request_bufs(); out_destroy_mids: cifs_destroy_mids(); @@ -1070,6 +1079,10 @@ exit_cifs(void) #ifdef CONFIG_CIFS_DFS_UPCALL cifs_dfs_release_automount_timer(); #endif +#ifdef CONFIG_CIFS_ACL + cifs_destroy_idmaptrees(); + exit_cifs_idmap(); +#endif #ifdef CONFIG_CIFS_UPCALL unregister_key_type(&cifs_spnego_key_type); #endif |