[SCM] Samba Shared Repository - branch v3-2-test updated -
initial-v3-2-test-1684-g71d6580
Volker Lendecke
vl at samba.org
Fri Jan 25 20:23:52 GMT 2008
The branch, v3-2-test has been updated
via 71d6580c837adcc2cddcdff561f6fb09701501ee (commit)
via d28a537277bedb65d1c2a01c971a3a22b1aa6624 (commit)
via e78f6872bfc19ce0476b8d79c856a8d9c646a913 (commit)
via f591bd68eafdbaefcaa95510cc4cb9a74cef0562 (commit)
from c94c04e3e6f6ae243a55534a76654755bff55651 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit 71d6580c837adcc2cddcdff561f6fb09701501ee
Author: Volker Lendecke <vl at samba.org>
Date: Fri Jan 25 21:20:39 2008 +0100
Fix bogus uninitialized variable warnings
commit d28a537277bedb65d1c2a01c971a3a22b1aa6624
Author: Volker Lendecke <vl at samba.org>
Date: Fri Jan 25 11:13:19 2008 +0100
Fix Coverity IDs 451, 452
commit e78f6872bfc19ce0476b8d79c856a8d9c646a913
Author: Volker Lendecke <vl at samba.org>
Date: Fri Jan 25 09:28:19 2008 +0100
Tiny simplification
commit f591bd68eafdbaefcaa95510cc4cb9a74cef0562
Author: Volker Lendecke <vl at samba.org>
Date: Fri Jan 25 09:21:44 2008 +0100
Remove a pointless while loop
-----------------------------------------------------------------------
Summary of changes:
source/client/smbmnt.c | 2 +-
source/client/smbmount.c | 2 +-
source/lib/util_sock.c | 33 ++++++++++++++-------------------
source/registry/regfio.c | 2 +-
source/rpcclient/cmd_spoolss.c | 2 +-
5 files changed, 18 insertions(+), 23 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/client/smbmnt.c b/source/client/smbmnt.c
index 79c55b2..198faca 100644
--- a/source/client/smbmnt.c
+++ b/source/client/smbmnt.c
@@ -162,7 +162,7 @@ do_mount(char *share_name, unsigned int flags, struct smb_mount_data *data)
char *release, *major, *minor;
char *data1, *data2;
int ret;
- char *saveptr;
+ char *saveptr = NULL;
if (asprintf(&opts,
"version=7,uid=%d,gid=%d,file_mode=0%o,dir_mode=0%o,%s",
diff --git a/source/client/smbmount.c b/source/client/smbmount.c
index 9fe2d36..ee4b180 100644
--- a/source/client/smbmount.c
+++ b/source/client/smbmount.c
@@ -764,7 +764,7 @@ static void parse_mount_smb(int argc, char **argv)
char *opts;
char *opteq;
int val;
- char *saveptr;
+ char *saveptr = NULL;
TALLOC_CTX *ctx = talloc_tos();
/* FIXME: This function can silently fail if the arguments are
diff --git a/source/lib/util_sock.c b/source/lib/util_sock.c
index 1a7cc02..ced1130 100644
--- a/source/lib/util_sock.c
+++ b/source/lib/util_sock.c
@@ -1123,20 +1123,16 @@ ssize_t read_smb_length_return_keepalive(int fd,
{
ssize_t len=0;
int msg_type;
- bool ok = false;
- while (!ok) {
- ok = (read_socket_with_timeout(fd,inbuf,4,4,timeout,pre) == 4);
- if (!ok) {
- return -1;
- }
+ if (read_socket_with_timeout(fd, inbuf, 4, 4, timeout, pre) != 4) {
+ return -1;
+ }
- len = smb_len(inbuf);
- msg_type = CVAL(inbuf,0);
+ len = smb_len(inbuf);
+ msg_type = CVAL(inbuf,0);
- if (msg_type == SMBkeepalive) {
- DEBUG(5,("Got keepalive packet\n"));
- }
+ if (msg_type == SMBkeepalive) {
+ DEBUG(5,("Got keepalive packet\n"));
}
DEBUG(10,("got smb length of %lu\n",(unsigned long)len));
@@ -1154,16 +1150,15 @@ ssize_t read_smb_length_return_keepalive(int fd,
ssize_t read_smb_length(int fd, char *inbuf, unsigned int timeout, enum smb_read_errors *pre)
{
ssize_t len;
+ uint8_t msgtype = SMBkeepalive;
- for(;;) {
- len = read_smb_length_return_keepalive(fd, inbuf, timeout, pre);
-
- if(len < 0)
+ while (msgtype == SMBkeepalive) {
+ len = read_smb_length_return_keepalive(fd, inbuf, timeout,
+ pre);
+ if (len < 0) {
return len;
-
- /* Ignore session keepalives. */
- if(CVAL(inbuf,0) != SMBkeepalive)
- break;
+ }
+ msgtype = CVAL(inbuf, 0);
}
DEBUG(10,("read_smb_length: got smb length of %lu\n",
diff --git a/source/registry/regfio.c b/source/registry/regfio.c
index 92077aa..3740ff0 100644
--- a/source/registry/regfio.c
+++ b/source/registry/regfio.c
@@ -1234,7 +1234,7 @@ static void regfio_mem_free( REGF_FILE *file )
/* cleanup for a file opened for write */
- if ( file->open_flags & (O_WRONLY|O_RDWR) ) {
+ if ((file->fd != -1) && (file->open_flags & (O_WRONLY|O_RDWR))) {
prs_struct ps;
REGF_SK_REC *sk;
diff --git a/source/rpcclient/cmd_spoolss.c b/source/rpcclient/cmd_spoolss.c
index d98cb99..b5282d2 100644
--- a/source/rpcclient/cmd_spoolss.c
+++ b/source/rpcclient/cmd_spoolss.c
@@ -1252,7 +1252,7 @@ static bool init_drv_info_3_members ( TALLOC_CTX *mem_ctx, DRIVER_INFO_3 *info,
{
char *str, *str2;
uint32 len, i;
- char *saveptr;
+ char *saveptr = NULL;
/* fill in the UNISTR fields */
str = get_driver_3_param (args, ":", &info->name);
--
Samba Shared Repository
More information about the samba-cvs
mailing list