Hi Sam,
Thanks for taking the time to reply, it's appreciated. However...given
my unfortunate lack of c knowledge, your suggestion doesn't help me. ;-)
No idea what to do with your suggestion:
> char *tsocket_address_inet_addr_string(const struct tsocket_address
> *addr, TALLOC_CTX *mem_ctx);
I have no idea where to put the above line, or what to do with it.
> if (tevent_req_is_nterror(req, &status)) {
> DEBUG(2,("auth_check_password_recv: "
> "%s authentication for user [%s\\%s] on host %s "
> "FAILED with error %s\n",
> (state->method ? state->method->ops->name :
"NO_METHOD"),
> state->user_info->mapped.domain_name,
> state->user_info->remote_host,
> state->user_info->mapped.account_name,
> nt_errstr(status)));
> tevent_req_received(req);
> return status;
> }
It would be SO helpful to have a remote_host (ip address or whatever)
with failed logon attempts in our samba logs, but I guess my attempt
stops here. It seemed like something relatively simple, initially, but alas.
Thanks both Viktor and Sam.
MJ
On 29-11-2015 22:23, Garming Sam wrote:> Hi,
>
> As Viktor has picked up on, remote_host is a struct of type
> tsocket_address. It's not very typical to be able to directly access
> this kind of information and there'll usually be some function that
> looks helpful. In the tsocket guide that he's posted, there seems to be
> a function that you want, which takes your remote_host and converts it
> to what looks to be a proper (ipv4 or ipv6) string.
>
> char *tsocket_address_inet_addr_string(const struct tsocket_address
> *addr, TALLOC_CTX *mem_ctx);
>
> Give it a go. There might be a few other functions you might find useful
> in there.
>
>
> Cheers,
>
> Garming
>
> On 28/11/15 04:12, mourik jan heupink wrote:
>> Hi Viktor!
>>
>> Thanks for your try at this, I am already doing what you suggest: the
>> iptables - timestaps. But that is rather troublesome, and I would very
>> much samba to log this vital info.
>>
>> Anyway, I tried what you suggested, and now it stopped compiling. :-)
>>
>> Does this error perhaps tell you something, or are you just as
>> clueless as I am now:
>>
>>> [1955/4033] Compiling source4/auth/ntlm/auth.c
>>> In file included from ../source4/include/includes.h:62:0,
>>> from ../source4/auth/ntlm/auth.c:21:
>>> ../source4/auth/ntlm/auth.c: In function
‘auth_check_password_recv’:
>>> ../source4/auth/ntlm/auth.c:429:34: error: dereferencing pointer to
>>> incomplete type
>>> state->user_info->remote_host->addr,
>>> ^
>>> ../source4/../lib/util/debug.h:185:20: note: in definition of macro
>>> ‘DEBUG’
>>> && (dbgtext body) )
>>> ^
>>> Waf: Leaving directory `/root/samba-4.3.1/bin'
>>> Build failed: -> task failed (err #1):
>>> {task: cc auth.c -> auth_6.o}
>>> Makefile:8: recipe for target 'all' failed
>>> make: *** [all] Error 1
>>
>> Or anyone?
>>
>