summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-08-20 15:45:16 +0000
committerAndrew Tridgell <tridge@samba.org>1996-08-20 15:45:16 +0000
commit748d65a4ac898708dc7d2fd6f2bdee41489fee86 (patch)
treeb54a4d77d71beba6e6422c366ecb17f57c172614 /source3/smbd/reply.c
parent7f38abfbdb57b4ed33fa0aaacdfe7414d4c19a28 (diff)
downloadsamba-748d65a4ac898708dc7d2fd6f2bdee41489fee86.tar.gz
samba-748d65a4ac898708dc7d2fd6f2bdee41489fee86.tar.bz2
samba-748d65a4ac898708dc7d2fd6f2bdee41489fee86.zip
- fix a bug in NetServerEnum where counted and total were not counted
correctly if there were multiple instances of a name. This led to the infamous "not enough memory" error when browsing (but this isn't the only cause of that message) - fix a triple-chaining bug which affected OpenX following a TconX - fix a serious nmbd bug that meant nmdb would answer packets that it wasn't supposed to, causing havoc with browse lists. - never time out SELF packets. This is an interim fix until I find out why nmbd thought they should be timed out. (This used to be commit 2960c3908c2c3b01a1f2b77def60350018d298e1)
Diffstat (limited to 'source3/smbd/reply.c')
-rw-r--r--source3/smbd/reply.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index a84a9af0c1..7241aadac0 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -130,6 +130,44 @@ static int connection_error(char *inbuf,char *outbuf,int connection_num)
}
+
+/****************************************************************************
+ parse a share descriptor string
+****************************************************************************/
+static void parse_connect(char *p,char *service,char *user,
+ char *password,int *pwlen,char *dev)
+{
+ char *p2;
+
+ DEBUG(4,("parsing connect string %s\n",p));
+
+ p2 = strrchr(p,'\\');
+ if (p2 == NULL)
+ strcpy(service,p);
+ else
+ strcpy(service,p2+1);
+
+ p += strlen(p) + 2;
+
+ strcpy(password,p);
+ *pwlen = strlen(password);
+
+ p += strlen(p) + 2;
+
+ strcpy(dev,p);
+
+ *user = 0;
+ p = strchr(service,'%');
+ if (p != NULL)
+ {
+ *p = 0;
+ strcpy(user,p+1);
+ }
+}
+
+
+
+
/****************************************************************************
reply to a tcon
****************************************************************************/
@@ -149,7 +187,7 @@ int reply_tcon(char *inbuf,char *outbuf)
vuid = valid_uid(uid);
- parse_connect(inbuf,service,user,password,&pwlen,dev);
+ parse_connect(smb_buf(inbuf)+1,service,user,password,&pwlen,dev);
connection_num = make_connection(service,user,password,pwlen,dev,vuid);
@@ -1210,6 +1248,11 @@ int reply_unlink(char *inbuf,char *outbuf)
if (check_name(directory,cnum))
dirptr = OpenDir(directory);
+ /* XXXX the CIFS spec says that if bit0 of the flags2 field is set then
+ the pattern matches against the long name, otherwise the short name
+ We don't implement this yet XXXX
+ */
+
if (dirptr)
{
error = ERRbadfile;