[Samba] unsafe_string_function_usage_here when linking smbd

Kai Lanz lanz at stanford.edu
Tue Jun 10 00:19:28 GMT 2008


On Jun 8, 2008, at 1:47 PM, Bengt Nilsson wrote:

> I was wrong about building completed.
>
> After removing smbd and re-make I got
>
> Linking bin/smbd
> ld:
> Unresolved:
> srvstr_push_fn2
> make: *** [bin/smbd] Error 1

A quick summary of what I've discovered today:

The offending line (that generates the unresolved error
when linking smbd) is line 3694 of trans2.c, which is in
the function call_trans2qfilepathinfo. Here it is with a bit
of context:

			pdata += 24;
                         SIVAL(pdata,0,ea_size);
                         pdata += 4; /* EA info */
                         len = srvstr_push(outbuf, pdata+4,  
dos_fname, max_data_bytes - (pdata+4 - *ppdata), STR_UNICODE);
                         SIVAL(pdata,0,len);
                         pdata += 4 + len;
                         data_size = PTR_DIFF(pdata,(*ppdata));

Line 3964 is the "len = srvstr_push()" call. That line is
expanded by the cpp into:

len = ((sizeof(pdata+4) != (max_data_bytes - (pdata+4 - *ppdata)) &&  
sizeof(pdata+4) != sizeof(char *)) ?  
__unsafe_string_function_usage_here_size_t__() : srvstr_push_fn((""),  
(0), outbuf, pdata+4, dos_fname, max_data_bytes - (pdata+4 -  
*ppdata), 8));

And it's this line which, when compiled, returns the
reference to __unsafe_string_function_usage_here_size_t__
instead of a reference to srvstr_push_fn. So either

((sizeof(pdata+4) != (max_data_bytes - (pdata+4 - *ppdata))

is evaluating to an unexpected value, or

sizeof(pdata+4) != sizeof(char *))

is. I can't spend any more time on this today, but maybe this
update will suggest something to someone here.

-- 
Kai Lanz



More information about the samba mailing list