smbglobals.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #include "headers.h"
  10. SmbGlobals smbglobals = {
  11. .maxreceive = 0x1ffff,
  12. .unicode = 1,
  13. .nativeos = "Plan 9 4th edition",
  14. .serverinfo = {
  15. .nativelanman = "Aquarela",
  16. .vmaj = 0,
  17. .vmin = 5,
  18. .stype = SV_TYPE_SERVER,
  19. },
  20. .mailslotbrowse = "/MAILSLOT/BROWSE",
  21. .pipelanman = "/PIPE/LANMAN",
  22. .l2sectorsize = 9,
  23. .l2allocationsize = 14,
  24. .convertspace = 0,
  25. .log = {
  26. .fd = -1,
  27. .print = 0,
  28. .poolparanoia = 1,
  29. },
  30. };
  31. void
  32. smbglobalsguess(int client)
  33. {
  34. if (smbglobals.serverinfo.name == 0)
  35. smbglobals.serverinfo.name = sysname();
  36. if (smbglobals.nbname[0] == 0)
  37. nbmknamefromstring(smbglobals.nbname, smbglobals.serverinfo.name);
  38. if (smbglobals.accountname == nil)
  39. smbglobals.accountname = strdup(getuser());
  40. if (smbglobals.primarydomain == nil)
  41. smbglobals.primarydomain = "PLAN9";
  42. if (smbglobals.serverinfo.remark == nil)
  43. smbglobals.serverinfo.remark = "This is a default server comment";
  44. if (smbglobals.log.fd < 0){
  45. if (client){
  46. smbglobals.log.fd = create("client.log", OWRITE|OTRUNC, 0666);
  47. }
  48. else{
  49. if (access("/sys/log/aquarela", 2) == 0)
  50. smbglobals.log.fd = open("/sys/log/aquarela", OWRITE);
  51. }
  52. }
  53. }