summaryrefslogtreecommitdiffstats
path: root/source/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-07-29 00:27:23 +0000
committerJeremy Allison <jra@samba.org>1998-07-29 00:27:23 +0000
commit7b3a9d6285cc0d1967155a68845e28c6296ecc67 (patch)
tree09bcc442a9e8b756ea67e5085eac888d86e3fdde /source/smbd
parent17f68cc86cafbb04dbd9cc6ecc0aac7b911c9b70 (diff)
downloadsamba-7b3a9d6285cc0d1967155a68845e28c6296ecc67.tar.gz
samba-7b3a9d6285cc0d1967155a68845e28c6296ecc67.tar.xz
samba-7b3a9d6285cc0d1967155a68845e28c6296ecc67.zip
locking.c: Print messages when we downgrade a lock.
reply.c: Do the same mask expansion we do in trans2.c - needed for Win98. trans2.c: Make the mask expansion into a function call now we have to do it twice. Jeremy.
Diffstat (limited to 'source/smbd')
-rw-r--r--source/smbd/reply.c3
-rw-r--r--source/smbd/trans2.c48
2 files changed, 32 insertions, 19 deletions
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index c9daf14b4b0..f05ba2eee66 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -1081,6 +1081,9 @@ int reply_search(char *inbuf,char *outbuf, int dum_size, int dum_buffsize)
}
}
+ /* Convert the formatted mask. (This code lives in trans2.c) */
+ mask_convert(mask);
+
{
for (p=mask; *p; p++)
{
diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c
index a0aa65601ff..2fcab32afba 100644
--- a/source/smbd/trans2.c
+++ b/source/smbd/trans2.c
@@ -574,6 +574,33 @@ static int get_lanman2_dir_entry(int cnum,char *path_mask,int dirtype,int info_l
}
/****************************************************************************
+ Convert the directory masks formated for the wire.
+****************************************************************************/
+
+void mask_convert( char *mask)
+{
+ /*
+ * We know mask is a pstring.
+ */
+ char *p = mask;
+ while (*p) {
+ if (*p == '<') {
+ pstring expnd;
+ if(p[1] != '"' && p[1] != '.') {
+ pstrcpy( expnd, p+1 );
+ *p++ = '*';
+ *p = '.';
+ safe_strcpy( p+1, expnd, sizeof(pstring) - (p - mask) - 2);
+ } else
+ *p = '*';
+ }
+ if (*p == '>') *p = '?';
+ if (*p == '"') *p = '.';
+ p++;
+ }
+}
+
+/****************************************************************************
reply to a TRANS2_FINDFIRST
****************************************************************************/
static int call_trans2findfirst(char *inbuf, char *outbuf, int bufsize, int cnum,
@@ -678,25 +705,8 @@ static int call_trans2findfirst(char *inbuf, char *outbuf, int bufsize, int cnum
if (dptr_num < 0)
return(ERROR(ERRDOS,ERRbadfile));
- /* convert the formatted masks */
- {
- p = mask;
- while (*p) {
- if (*p == '<') {
- pstring expnd;
- if(p[1] != '"' && p[1] != '.') {
- pstrcpy( expnd, p+1 );
- *p++ = '*';
- *p = '.';
- safe_strcpy( p+1, expnd, sizeof(mask) - (p - mask) - 2);
- } else
- *p = '*';
- }
- if (*p == '>') *p = '?';
- if (*p == '"') *p = '.';
- p++;
- }
- }
+ /* Convert the formatted mask. */
+ mask_convert(mask);
#if 0 /* JRA */
/*