diff options
author | Volker Lendecke <vl@samba.org> | 2010-09-21 21:16:31 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-09-22 15:42:28 -0700 |
commit | 7ba5855a734037cf7308007b953ce0a92b050173 (patch) | |
tree | 1ecffda07fab4f3ceb1d02e229cca8aa6335fca6 /source3/pam_smbpass | |
parent | fe4576dff0dd949d87a099afc6b66e4763537fdd (diff) | |
download | samba-7ba5855a734037cf7308007b953ce0a92b050173.tar.gz samba-7ba5855a734037cf7308007b953ce0a92b050173.tar.bz2 samba-7ba5855a734037cf7308007b953ce0a92b050173.zip |
s3: Fix pam_smbpass logging on FreeBSD
Diffstat (limited to 'source3/pam_smbpass')
-rw-r--r-- | source3/pam_smbpass/support.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source3/pam_smbpass/support.c b/source3/pam_smbpass/support.c index 715a0f43bb..4215c72991 100644 --- a/source3/pam_smbpass/support.c +++ b/source3/pam_smbpass/support.c @@ -93,22 +93,20 @@ void _log_err( pam_handle_t *pamh, int err, const char *format, ... ) void _log_err( pam_handle_t *pamh, int err, const char *format, ... ) { va_list args; - const char tag[] = "(pam_smbpass) "; char *mod_format; - mod_format = SMB_MALLOC_ARRAY(char, sizeof(tag) + strlen(format)); - /* try really, really hard to log something, since this may have - been a message about a malloc() failure... */ - if (mod_format == NULL) { + if (asprintf(&mod_format, "(pam_smbpass) %s", format) == -1) { + /* + * try really, really hard to log something, since + * this may have been a message about a malloc() + * failure... + */ va_start(args, format); vsyslog(err | LOG_AUTH, format, args); va_end(args); return; } - strncpy(mod_format, tag, strlen(tag)+1); - strlcat(mod_format, format, strlen(format)+1); - va_start(args, format); vsyslog(err | LOG_AUTH, mod_format, args); va_end(args); |