diff options
| author | Stefan Metzmacher <metze@samba.org> | 2014-02-26 20:16:26 +0100 |
|---|---|---|
| committer | Jeremy Allison <jra@samba.org> | 2014-11-25 07:25:45 +0100 |
| commit | 111269d484e912e745ebf0852a06d3b5d426fa30 (patch) | |
| tree | 0ce2826c857a94b26659bab00e9753a876f687b5 /source3/winbindd | |
| parent | a5f35ed5cfe50be9cfd9d10812fd7534e1a12840 (diff) | |
| download | samba-111269d484e912e745ebf0852a06d3b5d426fa30.tar.gz samba-111269d484e912e745ebf0852a06d3b5d426fa30.tar.xz samba-111269d484e912e745ebf0852a06d3b5d426fa30.zip | |
s3:winbindd: make use of talloc_string_sub2() in generate_krb5_ccache()
This way we don't pass a given format string to talloc_asprintf().
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/winbindd')
| -rw-r--r-- | source3/winbindd/winbindd_pam.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c index 53519375c7..d56d2fa23e 100644 --- a/source3/winbindd/winbindd_pam.c +++ b/source3/winbindd/winbindd_pam.c @@ -512,7 +512,20 @@ static const char *generate_krb5_ccache(TALLOC_CTX *mem_ctx, p++; if (p != NULL && *p == 'u' && strchr(p, '%') == NULL) { - gen_cc = talloc_asprintf(mem_ctx, type, uid); + char uid_str[sizeof("18446744073709551615")]; + + snprintf(uid_str, sizeof(uid_str), "%u", uid); + + gen_cc = talloc_string_sub2(mem_ctx, + type, + "%u", + uid_str, + /* remove_unsafe_characters */ + false, + /* replace_once */ + true, + /* allow_trailing_dollar */ + false); } } } |
