1 #include "headers.h"
2
3 SmbGlobals smbglobals = {
4 .maxreceive = 0x1ffff,
5 .unicode = 1,
6 .nativeos = "Plan 9 4th edition",
7 .serverinfo = {
8 .nativelanman = "Aquarela",
9 .vmaj = 0,
10 .vmin = 5,
11 .stype = SV_TYPE_SERVER,
12 },
13 .mailslotbrowse = "/MAILSLOT/BROWSE",
14 .pipelanman = "/PIPE/LANMAN",
15 .l2sectorsize = 9,
16 .l2allocationsize = 14,
17 .convertspace = 0,
18 .log = {
19 .fd = -1,
20 .print = 0,
21 .poolparanoia = 1,
22 },
23 };
24
25 void
smbglobalsguess(int client)26 smbglobalsguess(int client)
27 {
28 if (smbglobals.serverinfo.name == 0)
29 smbglobals.serverinfo.name = sysname();
30 if (smbglobals.nbname[0] == 0)
31 nbmknamefromstring(smbglobals.nbname, smbglobals.serverinfo.name);
32 if (smbglobals.accountname == nil)
33 smbglobals.accountname = strdup(getuser());
34 if (smbglobals.primarydomain == nil)
35 smbglobals.primarydomain = "PLAN9";
36 if (smbglobals.serverinfo.remark == nil)
37 smbglobals.serverinfo.remark = "This is a default server comment";
38 if (smbglobals.log.fd < 0)
39 if (client){
40 smbglobals.log.fd = create("client.log", OWRITE|OTRUNC, 0666);
41 }
42 else{
43 if (access("/sys/log/aquarela", 2) == 0)
44 smbglobals.log.fd = open("/sys/log/aquarela", OWRITE);
45 }
46 }
47