Browse Source

Plan 9 from Bell Labs 2007-03-19

David du Colombier 14 years ago
parent
commit
a089a3ca36

+ 4 - 1
dist/replica/_plan9.db

@@ -5769,7 +5769,7 @@ sys/games - 20000000775 sys sys 1117225532 0
 sys/games/lib - 20000000775 sys sys 1165337608 0
 sys/games/lib/4scores - 10000000666 sys sys 1118680448 0
 sys/games/lib/5scores - 10000000666 sys sys 1118680453 0
-sys/games/lib/fortunes - 664 sys sys 1173736758 264000
+sys/games/lib/fortunes - 664 sys sys 1174242183 264068
 sys/games/lib/mahjongg - 20000000775 sys sys 1095792278 0
 sys/games/lib/mahjongg/backgrounds - 20000000775 sys sys 1095792293 0
 sys/games/lib/mahjongg/backgrounds/default.bit - 664 sys sys 1095792293 346803
@@ -15687,3 +15687,6 @@ usr/glenda/lib/profile - 664 glenda glenda 1105128663 890
 usr/glenda/readme.acme - 664 glenda glenda 1019860628 4753
 usr/glenda/readme.rio - 664 glenda glenda 1019860628 6370
 usr/glenda/tmp - 20000000775 glenda glenda 1018802620 0
+sys/src/cmd/aquarela/smbbuffer.c - 664 sys sys 1174276975 10158
+sys/src/cmd/aquarela/smbservice.c - 664 sys sys 1174276975 2392
+sys/src/cmd/aquarela/smbtrans2query.c - 664 sys sys 1174276975 8262

+ 4 - 4
dist/replica/plan9.db

@@ -5769,7 +5769,7 @@ sys/games - 20000000775 sys sys 1117225532 0
 sys/games/lib - 20000000775 sys sys 1165337608 0
 sys/games/lib/4scores - 10000000666 sys sys 1118680448 0
 sys/games/lib/5scores - 10000000666 sys sys 1118680453 0
-sys/games/lib/fortunes - 664 sys sys 1173736758 264000
+sys/games/lib/fortunes - 664 sys sys 1174242183 264068
 sys/games/lib/mahjongg - 20000000775 sys sys 1095792278 0
 sys/games/lib/mahjongg/backgrounds - 20000000775 sys sys 1095792293 0
 sys/games/lib/mahjongg/backgrounds/default.bit - 664 sys sys 1095792293 346803
@@ -9389,7 +9389,7 @@ sys/src/cmd/aquarela/netbios.h - 664 sys sys 1135892110 5967
 sys/src/cmd/aquarela/smb.h - 664 sys sys 1135892110 9492
 sys/src/cmd/aquarela/smballoc.c - 664 sys sys 1135892110 508
 sys/src/cmd/aquarela/smbbrowse.c - 664 sys sys 1135892110 1473
-sys/src/cmd/aquarela/smbbuffer.c - 664 sys sys 1143670679 9728
+sys/src/cmd/aquarela/smbbuffer.c - 664 sys sys 1174276975 10158
 sys/src/cmd/aquarela/smbclientopen.c - 664 sys sys 1135892110 1428
 sys/src/cmd/aquarela/smbcomclose.c - 664 sys sys 1135892110 578
 sys/src/cmd/aquarela/smbcomcreatedir.c - 664 sys sys 1135892110 692
@@ -9428,13 +9428,13 @@ sys/src/cmd/aquarela/smbrap2.c - 664 sys sys 1135892114 11628
 sys/src/cmd/aquarela/smbrap2client.c - 664 sys sys 1135892114 3082
 sys/src/cmd/aquarela/smbrep.c - 664 sys sys 1135892114 1033
 sys/src/cmd/aquarela/smbresponse.c - 664 sys sys 1135892114 2820
-sys/src/cmd/aquarela/smbservice.c - 664 sys sys 1135892114 2335
+sys/src/cmd/aquarela/smbservice.c - 664 sys sys 1174276975 2392
 sys/src/cmd/aquarela/smbsharedfile.c - 664 sys sys 1135892114 6006
 sys/src/cmd/aquarela/smbstring.c - 664 sys sys 1135892114 4152
 sys/src/cmd/aquarela/smbtime.c - 664 sys sys 1135892114 1232
 sys/src/cmd/aquarela/smbtrans2client.c - 664 sys sys 1135892114 3726
 sys/src/cmd/aquarela/smbtrans2find.c - 664 sys sys 1135892115 9041
-sys/src/cmd/aquarela/smbtrans2query.c - 664 sys sys 1135892115 8215
+sys/src/cmd/aquarela/smbtrans2query.c - 664 sys sys 1174276975 8262
 sys/src/cmd/aquarela/smbtrans2set.c - 664 sys sys 1155362132 2510
 sys/src/cmd/aquarela/smbtransaction.c - 664 sys sys 1135892115 16684
 sys/src/cmd/aquarela/smbtree.c - 664 sys sys 1135892115 1314

+ 4 - 0
dist/replica/plan9.log

@@ -47896,3 +47896,7 @@
 1174156206 0 c sys/src/cmd/upas/filterkit/list.c - 664 sys sys 1174155504 4945
 1174186806 0 c 386/9loaddebug - 775 sys sys 1174186577 401944
 1174186806 1 c 386/9loadlitedebug - 775 sys sys 1174186577 202506
+1174242606 0 c sys/games/lib/fortunes - 664 sys sys 1174242183 264068
+1174278606 0 c sys/src/cmd/aquarela/smbbuffer.c - 664 sys sys 1174276975 10158
+1174278606 1 c sys/src/cmd/aquarela/smbservice.c - 664 sys sys 1174276975 2392
+1174278606 2 c sys/src/cmd/aquarela/smbtrans2query.c - 664 sys sys 1174276975 8262

+ 1 - 0
sys/games/lib/fortunes

@@ -4172,3 +4172,4 @@ having read AF_UNIX(7) i'm still don't see the point.  portable programs should
 Please wait. This can take some time.
 I love troff. It reminds me of runoff, which reminds me of my youth, when VMS was in flower and knowledge of EDT and runoff was all a lad needed to make a good living as a tech writer.  - Frank Willison
 General Internet error has occurred. - [OpenOffice.org 2.0]
+Remember to drink responsibly during this St. Patrick's Day season.

+ 18 - 1
sys/src/cmd/aquarela/smbbuffer.c

@@ -280,12 +280,29 @@ smbbuffergetstrn(SmbBuffer *b, ushort size, char **sp)
 int
 smbbuffergetstr(SmbBuffer *b, ulong flags, char **sp)
 {
+	int c;
+	char *p;
 	uchar *np;
-	USED(flags);
+
 	np = memchr(b->buf + b->rn, 0, b->wn - b->rn);
 	if (np == nil)
 		return 0;
 	*sp = strdup((char *)b->buf + b->rn);
+	for (p = *sp; *p != 0; p++) {
+		c = *p;
+		if (c >= 'a' && c <= 'z' && (flags & SMB_STRING_UPCASE))
+			*p = toupper(c);
+		else if (c == '/' && (flags & SMB_STRING_REVPATH))
+			*p = '\\';
+		else if (c == '\\' && (flags & SMB_STRING_PATH))
+			*p = '/';
+		else if (smbglobals.convertspace){
+			if (c == 0xa0 && (flags & SMB_STRING_REVPATH))
+				*p = ' ';
+			else if (c == ' ' && (flags & SMB_STRING_PATH))
+				*p = 0xa0;
+		}
+	}
 	b->rn = np - b->buf + 1;
 	return 1;
 }

+ 3 - 2
sys/src/cmd/aquarela/smbservice.c

@@ -58,10 +58,11 @@ SmbService *
 smbservicefind(SmbSession *s, char *uncpath, char *servicetype, uchar *errclassp, ushort *errorp)
 {
 	char *p, *q;
-	if (uncpath[0] == '/' && uncpath[1] == '/') {
+	if ((uncpath[0] == '/' && uncpath[1] == '/')
+	||  (uncpath[0] == '\\' && uncpath[1] == '\\')) {
 		/* check that the server name matches mine */
 		p = uncpath + 2;
-		q = strchr(p, '/');
+		q = strchr(p, uncpath[0]);
 		if (q == nil)
 			goto bad;
 		*q++ = 0;

+ 3 - 2
sys/src/cmd/aquarela/smbtrans2query.c

@@ -50,8 +50,9 @@ query(SmbSession *s, char *cmdname, char *filename, ushort infolevel, vlong cbo,
 			|| !smbbufferputl(s->transaction.out.data, 0))	// alignment
 			return SmbProcessResultMisc;
 		fnlfixupoffset = smbbufferwriteoffset(s->transaction.out.data);
-		if (!smbbufferputstring(s->transaction.out.data, &s->peerinfo, SMB_STRING_REVPATH, filename)
-			|| !smbbufferfixuprelativel(s->transaction.out.data, fnlfixupoffset))
+		if (!smbbufferputl(s->transaction.out.data, 0)
+		|| !smbbufferputstring(s->transaction.out.data, &s->peerinfo, SMB_STRING_REVPATH, filename)
+		|| !smbbufferfixuprelativel(s->transaction.out.data, fnlfixupoffset))
 			return SmbProcessResultMisc;
 		break;
 	case SMB_QUERY_FILE_STANDARD_INFO: