[PATCH] Have the smbcli_session record the OS and Native LANMAN of the remote server

Stefan (metze) Metzmacher metze at samba.org
Wed Apr 29 08:32:37 GMT 2009


Sam Liddicott schrieb:
> Volker, hows this then?
> 
> 
> Signed-off-by: Sam Liddicott <sam at liddicott.com>
> ---
>  source4/libcli/raw/libcliraw.h           |    3 +++
>  source4/libcli/smb_composite/sesssetup.c |   12 ++++++++++++
>  2 files changed, 15 insertions(+), 0 deletions(-)
> 
> 
> 
+		if (state->setup.nt1.out.os &&
+			!(session->os=talloc_strdup(session, state->setup.nt1.out.os)))
c->status = NT_STATUS_NO_MEMORY;
+		if (state->setup.nt1.out.lanman &&
+			!(session->lanman=talloc_strdup(session,
state->setup.nt1.out.lanman))) c->status = NT_STATUS_NO_MEMORY;

why do you want to do everything in one line?

if (state->setup.nt.out.os) {
      session->os = talloc_strdup(session, state->setup.nt1.out.os);
      if (!session->os) {
            c->status = NT_STATUS_NO_MEMORY;
      }
} else {
      sesson->os = NULL;
}

would be much nicer and much easier to read and understand.

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.samba.org/archive/samba-technical/attachments/20090429/cdaca759/signature.bin


More information about the samba-technical mailing list