The branch, master has been updated via 9ca44867b0c71ac60aedc65a2dc3886629df563c (commit) via 7c768ddab6c0fb2868c4464fcb760994792dd898 (commit) via 4c6547e8a1f872e5bc1e132ec4ccc6f634166932 (commit) via 8cba97a16459eb1b1dc18c85e542ca571490ec5f (commit) via 6b167ae53b1774950d76a15ba92d9f24e59bc565 (commit) via ddcfdd8ecf3c8c1fa391140715ae6b4038ef10ad (commit) from 261ae2eb112e53d5d82b5f53d2a23e12b2d96945 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 9ca44867b0c71ac60aedc65a2dc3886629df563c Author: Volker Lendecke <v...@samba.org> Date: Sat Jul 25 12:57:46 2009 -0400 Remove a pointless static fstring commit 7c768ddab6c0fb2868c4464fcb760994792dd898 Author: Volker Lendecke <v...@samba.org> Date: Sat Jul 25 12:56:06 2009 -0400 No explicit initialization necessary for a zero blob commit 4c6547e8a1f872e5bc1e132ec4ccc6f634166932 Author: Volker Lendecke <v...@samba.org> Date: Fri Jul 24 19:47:39 2009 -0400 Move 16 bytes from data to r/o text segment commit 8cba97a16459eb1b1dc18c85e542ca571490ec5f Author: Volker Lendecke <v...@samba.org> Date: Fri Jul 24 19:03:45 2009 -0400 Fix a winbind memleak commit 6b167ae53b1774950d76a15ba92d9f24e59bc565 Author: Volker Lendecke <v...@samba.org> Date: Fri Jul 24 14:58:36 2009 -0400 Use a switch statement in charset_name() commit ddcfdd8ecf3c8c1fa391140715ae6b4038ef10ad Author: Volker Lendecke <v...@samba.org> Date: Fri Jul 24 13:28:48 2009 -0400 Fix some nonempty blank lines ----------------------------------------------------------------------- Summary of changes: lib/util/util.c | 4 +--- source3/lib/charcnv.c | 30 +++++++++++++++++++++++------- source3/lib/iconv.c | 34 +++++++++++++++++----------------- source3/smbd/smb2_signing.c | 2 +- source3/utils/net_time.c | 8 +++----- source3/winbindd/winbindd.c | 1 + 6 files changed, 46 insertions(+), 33 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/util/util.c b/lib/util/util.c index 29b47f5..f49d258 100644 --- a/lib/util/util.c +++ b/lib/util/util.c @@ -265,15 +265,13 @@ static void _dump_data(int level, const uint8_t *buf, int len, bool omit_zero_bytes) { int i=0; - const uint8_t empty[16]; + static const uint8_t empty[16] = { 0, }; bool skipped = false; if (len<=0) return; if (!DEBUGLVL(level)) return; - memset(&empty, '\0', 16); - for (i=0;i<len;) { if (i%16 == 0) { diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index 272f107..9ac9930 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -54,14 +54,30 @@ static bool initialized; **/ static const char *charset_name(charset_t ch) { - const char *ret = NULL; - - if (ch == CH_UTF16LE) ret = "UTF-16LE"; - else if (ch == CH_UTF16BE) ret = "UTF-16BE"; - else if (ch == CH_UNIX) ret = lp_unix_charset(); - else if (ch == CH_DOS) ret = lp_dos_charset(); - else if (ch == CH_DISPLAY) ret = lp_display_charset(); - else if (ch == CH_UTF8) ret = "UTF8"; + const char *ret; + + switch (ch) { + case CH_UTF16LE: + ret = "UTF-16LE"; + break; + case CH_UTF16BE: + ret = "UTF-16BE"; + break; + case CH_UNIX: + ret = lp_unix_charset(); + break; + case CH_DOS: + ret = lp_dos_charset(); + break; + case CH_DISPLAY: + ret = lp_display_charset(); + break; + case CH_UTF8: + ret = "UTF8"; + break; + default: + ret = NULL; + } #if defined(HAVE_NL_LANGINFO) && defined(CODESET) if (ret && !strcmp(ret, "LOCALE")) { diff --git a/source3/lib/iconv.c b/source3/lib/iconv.c index 4450054..a6ed429 100644 --- a/source3/lib/iconv.c +++ b/source3/lib/iconv.c @@ -3,17 +3,17 @@ minimal iconv implementation Copyright (C) Andrew Tridgell 2001 Copyright (C) Jelmer Vernooij 2002,2003 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ @@ -172,7 +172,7 @@ size_t smb_iconv(smb_iconv_t cd, while (*inbytesleft > 0) { bufp = cvtbuf; bufsize = sizeof(cvtbuf); - + if (cd->pull(cd->cd_pull, inbuf, inbytesleft, &bufp, &bufsize) == -1 && errno != E2BIG) return -1; @@ -202,7 +202,7 @@ smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode) { smb_iconv_t ret; struct charset_functions *from, *to; - + lazy_initialize_iconv(); from = charsets; to = charsets; @@ -226,7 +226,7 @@ smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode) /* check if we have a builtin function for this conversion */ from = find_charset_functions(fromcode); if(from)ret->pull = from->pull; - + to = find_charset_functions(tocode); if(to)ret->push = to->push; @@ -248,7 +248,7 @@ smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode) ret->push = sys_iconv; } #endif - + /* check if there is a module available that can do this conversion */ if (!ret->pull && NT_STATUS_IS_OK(smb_probe_module("charset", fromcode))) { if(!(from = find_charset_functions(fromcode))) @@ -346,7 +346,7 @@ static size_t ascii_pull(void *cd, const char **inbuf, size_t *inbytesleft, errno = E2BIG; return -1; } - + return 0; } @@ -373,7 +373,7 @@ static size_t ascii_push(void *cd, const char **inbuf, size_t *inbytesleft, errno = E2BIG; return -1; } - + return ir_count; } @@ -400,7 +400,7 @@ static size_t latin1_push(void *cd, const char **inbuf, size_t *inbytesleft, errno = E2BIG; return -1; } - + return ir_count; } @@ -425,7 +425,7 @@ static size_t ucs2hex_pull(void *cd, const char **inbuf, size_t *inbytesleft, errno = EINVAL; return -1; } - + if (sscanf(&(*inbuf)[1], "%04x", &v) != 1) { errno = EILSEQ; return -1; @@ -443,7 +443,7 @@ static size_t ucs2hex_pull(void *cd, const char **inbuf, size_t *inbytesleft, errno = E2BIG; return -1; } - + return 0; } @@ -484,7 +484,7 @@ static size_t ucs2hex_push(void *cd, const char **inbuf, size_t *inbytesleft, errno = E2BIG; return -1; } - + return 0; } @@ -713,7 +713,7 @@ static size_t utf8_push(void *cd, const char **inbuf, size_t *inbytesleft, c[0] = 0xe0 | (codepoint >> 12); c[1] = 0x80 | ((codepoint >> 6) & 0x3f); c[2] = 0x80 | (codepoint & 0x3f); - + in_left -= 2; out_left -= 3; uc += 2; @@ -732,7 +732,7 @@ static size_t utf8_push(void *cd, const char **inbuf, size_t *inbytesleft, } codepoint = 0x10000 + (uc[2] | ((uc[3] & 0x3)<<8) | (uc[0]<<10) | ((uc[1] & 0x3)<<18)); - + if (out_left < 4) { errno = E2BIG; goto error; @@ -741,7 +741,7 @@ static size_t utf8_push(void *cd, const char **inbuf, size_t *inbytesleft, c[1] = 0x80 | ((codepoint >> 12) & 0x3f); c[2] = 0x80 | ((codepoint >> 6) & 0x3f); c[3] = 0x80 | (codepoint & 0x3f); - + in_left -= 4; out_left -= 4; uc += 4; @@ -762,7 +762,7 @@ static size_t utf8_push(void *cd, const char **inbuf, size_t *inbytesleft, *outbytesleft = out_left; *inbuf = (char *)uc; *outbuf = (char *)c; - + return 0; error: diff --git a/source3/smbd/smb2_signing.c b/source3/smbd/smb2_signing.c index 55ed4f6..e584dd9 100644 --- a/source3/smbd/smb2_signing.c +++ b/source3/smbd/smb2_signing.c @@ -85,7 +85,7 @@ NTSTATUS smb2_signing_check_pdu(DATA_BLOB session_key, uint64_t session_id; struct HMACSHA256Context m; uint8_t res[SHA256_DIGEST_LENGTH]; - static const uint8_t zero_sig[16]; + static const uint8_t zero_sig[16] = { 0, }; int i; if (count < 2) { diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c index b619837..d37b5aa 100644 --- a/source3/utils/net_time.c +++ b/source3/utils/net_time.c @@ -78,7 +78,6 @@ static time_t nettime(struct net_context *c, int *zone) /* return a time as a string ready to be passed to /bin/date */ static const char *systime(time_t t) { - static fstring s; struct tm *tm; tm = localtime(&t); @@ -86,10 +85,9 @@ static const char *systime(time_t t) return "unknown"; } - fstr_sprintf(s, "%02d%02d%02d%02d%04d.%02d", - tm->tm_mon+1, tm->tm_mday, tm->tm_hour, - tm->tm_min, tm->tm_year + 1900, tm->tm_sec); - return s; + return talloc_asprintf(talloc_tos(), "%02d%02d%02d%02d%04d.%02d", + tm->tm_mon+1, tm->tm_mday, tm->tm_hour, + tm->tm_min, tm->tm_year + 1900, tm->tm_sec); } int net_time_usage(struct net_context *c, int argc, const char **argv) diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 34eaeb2..49faae1 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -754,6 +754,7 @@ static void winbind_client_request_read(struct tevent_req *req) int err; ret = wb_req_read_recv(req, state, &state->request, &err); + TALLOC_FREE(req); if (ret == -1) { DEBUG(2, ("Could not read client request: %s\n", strerror(err))); -- Samba Shared Repository