Bug 7468 - pdb_ldap.c compile error - smbldap_search_domain_info not declared
Summary: pdb_ldap.c compile error - smbldap_search_domain_info not declared
Alias: None
Product: Samba 3.2
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.2.4
Hardware: PPC Windows XP
: P3 normal
Target Milestone: ---
Assignee: Björn Jacke
QA Contact: Samba QA Contact
Depends on:
Reported: 2010-05-27 19:00 UTC by Chris Good (mail address dead)
Modified: 2010-09-21 23:49 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Chris Good (mail address dead) 2010-05-27 19:00:06 UTC
OS: AIX 5.3
gcc: 4.0.0

Error when trying to compile pdb_ldap.c:

Compiling passdb/pdb_ldap.c
passdb/pdb_ldap.c: In function 'ldapsam_get_new_rid':
passdb/pdb_ldap.c:4732: error: incompatible types in assignment
passdb/pdb_ldap.c: In function 'pdb_init_ldapsam':
passdb/pdb_ldap.c:6243: error: incompatible types in assignment
The following command failed:
gcc -I. -I/usr/local/samba-3.2.4/source  -O -D_SAMBA_BUILD_=3  -I/usr/local/samb
a-3.2.4/source/iniparser/src -Iinclude -I./include  -I. -I. -I./lib/replace -I./
lib/talloc -I./lib/tdb/include -I./libaddns -I./librpc -DHAVE_CONFIG_H  -Iinclud
e -I./include -I. -I. -I./lib/replace -I./lib/talloc -I./lib/tdb/include -I./lib
addns -I./librpc -I./popt -DLDAP_DEPRECATED   -I/include -I/usr/local/samba-3.2.
4/source/lib -D_SAMBA_BUILD_=3 -O2 -c passdb/pdb_ldap.c -o passdb/pdb_ldap.o

passdb/pdb_ldap.c line 4732:

       status = smbldap_search_domain_info(smbldap_state, &result,
                                            get_global_sam_name(), False);

smbldap_search_domain_info() is defined in smbldap_util.c but not declared before pdb_ldap.c tries to use it.

To fix, I added to pdb_ldap.c (just before get_userattr_key2string() ) :

NTSTATUS smbldap_search_domain_info(struct smbldap_state *ldap_state,
                            LDAPMessage ** result, const char *domain_name,
                                    bool try_add);
Comment 1 Björn Jacke 2010-09-21 23:49:33 UTC
in 3.2 there was smbldap_search_domain_info not prototyped in a header file which might cause this. But it is since 3.3 and later versions. 3.2 is too old to fix things like that, people should use newer versions.