summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-02-01 02:06:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:29 -0500
commitc1d7588c74ecfb8cf613256629e272b81f154aa6 (patch)
treeab8cc5e113756a2efa27357c49c0d822994f2eb2 /source3
parent784adfbcbb7f3e85b81b3df5a5c8823663bac8d5 (diff)
downloadsamba-c1d7588c74ecfb8cf613256629e272b81f154aa6.tar.gz
samba-c1d7588c74ecfb8cf613256629e272b81f154aa6.tar.bz2
samba-c1d7588c74ecfb8cf613256629e272b81f154aa6.zip
r5154: Tidy up interface a little.
Jeremy. (This used to be commit a38eeb765f4c744ca7bf0aca86bb448240ad295d)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/dir.c6
-rw-r--r--source3/smbd/reply.c5
-rw-r--r--source3/smbd/trans2.c4
3 files changed, 9 insertions, 6 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 7f1237cb29..29ef4cbe61 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -196,13 +196,15 @@ uint16 dptr_attr(int key)
Returns 0 on ok, 1 on fail.
****************************************************************************/
-BOOL dptr_set_wcard_and_attributes(int key, char *wcard, uint16 attr)
+BOOL dptr_set_wcard_and_attributes(int key, const char *wcard, uint16 attr)
{
struct dptr_struct *dptr = dptr_get(key, False);
if (dptr) {
dptr->attr = attr;
- dptr->wcard = wcard;
+ dptr->wcard = SMB_STRDUP(wcard);
+ if (!dptr->wcard)
+ return False;
dptr->has_wild = ms_has_wild(wcard);
return True;
}
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index c9e35e6a6a..899dba56d8 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -899,7 +899,10 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
END_PROFILE(SMBsearch);
return ERROR_DOS(ERRDOS,ERRnofids);
}
- dptr_set_wcard_and_attributes(dptr_num, SMB_STRDUP(mask), dirtype);
+ if (!dptr_set_wcard_and_attributes(dptr_num, mask, dirtype)) {
+ END_PROFILE(SMBsearch);
+ return ERROR_DOS(ERRDOS,ERRnomem);
+ }
} else {
dirtype = dptr_attr(dptr_num);
}
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 11c21650d4..d2cef6049d 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1437,13 +1437,11 @@ close_if_end = %d requires_resume_key = %d level = 0x%x, max_data_bytes = %d\n",
/* Save the wildcard match and attribs we are using on this directory -
needed as lanman2 assumes these are being saved between calls */
- if(!(wcard = SMB_STRDUP(mask))) {
+ if (!dptr_set_wcard_and_attributes(dptr_num, mask, dirtype)) {
dptr_close(&dptr_num);
return ERROR_DOS(ERRDOS,ERRnomem);
}
- dptr_set_wcard_and_attributes(dptr_num, wcard, dirtype);
-
DEBUG(4,("dptr_num is %d, wcard = %s, attr = %d\n",dptr_num, wcard, dirtype));
/* We don't need to check for VOL here as this is returned by