[PATCH] [FreeBSD 13] Modified version of get_freebsd_corepath()

Timur I. Bakeyev timur at com.bat.ru
Mon Jul 20 21:57:58 MDT 2009

Hi all!

I haven't received any comments on this patch, it'll be nice to see it
reviewed and, hopefully, commited.

I do attach GIT version of it now.

With regards,

On Sun, Jun 07, 2009 at 01:51:31PM +0000, Timur I. Bakeyev wrote:
> Release of Samba 3.4.0pre2 introduced new function to get the location,
> where core file will be actually dumped. In FreeBSD this os controlled
> by kernel tunable and, in general, not necessary it is a CWD.
> There is a function in source3/lib/fault.c called get_freebsd_corepath()
> that tries to analyse that tunable and present it to the end user. There
> are two problems with it.
> One, simple, is that that function uses sysctlbyname() which is defined
> in sys/sysctl.h. So, this header HAS to be included. That affects both
> compilation of param/loadparam.c and lib/fault.c. Basically, they failed
> to compile. I suspect, this is addressed in the git, as it's a showstopper
> for FreeBSD compilation, but just in case - little fix for it.
> The next problem is with the get_freebsd_corepath() itself. Kernel tunable
> can use expandable variables %N, %P and %U to reflect name of the program,
> it's PID and UID. So, if we want to use that kernel tunable, we have to
> do expansion ourselves.
> The reimplementation of the get_freebsd_corepath() does the expansion. I
> hope, that I did talloc_*() magic right, as I have no experience with it.
> Please, fix it accordingly, if it's wrong...
> With regards,
> Timur Bakeyev.

More information about the samba-technical mailing list