summaryrefslogtreecommitdiffstats
path: root/source/smbd
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-06-15 12:14:45 +0000
committerGerald Carter <jerry@samba.org>2006-06-15 12:14:45 +0000
commit7e6fe8e3d3bb8398173778632366303d7ecef37e (patch)
tree4b927e24d293628874d407d2a8f36d90247c7a4a /source/smbd
parentad586149c6ede551f62d3511eba5ab025df1ccbf (diff)
downloadsamba-7e6fe8e3d3bb8398173778632366303d7ecef37e.tar.gz
samba-7e6fe8e3d3bb8398173778632366303d7ecef37e.tar.xz
samba-7e6fe8e3d3bb8398173778632366303d7ecef37e.zip
r16254: pulling klocwork fixes for 3.0.23rc3 (current up to r16251)
Diffstat (limited to 'source/smbd')
-rw-r--r--source/smbd/chgpasswd.c5
-rw-r--r--source/smbd/lanman.c14
-rw-r--r--source/smbd/msdfs.c3
-rw-r--r--source/smbd/open.c3
-rw-r--r--source/smbd/trans2.c4
5 files changed, 19 insertions, 10 deletions
diff --git a/source/smbd/chgpasswd.c b/source/smbd/chgpasswd.c
index 011122ee575..cd847240ddb 100644
--- a/source/smbd/chgpasswd.c
+++ b/source/smbd/chgpasswd.c
@@ -579,6 +579,11 @@ BOOL check_lanman_password(char *user, uchar * pass1,
uint32 acct_ctrl;
const uint8 *lanman_pw;
BOOL ret;
+
+ if ( !(sampass = samu_new(NULL)) ) {
+ DEBUG(0, ("samu_new() failed!\n"));
+ return False;
+ }
become_root();
ret = pdb_getsampwnam(sampass, user);
diff --git a/source/smbd/lanman.c b/source/smbd/lanman.c
index 4d4d9d22591..e4531d8ae98 100644
--- a/source/smbd/lanman.c
+++ b/source/smbd/lanman.c
@@ -2010,6 +2010,12 @@ static BOOL api_NetUserGetGroups(connection_struct *conn,uint16 vuid, char *para
return False;
}
+ if ( !(sampw = samu_new(mem_ctx)) ) {
+ DEBUG(0, ("samu_new() failed!\n"));
+ TALLOC_FREE(mem_ctx);
+ return False;
+ }
+
/* Lookup the user information; This should only be one of
our accounts (not remote domains) */
@@ -2027,11 +2033,6 @@ static BOOL api_NetUserGetGroups(connection_struct *conn,uint16 vuid, char *para
goto done;
}
- if ( !(sampw = samu_new(mem_ctx)) ) {
- DEBUG(0, ("samu_new() failed!\n"));
- goto done;
- }
-
if ( !pdb_getsampwsid(sampw, &user_sid) ) {
DEBUG(10, ("pdb_getsampwsid(%s) failed for user %s\n",
sid_string_static(&user_sid), UserName));
@@ -2212,6 +2213,9 @@ static BOOL api_NetRemoteTOD(connection_struct *conn,uint16 vuid, char *param,ch
/* the client expects to get localtime, not GMT, in this bit
(I think, this needs testing) */
t = localtime(&unixdate);
+ if (!t) {
+ return False;
+ }
SIVAL(p,4,0); /* msecs ? */
SCVAL(p,8,t->tm_hour);
diff --git a/source/smbd/msdfs.c b/source/smbd/msdfs.c
index 700aa2ae81c..55a6850478f 100644
--- a/source/smbd/msdfs.c
+++ b/source/smbd/msdfs.c
@@ -203,7 +203,8 @@ static BOOL parse_symlink(TALLOC_CTX *ctx, char *buf, struct referral **preflist
}
/* parse out the alternate paths */
- while(((alt_path[count] = strtok(NULL,",")) != NULL) && count<MAX_REFERRAL_COUNT) {
+ while((count<MAX_REFERRAL_COUNT) &&
+ ((alt_path[count] = strtok(NULL,",")) != NULL)) {
count++;
}
diff --git a/source/smbd/open.c b/source/smbd/open.c
index 633e70ac314..2e4091d937e 100644
--- a/source/smbd/open.c
+++ b/source/smbd/open.c
@@ -1107,7 +1107,6 @@ files_struct *open_file_ntcreate(connection_struct *conn,
uint32 existing_dos_attributes = 0;
struct pending_message_list *pml = NULL;
uint16 mid = get_current_mid();
- BOOL delayed_for_oplocks = False;
struct timeval request_time = timeval_zero();
struct share_mode_lock *lck = NULL;
NTSTATUS status;
@@ -1148,7 +1147,6 @@ files_struct *open_file_ntcreate(connection_struct *conn,
see if this has timed out. */
request_time = pml->request_time;
- delayed_for_oplocks = state->delayed_for_oplocks;
/* Remove the deferred open entry under lock. */
lck = get_share_mode_lock(NULL, state->dev, state->inode, NULL, NULL);
@@ -1905,7 +1903,6 @@ files_struct *open_directory(connection_struct *conn,
DEBUG(5,("open_directory: invalid create_disposition "
"0x%x for directory %s\n",
(unsigned int)create_disposition, fname));
- file_free(fsp);
set_saved_ntstatus(NT_STATUS_INVALID_PARAMETER);
return NULL;
}
diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c
index 71ff79081de..86743f626e6 100644
--- a/source/smbd/trans2.c
+++ b/source/smbd/trans2.c
@@ -2813,7 +2813,6 @@ static int call_trans2qfilepathinfo(connection_struct *conn, char *inbuf, char *
char *fullpathname;
char *base_name;
char *p;
- char *lock_data = NULL;
SMB_OFF_T pos = 0;
BOOL bad_path = False;
BOOL delete_pending = False;
@@ -2823,6 +2822,9 @@ static int call_trans2qfilepathinfo(connection_struct *conn, char *inbuf, char *
TALLOC_CTX *data_ctx = NULL;
struct ea_list *ea_list = NULL;
uint32 access_mask = 0x12019F; /* Default - GENERIC_EXECUTE mapping from Windows */
+#if defined(DEVELOPER)
+ char *lock_data = NULL;
+#endif
if (!params)
return ERROR_NT(NT_STATUS_INVALID_PARAMETER);