diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-06-05 18:17:15 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-06-06 12:07:33 +0200 |
commit | 02d9ba6ee1db9d65fad5d8bcd7478abd82281d5d (patch) | |
tree | 582f62930f08d02734d653eba523a08c7886f85a /source3 | |
parent | bb27bb081e79334861192b6e02c51fd70440c65e (diff) | |
download | samba-02d9ba6ee1db9d65fad5d8bcd7478abd82281d5d.tar.gz samba-02d9ba6ee1db9d65fad5d8bcd7478abd82281d5d.tar.bz2 samba-02d9ba6ee1db9d65fad5d8bcd7478abd82281d5d.zip |
s3:smbd: change user_struct->vuid to uint64_t
Only sconn->smb1.sessions.next_vuid remains as uint16_t,
so that we do not generate larger values yet.
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Jun 6 12:07:33 CEST 2012 on sn-devel-104
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/local.h | 2 | ||||
-rw-r--r-- | source3/smbd/globals.h | 4 | ||||
-rw-r--r-- | source3/smbd/password.c | 29 | ||||
-rw-r--r-- | source3/smbd/process.c | 2 | ||||
-rw-r--r-- | source3/smbd/proto.h | 18 | ||||
-rw-r--r-- | source3/smbd/session.c | 7 | ||||
-rw-r--r-- | source3/smbd/sesssetup.c | 6 | ||||
-rw-r--r-- | source3/smbd/smb2_sesssetup.c | 4 |
8 files changed, 37 insertions, 35 deletions
diff --git a/source3/include/local.h b/source3/include/local.h index 11166df5f0..653c6714c2 100644 --- a/source3/include/local.h +++ b/source3/include/local.h @@ -167,7 +167,7 @@ #ifndef SESSION_TEMPLATE /* Paramaters are 'pid' and 'vuid' */ -#define SESSION_TEMPLATE "smb/%lu/%d" +#define SESSION_TEMPLATE "smb/%lu/%llu" #endif #ifndef SESSION_UTMP_TEMPLATE diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index f3f75aeb08..a0d5be0226 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -476,7 +476,7 @@ struct pending_auth_data; struct user_struct { struct user_struct *next, *prev; - uint16 vuid; /* Tag for this entry. */ + uint64_t vuid; /* Tag for this entry. */ char *session_keystr; /* used by utmp and pam session code. TDB key string */ @@ -590,7 +590,7 @@ struct smbd_server_connection { * Set by us for CORE protocol. */ int max_send; - uint16_t last_session_tag; + uint64_t last_session_tag; /* * this holds info on user ids that are already diff --git a/source3/smbd/password.c b/source3/smbd/password.c index c1561f1884..e8b48c464d 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -43,7 +43,7 @@ enum server_allocated_state { SERVER_ALLOCATED_REQUIRED_YES, static struct user_struct *get_valid_user_struct_internal( struct smbd_server_connection *sconn, - uint16 vuid, + uint64_t vuid, enum server_allocated_state server_allocated) { struct user_struct *usp; @@ -85,13 +85,13 @@ static struct user_struct *get_valid_user_struct_internal( ****************************************************************************/ struct user_struct *get_valid_user_struct(struct smbd_server_connection *sconn, - uint16 vuid) + uint64_t vuid) { return get_valid_user_struct_internal(sconn, vuid, SERVER_ALLOCATED_REQUIRED_YES); } -bool is_partial_auth_vuid(struct smbd_server_connection *sconn, uint16 vuid) +bool is_partial_auth_vuid(struct smbd_server_connection *sconn, uint64_t vuid) { return (get_partial_auth_user_struct(sconn, vuid) != NULL); } @@ -101,7 +101,7 @@ bool is_partial_auth_vuid(struct smbd_server_connection *sconn, uint16 vuid) ****************************************************************************/ struct user_struct *get_partial_auth_user_struct(struct smbd_server_connection *sconn, - uint16 vuid) + uint64_t vuid) { return get_valid_user_struct_internal(sconn, vuid, SERVER_ALLOCATED_REQUIRED_NO); @@ -111,7 +111,7 @@ struct user_struct *get_partial_auth_user_struct(struct smbd_server_connection * Invalidate a uid. ****************************************************************************/ -void invalidate_vuid(struct smbd_server_connection *sconn, uint16 vuid) +void invalidate_vuid(struct smbd_server_connection *sconn, uint64_t vuid) { struct user_struct *vuser = NULL; @@ -167,7 +167,7 @@ static void increment_next_vuid(uint16_t *vuid) Create a new partial auth user struct. *****************************************************/ -int register_initial_vuid(struct smbd_server_connection *sconn) +uint64_t register_initial_vuid(struct smbd_server_connection *sconn) { struct user_struct *vuser; @@ -256,10 +256,10 @@ int register_homes_share(const char *username) * */ -int register_existing_vuid(struct smbd_server_connection *sconn, - uint16 vuid, - struct auth_session_info *session_info, - DATA_BLOB response_blob) +uint64_t register_existing_vuid(struct smbd_server_connection *sconn, + uint64_t vuid, + struct auth_session_info *session_info, + DATA_BLOB response_blob) { struct user_struct *vuser; bool guest = security_session_user_level(session_info, NULL) < SECURITY_USER; @@ -299,13 +299,14 @@ int register_existing_vuid(struct smbd_server_connection *sconn, SMB_ASSERT(vuser->session_info->unix_token); DEBUG(3,("register_existing_vuid: UNIX uid %d is UNIX user %s, " - "and will be vuid %u\n", (int)vuser->session_info->unix_token->uid, - vuser->session_info->unix_info->unix_name, vuser->vuid)); + "and will be vuid %llu\n", (int)vuser->session_info->unix_token->uid, + vuser->session_info->unix_info->unix_name, + (unsigned long long)vuser->vuid)); if (!session_claim(sconn, vuser)) { DEBUG(1, ("register_existing_vuid: Failed to claim session " - "for vuid=%d\n", - vuser->vuid)); + "for vuid=%llu\n", + (unsigned long long)vuser->vuid)); goto fail; } diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 496622c9b4..30d0354223 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1354,7 +1354,7 @@ static void smb_dump(const char *name, int type, const char *data) static connection_struct *switch_message(uint8 type, struct smb_request *req) { int flags; - uint16 session_tag; + uint64_t session_tag; connection_struct *conn = NULL; struct smbd_server_connection *sconn = req->sconn; diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 5327b06b28..d58115703d 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -688,18 +688,18 @@ struct kernel_oplocks *linux_init_kernel_oplocks(struct smbd_server_connection * /* The following definitions come from smbd/password.c */ struct user_struct *get_valid_user_struct(struct smbd_server_connection *sconn, - uint16 vuid); -bool is_partial_auth_vuid(struct smbd_server_connection *sconn, uint16 vuid); + uint64_t vuid); +bool is_partial_auth_vuid(struct smbd_server_connection *sconn, uint64_t vuid); struct user_struct *get_partial_auth_user_struct(struct smbd_server_connection *sconn, - uint16 vuid); -void invalidate_vuid(struct smbd_server_connection *sconn, uint16 vuid); + uint64_t vuid); +void invalidate_vuid(struct smbd_server_connection *sconn, uint64_t vuid); void invalidate_all_vuids(struct smbd_server_connection *sconn); -int register_initial_vuid(struct smbd_server_connection *sconn); +uint64_t register_initial_vuid(struct smbd_server_connection *sconn); int register_homes_share(const char *username); -int register_existing_vuid(struct smbd_server_connection *sconn, - uint16 vuid, - struct auth_session_info *session_info, - DATA_BLOB response_blob); +uint64_t register_existing_vuid(struct smbd_server_connection *sconn, + uint64_t vuid, + struct auth_session_info *session_info, + DATA_BLOB response_blob); /* The following definitions come from smbd/pipes.c */ diff --git a/source3/smbd/session.c b/source3/smbd/session.c index a98ef51016..47eafab979 100644 --- a/source3/smbd/session.c +++ b/source3/smbd/session.c @@ -119,8 +119,9 @@ bool session_claim(struct smbd_server_connection *sconn, struct user_struct *vus SESSION_UTMP_TEMPLATE, i); } else { - snprintf(keystr, sizeof(keystr), "ID/%s/%u", - procid_str_static(&pid), vuser->vuid); + snprintf(keystr, sizeof(keystr), "ID/%s/%llu", + procid_str_static(&pid), + (unsigned long long)vuser->vuid); rec = sessionid_fetch_record(NULL, keystr); if (rec == NULL) { @@ -130,7 +131,7 @@ bool session_claim(struct smbd_server_connection *sconn, struct user_struct *vus snprintf(sessionid.id_str, sizeof(sessionid.id_str), SESSION_TEMPLATE, (long unsigned int)getpid(), - vuser->vuid); + (unsigned long long)vuser->vuid); } SMB_ASSERT(rec != NULL); diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index a3c6ede818..7cef73339a 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -126,7 +126,7 @@ static void reply_sesssetup_and_X_spnego(struct smb_request *req) const char *p2; uint16 data_blob_len = SVAL(req->vwv+7, 0); enum remote_arch_types ra_type = get_remote_arch(); - int vuid = req->vuid; + uint64_t vuid = req->vuid; struct user_struct *vuser = NULL; NTSTATUS status = NT_STATUS_OK; struct smbd_server_connection *sconn = req->sconn; @@ -259,7 +259,7 @@ static void reply_sesssetup_and_X_spnego(struct smb_request *req) if (NT_STATUS_IS_OK(status)) { struct auth_session_info *session_info = NULL; - int tmp_vuid; + uint64_t tmp_vuid; status = gensec_session_info(vuser->gensec_security, talloc_tos(), @@ -391,7 +391,7 @@ static void setup_new_vc_session(struct smbd_server_connection *sconn) void reply_sesssetup_and_X(struct smb_request *req) { - int sess_vuid; + uint64_t sess_vuid; int smb_bufsize; DATA_BLOB lm_resp; DATA_BLOB nt_resp; diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index caf009aedc..36084a4df6 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -244,8 +244,8 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbd_smb2_session *session, if (!session_claim(session->sconn, session->compat_vuser)) { DEBUG(1, ("smb2: Failed to claim session " - "for vuid=%d\n", - session->compat_vuser->vuid)); + "for vuid=%llu\n", + (unsigned long long)session->compat_vuser->vuid)); TALLOC_FREE(session); return NT_STATUS_LOGON_FAILURE; } |