From: Stefan Metzmacher Date: Thu, 22 Mar 2018 09:54:41 +0000 (+0100) Subject: smbd: add simple noop smbd_impersonate_{conn_vuid,conn_sess,root,guest}_create()... X-Git-Tag: ldb-1.5.0~343 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5285966e67cbee8519015df12a15e938e85e6ee7;p=thirdparty%2Fsamba.git smbd: add simple noop smbd_impersonate_{conn_vuid,conn_sess,root,guest}_create() wrappers 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 Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index f31ef98624c..29121d5c496 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -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, diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index 98202b13de1..18af3df2e63 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -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; +}