Print this page
NEX-1643 dtrace provider for smbsrv
Also illumos 1841:
 DTrace smb provider was mis-implemented, doesn't exist.
Add back handlers for read/write raw, so that
 legacy dtrace consumers can find the probes.
Kill extra arg in smb_negotiate
Fix missing "done" probe with smb_notify
Add example consumer: smb-trace.d
fix soi_pid


 172         else
 173                 sinfo->ssi_native_os = smbnative_os_value(native_os);
 174 
 175         if (sinfo->ssi_native_os == NATIVE_OS_WINNT)
 176                 rc = smbsr_decode_data(sr, "%,u", sr, &native_lm);
 177         else
 178                 rc = smbsr_decode_data(sr, "%u", sr, &native_lm);
 179         if (rc != 0 || native_lm == NULL)
 180                 sinfo->ssi_native_lm = NATIVE_LM_NT;
 181         else
 182                 sinfo->ssi_native_lm = smbnative_lm_value(native_lm);
 183         rc = 0;
 184 
 185 done:
 186         if (rc != 0) {
 187                 cmn_err(CE_NOTE,
 188                     "SmbSessonSetupX: client %s invalid request",
 189                     sr->session->ip_addr_str);
 190         }
 191 
 192         DTRACE_SMB_2(op__SessionSetupX__start, smb_request_t *, sr,
 193             smb_arg_sessionsetup_t, sinfo);
 194         return ((rc == 0) ? SDRC_SUCCESS : SDRC_ERROR);
 195 }
 196 
 197 void
 198 smb_post_session_setup_andx(smb_request_t *sr)
 199 {
 200         smb_arg_sessionsetup_t  *sinfo = sr->sr_ssetup;
 201 
 202         DTRACE_SMB_2(op__SessionSetupX__done, smb_request_t *, sr,
 203             smb_arg_sessionsetup_t, sinfo);
 204 
 205         if (sinfo->ssi_lmpwd != NULL)
 206                 bzero(sinfo->ssi_lmpwd, sinfo->ssi_lmpwlen);
 207 
 208         if (sinfo->ssi_ntpwd != NULL)
 209                 bzero(sinfo->ssi_ntpwd, sinfo->ssi_ntpwlen);
 210 }
 211 
 212 /*
 213  *
 214  * NT systems use different native OS and native LanMan values dependent on
 215  * whether they are acting as a client or a server.  NT 4.0 server responds
 216  * with the following values:
 217  *
 218  *      NativeOS:       Windows NT 4.0
 219  *      NativeLM:       NT LAN Manager 4.0
 220  */
 221 smb_sdrc_t
 222 smb_com_session_setup_andx(smb_request_t *sr)
 223 {




 172         else
 173                 sinfo->ssi_native_os = smbnative_os_value(native_os);
 174 
 175         if (sinfo->ssi_native_os == NATIVE_OS_WINNT)
 176                 rc = smbsr_decode_data(sr, "%,u", sr, &native_lm);
 177         else
 178                 rc = smbsr_decode_data(sr, "%u", sr, &native_lm);
 179         if (rc != 0 || native_lm == NULL)
 180                 sinfo->ssi_native_lm = NATIVE_LM_NT;
 181         else
 182                 sinfo->ssi_native_lm = smbnative_lm_value(native_lm);
 183         rc = 0;
 184 
 185 done:
 186         if (rc != 0) {
 187                 cmn_err(CE_NOTE,
 188                     "SmbSessonSetupX: client %s invalid request",
 189                     sr->session->ip_addr_str);
 190         }
 191 
 192         DTRACE_SMB_1(op__SessionSetupX__start, smb_request_t *, sr);

 193         return ((rc == 0) ? SDRC_SUCCESS : SDRC_ERROR);
 194 }
 195 
 196 void
 197 smb_post_session_setup_andx(smb_request_t *sr)
 198 {
 199         smb_arg_sessionsetup_t  *sinfo = sr->sr_ssetup;
 200 
 201         DTRACE_SMB_1(op__SessionSetupX__done, smb_request_t *, sr);

 202 
 203         if (sinfo->ssi_lmpwd != NULL)
 204                 bzero(sinfo->ssi_lmpwd, sinfo->ssi_lmpwlen);
 205 
 206         if (sinfo->ssi_ntpwd != NULL)
 207                 bzero(sinfo->ssi_ntpwd, sinfo->ssi_ntpwlen);
 208 }
 209 
 210 /*
 211  *
 212  * NT systems use different native OS and native LanMan values dependent on
 213  * whether they are acting as a client or a server.  NT 4.0 server responds
 214  * with the following values:
 215  *
 216  *      NativeOS:       Windows NT 4.0
 217  *      NativeLM:       NT LAN Manager 4.0
 218  */
 219 smb_sdrc_t
 220 smb_com_session_setup_andx(smb_request_t *sr)
 221 {