s4-auth Move libcli/security/session.c to the top level
authorAndrew Bartlett <abartlet@samba.org>
Thu, 10 Feb 2011 09:21:11 +0000 (20:21 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 22 Feb 2011 05:20:11 +0000 (16:20 +1100)
This code is now useful in common, as the elements of the
auth_session_info structure have now been defined in common IDL.

Andrew Bartlett

14 files changed:
libcli/security/security.h
libcli/security/session.c [moved from source4/libcli/security/session.c with 96% similarity]
libcli/security/session.h [moved from source4/libcli/security/session.h with 65% similarity]
libcli/security/wscript_build
source4/auth/auth.h
source4/auth/session.h
source4/dsdb/repl/drepl_out_helpers.c
source4/dsdb/samdb/ldb_modules/repl_meta_data.c
source4/dsdb/samdb/ldb_modules/rootdse.c
source4/dsdb/samdb/ldb_modules/util.c
source4/dsdb/samdb/ldb_modules/wscript_build
source4/libcli/security/wscript_build [deleted file]
source4/libcli/wscript_build
source4/rpc_server/wscript_build

index 39ae3ec..bb7bc72 100644 (file)
@@ -105,5 +105,6 @@ struct object_tree {
 #include "libcli/security/sddl.h"
 #include "libcli/security/privileges.h"
 #include "libcli/security/access_check.h"
+#include "libcli/security/session.h"
 
 #endif
similarity index 96%
rename from source4/libcli/security/session.c
rename to libcli/security/session.c
index 401e11c..0c32556 100644 (file)
@@ -20,9 +20,8 @@
 */
 
 #include "includes.h"
-#include "auth/session.h"
-#include "libcli/security/session.h"
 #include "libcli/security/security.h"
+#include "librpc/gen_ndr/auth.h"
 
 enum security_user_level security_session_user_level(struct auth_session_info *session_info,
                                                     const struct dom_sid *domain_sid)
similarity index 65%
rename from source4/libcli/security/session.h
rename to libcli/security/session.h
index cf69665..36da09b 100644 (file)
@@ -19,6 +19,9 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#ifndef _LIBCLI_SECURITY_SESSION_H_
+#define _LIBCLI_SECURITY_SESSION_H_
+
 enum security_user_level {
        SECURITY_ANONYMOUS            = 0,
        SECURITY_USER                 = 10,
@@ -28,6 +31,20 @@ enum security_user_level {
        SECURITY_SYSTEM               = 50
 };
 
-#include "libcli/security/session_proto.h"
+struct cli_credentials;
+struct security_token;
+struct auth_user_info;
+struct auth_user_info_torture;
+
+struct auth_session_info {
+       struct security_token *security_token;
+       struct auth_user_info *info;
+       struct auth_user_info_torture *torture;
+       DATA_BLOB session_key;
+       struct cli_credentials *credentials;
+};
+
+enum security_user_level security_session_user_level(struct auth_session_info *session_info,
+                                                    const struct dom_sid *domain_sid);
 
-struct auth_session_info;
+#endif
index 3526e66..3f2e06a 100644 (file)
@@ -2,7 +2,7 @@
 
 
 bld.SAMBA_LIBRARY('security',
-                  source='dom_sid.c display_sec.c secace.c secacl.c security_descriptor.c sddl.c privileges.c security_token.c access_check.c object_tree.c create_descriptor.c util_sid.c',
+                  source='dom_sid.c display_sec.c secace.c secacl.c security_descriptor.c sddl.c privileges.c security_token.c access_check.c object_tree.c create_descriptor.c util_sid.c session.c',
                   private_library=True,
                   deps='talloc ndr NDR_SECURITY'
                   )
index ccc5695..70df694 100644 (file)
@@ -162,6 +162,7 @@ struct auth_critical_sizes {
 struct ldb_message;
 struct ldb_context;
 struct gensec_security;
+struct cli_credentials;
 
 NTSTATUS auth_get_challenge(struct auth_context *auth_ctx, uint8_t chal[8]);
 NTSTATUS authsam_account_ok(TALLOC_CTX *mem_ctx,
index 795497e..8ab6288 100644 (file)
 #ifndef _SAMBA_AUTH_SESSION_H
 #define _SAMBA_AUTH_SESSION_H
 
-struct auth_session_info {
-       struct security_token *security_token;
-       struct auth_user_info *info;
-       struct auth_user_info_torture *torture;
-       DATA_BLOB session_key;
-       struct cli_credentials *credentials;
-};
-
+#include "libcli/security/security.h"
 #include "librpc/gen_ndr/netlogon.h"
 #include "librpc/gen_ndr/auth.h"
 
index 893eb3b..ebf2f77 100644 (file)
@@ -34,6 +34,7 @@
 #include "auth/gensec/gensec.h"
 #include "param/param.h"
 #include "../lib/util/tevent_ntstatus.h"
+#include "libcli/security/security.h"
 
 struct dreplsrv_out_drsuapi_state {
        struct tevent_context *ev;
index 53d53d9..6fd6d7f 100644 (file)
@@ -48,7 +48,6 @@
 #include "lib/util/dlinklist.h"
 #include "dsdb/samdb/ldb_modules/util.h"
 #include "lib/util/binsearch.h"
-#include "libcli/security/session.h"
 #include "lib/util/tsort.h"
 
 struct replmd_private {
index 9888912..be60d89 100644 (file)
@@ -28,7 +28,6 @@
 #include "version.h"
 #include "dsdb/samdb/ldb_modules/util.h"
 #include "libcli/security/security.h"
-#include "libcli/security/session.h"
 #include "librpc/ndr/libndr.h"
 #include "auth/auth.h"
 #include "param/param.h"
index 37ab470..49939e2 100644 (file)
@@ -27,7 +27,6 @@
 #include "dsdb/samdb/samdb.h"
 #include "util.h"
 #include "libcli/security/security.h"
-#include "libcli/security/session.h"
 
 /*
   search for attrs on one DN, in the modules below
index 5925165..4ff5bdf 100644 (file)
@@ -9,7 +9,7 @@ bld.SAMBA_LIBRARY('dsdb-module',
 bld.SAMBA_SUBSYSTEM('DSDB_MODULE_HELPERS',
        source='util.c acl_util.c schema_util.c',
        autoproto='util_proto.h',
-       deps='ldb ndr samdb-common security-session'
+       deps='ldb ndr samdb-common security'
        )
 
 bld.SAMBA_SUBSYSTEM('DSDB_MODULE_HELPER_RIDALLOC',
@@ -60,7 +60,7 @@ bld.SAMBA_MODULE('ldb_repl_meta_data',
        init_function='ldb_repl_meta_data_module_init',
        module_init_name='ldb_init_module',
        internal_module=False,
-       deps='samdb talloc events ndr NDR_DRSUAPI NDR_DRSBLOBS ndr DSDB_MODULE_HELPERS security-session'
+       deps='samdb talloc events ndr NDR_DRSUAPI NDR_DRSBLOBS ndr DSDB_MODULE_HELPERS security'
        )
 
 
@@ -150,7 +150,7 @@ bld.SAMBA_MODULE('ldb_rootdse',
        init_function='ldb_rootdse_module_init',
        module_init_name='ldb_init_module',
        internal_module=False,
-       deps='talloc events samdb MESSAGING security-session DSDB_MODULE_HELPERS'
+       deps='talloc events samdb MESSAGING security DSDB_MODULE_HELPERS'
        )
 
 
diff --git a/source4/libcli/security/wscript_build b/source4/libcli/security/wscript_build
deleted file mode 100644 (file)
index 9c27723..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env python
-
-bld.SAMBA_LIBRARY('security-session',
-       source='session.c',
-       autoproto='session_proto.h',
-       public_deps='security',
-       private_library=True
-       )
-
index 950c179..f91900d 100644 (file)
@@ -1,7 +1,6 @@
 #!/usr/bin/env python
 
 bld.RECURSE('ldap')
-bld.RECURSE('security')
 bld.RECURSE('wbclient')
 
 bld.SAMBA_LIBRARY('errors',
index b796728..815459b 100644 (file)
@@ -77,7 +77,7 @@ bld.SAMBA_MODULE('dcerpc_winreg',
        source='winreg/rpc_winreg.c',
        subsystem='dcerpc_server',
        init_function='dcerpc_server_winreg_init',
-       deps='registry ndr-standard security-session',
+       deps='registry ndr-standard',
        internal_module=True
        )
 
@@ -95,7 +95,7 @@ bld.SAMBA_MODULE('dcerpc_lsarpc',
        autoproto='lsa/proto.h',
        subsystem='dcerpc_server',
        init_function='dcerpc_server_lsa_init',
-       deps='samdb DCERPC_COMMON ndr-standard LIBCLI_AUTH NDR_DSSETUP com_err security-session kdc-policy'
+       deps='samdb DCERPC_COMMON ndr-standard LIBCLI_AUTH NDR_DSSETUP com_err security kdc-policy'
        )
 
 
@@ -121,7 +121,7 @@ bld.SAMBA_MODULE('dcerpc_drsuapi',
        source='drsuapi/dcesrv_drsuapi.c drsuapi/updaterefs.c drsuapi/getncchanges.c drsuapi/addentry.c drsuapi/writespn.c drsuapi/drsutil.c',
        subsystem='dcerpc_server',
        init_function='dcerpc_server_drsuapi_init',
-       deps='samdb DCERPC_COMMON NDR_DRSUAPI security-session'
+       deps='samdb DCERPC_COMMON NDR_DRSUAPI security'
        )