confusion over libsmb/ntlmssp.c

James Peach jpeach at sgi.com
Wed Feb 2 06:39:25 GMT 2005


Hi all,

I'm cleaning up some warnings in Samba 3 and came across the following
deeply confusing code in libsmb/ntlmssp.c:

   442          /* This creates the 'blob' of names that appears at the end of the packet */
   443          if (chal_flags & NTLMSSP_CHAL_TARGET_INFO) 
   444          {
   445                  const char *target_name_dns = "";
   446                  if (chal_flags |= NTLMSSP_TARGET_TYPE_DOMAIN) {
   447                          target_name_dns = dnsdomname;
   448                  } else if (chal_flags |= NTLMSSP_TARGET_TYPE_SERVER) {
   449                          target_name_dns = dnsname;
   450                  }
   451  
   452                  msrpc_gen(&struct_blob, "aaaaa",
   453                            NTLMSSP_NAME_TYPE_DOMAIN, target_name,
   454                            NTLMSSP_NAME_TYPE_SERVER, ntlmssp_state->get_global_myname(),
   455                            NTLMSSP_NAME_TYPE_DOMAIN_DNS, dnsdomname,
   456                            NTLMSSP_NAME_TYPE_SERVER_DNS, dnsname,
   457                            0, "");
   458          } else {
   459                  struct_blob = data_blob(NULL, 0);
   460          }

Is the NTLMSSP_TARGET_TYPE* branch a bug or am I just having trouble getting
my head around this?

-- 
James Peach | jpeach at sgi.com | SGI Australian Software Group
I don't speak for SGI.


More information about the samba-technical mailing list