From 3abe405fb413d62c28de04427052d82846de195e Mon Sep 17 00:00:00 2001 From: Amitay Isaacs Date: Mon, 8 Aug 2016 17:40:51 +1000 Subject: [PATCH] passdb: Fix format-nonliteral warning BUG: https://bugzilla.samba.org/show_bug.cgi?id=12168 Signed-off-by: Amitay Isaacs Reviewed-by: Andreas Schneider Reviewed-by: Jeremy Allison (cherry picked from commit c1a791e17c6e94c7d33351c420f238b06461a044) --- source3/passdb/pdb_samba_dsdb.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/source3/passdb/pdb_samba_dsdb.c b/source3/passdb/pdb_samba_dsdb.c index 19c6705dfcb..97806c4af25 100644 --- a/source3/passdb/pdb_samba_dsdb.c +++ b/source3/passdb/pdb_samba_dsdb.c @@ -660,7 +660,13 @@ static NTSTATUS pdb_samba_dsdb_getsamupriv(struct pdb_samba_dsdb_state *state, static NTSTATUS pdb_samba_dsdb_getsampwfilter(struct pdb_methods *m, struct pdb_samba_dsdb_state *state, struct samu *sam_acct, - const char *exp_fmt, ...) _PRINTF_ATTRIBUTE(4, 5) + const char *exp_fmt, ...) + PRINTF_ATTRIBUTE(4,5); + +static NTSTATUS pdb_samba_dsdb_getsampwfilter(struct pdb_methods *m, + struct pdb_samba_dsdb_state *state, + struct samu *sam_acct, + const char *exp_fmt, ...) { struct ldb_message *priv; NTSTATUS status; @@ -885,8 +891,13 @@ static NTSTATUS pdb_samba_dsdb_update_login_attempts(struct pdb_methods *m, return NT_STATUS_NOT_IMPLEMENTED; } +static NTSTATUS pdb_samba_dsdb_getgrfilter(struct pdb_methods *m, + GROUP_MAP *map, + const char *exp_fmt, ...) + PRINTF_ATTRIBUTE(3,4); + static NTSTATUS pdb_samba_dsdb_getgrfilter(struct pdb_methods *m, GROUP_MAP *map, - const char *exp_fmt, ...) _PRINTF_ATTRIBUTE(4, 5) + const char *exp_fmt, ...) { struct pdb_samba_dsdb_state *state = talloc_get_type_abort( m->private_data, struct pdb_samba_dsdb_state); @@ -1014,7 +1025,7 @@ static NTSTATUS pdb_samba_dsdb_getgrsid(struct pdb_methods *m, GROUP_MAP *map, return NT_STATUS_NO_MEMORY; } - status = pdb_samba_dsdb_getgrfilter(m, map, filter); + status = pdb_samba_dsdb_getgrfilter(m, map, "%s", filter); TALLOC_FREE(filter); return status; } @@ -1058,7 +1069,7 @@ static NTSTATUS pdb_samba_dsdb_getgrnam(struct pdb_methods *m, GROUP_MAP *map, return NT_STATUS_NO_MEMORY; } - status = pdb_samba_dsdb_getgrfilter(m, map, filter); + status = pdb_samba_dsdb_getgrfilter(m, map, "%s", filter); TALLOC_FREE(filter); return status; } @@ -1898,9 +1909,15 @@ static void pdb_samba_dsdb_search_end(struct pdb_search *search) } static bool pdb_samba_dsdb_search_filter(struct pdb_methods *m, + struct pdb_search *search, + struct pdb_samba_dsdb_search_state **pstate, + const char *exp_fmt, ...) + PRINTF_ATTRIBUTE(4, 5); + +static bool pdb_samba_dsdb_search_filter(struct pdb_methods *m, struct pdb_search *search, struct pdb_samba_dsdb_search_state **pstate, - const char *exp_fmt, ...) _PRINTF_ATTRIBUTE(4, 5) + const char *exp_fmt, ...) { struct pdb_samba_dsdb_state *state = talloc_get_type_abort( m->private_data, struct pdb_samba_dsdb_state); -- 2.11.4.GIT