Bug 4559 - Possible bad initializer in nss_info_template.c
Summary: Possible bad initializer in nss_info_template.c
Status: RESOLVED WORKSFORME
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.9
Hardware: Sparc Solaris
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-26 14:21 UTC by David S. Collier-Brown
Modified: 2020-12-20 22:39 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David S. Collier-Brown 2007-04-26 14:21:18 UTC
Using gcc3 on Solaris 10, I get a warning about a type mismatch

Compiling nsswitch/nss_info_template.c
nsswitch/nss_info_template.c:75: warning: initialization from incompatible pointer type

This is the .get_nss_info = nss_template_get_info line below:

static struct nss_info_methods nss_template_methods = {
        .init         = nss_template_init,
        .get_nss_info = nss_template_get_info,
        .close_fn     = nss_template_close
};
Comment 1 David S. Collier-Brown 2007-04-26 14:36:05 UTC
It's define in  nss_info.hline 66 as

struct nss_info_methods {
        NTSTATUS (*init)( struct nss_domain_entry *e );
        NTSTATUS (*get_nss_info)( struct nss_domain_entry *e,
                                  const DOM_SID *sid,
                                  TALLOC_CTX *ctx,
                                  ADS_STRUCT *ads, LDAPMessage *msg,
                                  char **homedir, char **shell, char **gecos, gid_t *p_gid);
        NTSTATUS (*close_fn)( void );
};


while the thing beingassigned is declared
static NTSTATUS nss_template_get_info( struct nss_domain_entry *e,
                                       const DOM_SID *sid,
                                       TALLOC_CTX *ctx,
                                       ADS_STRUCT *ads,
                                       LDAPMessage *msg,
                                       char **homedir,
                                       char **shell,
                                       char **gecos,
                                       uint32 *gid )

These differ in the gid field, which is a gid_t * in the  recipient
of the assignment and a a uint32 * in the function bing assigned.

--dave (nitpicking) c-b
Comment 2 Björn Jacke 2020-12-20 22:39:58 UTC
this doesn't apply for recent samba versions any more