]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: add simple noop smbd_impersonate_{conn_vuid,conn_sess,root,guest}_create()...
authorStefan Metzmacher <metze@samba.org>
Thu, 22 Mar 2018 09:54:41 +0000 (10:54 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 12 Jul 2018 12:25:17 +0000 (14:25 +0200)
As a start these are just wrappers arround
smbd_impersonate_debug_create(), without any real impersonation.
But this will change shortly.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/proto.h
source3/smbd/uid.c

index f31ef98624c78a9c21c5b5adc0f100b7b41bf3fd..29121d5c49610972761e254152de79a5a211cae0 100644 (file)
@@ -1222,6 +1222,17 @@ const struct security_unix_token *get_current_utok(connection_struct *conn);
 const struct security_token *get_current_nttok(connection_struct *conn);
 uint64_t get_current_vuid(connection_struct *conn);
 
+struct tevent_context *smbd_impersonate_conn_vuid_create(
+                               struct tevent_context *main_ev,
+                               struct connection_struct *conn,
+                               uint64_t vuid);
+struct tevent_context *smbd_impersonate_conn_sess_create(
+                               struct tevent_context *main_ev,
+                               struct connection_struct *conn,
+                               struct auth_session_info *session_info);
+struct tevent_context *smbd_impersonate_root_create(struct tevent_context *main_ev);
+struct tevent_context *smbd_impersonate_guest_create(struct tevent_context *main_ev);
+
 /* The following definitions come from smbd/utmp.c  */
 
 void sys_utmp_claim(const char *username, const char *hostname,
index 98202b13de132bda461bcfbb57bfeb77939beb1a..18af3df2e63048077aeb491ccdff840a9d3fee5b 100644 (file)
@@ -957,3 +957,53 @@ uint64_t get_current_vuid(connection_struct *conn)
 {
        return current_user.vuid;
 }
+
+struct tevent_context *smbd_impersonate_conn_vuid_create(
+                               struct tevent_context *main_ev,
+                               struct connection_struct *conn,
+                               uint64_t vuid)
+{
+       struct tevent_context *wrap_ev = NULL;
+
+       wrap_ev = smbd_impersonate_debug_create(main_ev,
+                                               "conn_vuid",
+                                               DBGLVL_DEBUG);
+
+       return wrap_ev;
+}
+
+struct tevent_context *smbd_impersonate_conn_sess_create(
+                               struct tevent_context *main_ev,
+                               struct connection_struct *conn,
+                               struct auth_session_info *session_info)
+{
+       struct tevent_context *wrap_ev = NULL;
+
+       wrap_ev = smbd_impersonate_debug_create(main_ev,
+                                               "conn_sess",
+                                               DBGLVL_DEBUG);
+
+       return wrap_ev;
+}
+
+struct tevent_context *smbd_impersonate_root_create(struct tevent_context *main_ev)
+{
+       struct tevent_context *wrap_ev = NULL;
+
+       wrap_ev = smbd_impersonate_debug_create(main_ev,
+                                               "root",
+                                               DBGLVL_DEBUG);
+
+       return wrap_ev;
+}
+
+struct tevent_context *smbd_impersonate_guest_create(struct tevent_context *main_ev)
+{
+       struct tevent_context *wrap_ev = NULL;
+
+       wrap_ev = smbd_impersonate_debug_create(main_ev,
+                                               "guest",
+                                               DBGLVL_DEBUG);
+
+       return wrap_ev;
+}