windows-specific-behavior.rst 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. ==========================
  2. Windows-specific Behaviour
  3. ==========================
  4. Salt is capable of managing Windows systems, however due to various differences
  5. between the operating systems, there are some things you need to keep in mind.
  6. This document will contain any quirks that apply across Salt or generally across
  7. multiple module functions. Any Windows-specific behavior for particular module
  8. functions will be documented in the module function documentation. Therefore
  9. this document should be read in conjunction with the module function
  10. documentation.
  11. Group parameter for files
  12. =========================
  13. Salt was originally written for managing Unix-based systems, and therefore the
  14. file module functions were designed around that security model. Rather than
  15. trying to shoehorn that model on to Windows, Salt ignores these parameters and
  16. makes non-applicable module functions unavailable instead.
  17. One of the commonly ignored parameters is the ``group`` parameter for managing
  18. files. Under Windows, while files do have a 'primary group' property, this is
  19. rarely used. It generally has no bearing on permissions unless intentionally
  20. configured and is most commonly used to provide Unix compatibility (e.g.
  21. Services For Unix, NFS services).
  22. Because of this, any file module functions that typically require a group, do
  23. not under Windows. Attempts to directly use file module functions that operate
  24. on the group (e.g. ``file.chgrp``) will return a pseudo-value and cause a log
  25. message to appear. No group parameters will be acted on.
  26. If you do want to access and change the 'primary group' property and understand
  27. the implications, use the ``file.get_pgid`` or ``file.get_pgroup`` functions or
  28. the ``pgroup`` parameter on the ``file.chown`` module function.
  29. Dealing with case-insensitive but case-preserving names
  30. =======================================================
  31. Windows is case-insensitive, but however preserves the case of names and it is
  32. this preserved form that is returned from system functions. This causes some
  33. issues with Salt because it assumes case-sensitive names. These issues
  34. generally occur in the state functions and can cause bizarre looking errors.
  35. To avoid such issues, always pretend Windows is case-sensitive and use the right
  36. case for names, e.g. specify ``user=Administrator`` instead of
  37. ``user=administrator``.
  38. Follow :issue:`11801` for any changes to this behavior.
  39. Dealing with various username forms
  40. ===================================
  41. Salt does not understand the various forms that Windows usernames can come in,
  42. e.g. username, mydomain\\username, username@mydomain.tld can all refer to the
  43. same user. In fact, Salt generally only considers the raw username value, i.e.
  44. the username without the domain or host information.
  45. Using these alternative forms will likely confuse Salt and cause odd errors to
  46. happen. Use only the raw username value in the correct case to avoid problems.
  47. Follow :issue:`11801` for any changes to this behavior.
  48. Specifying the None group
  49. =========================
  50. Each Windows system has built-in _None_ group. This is the default 'primary
  51. group' for files for users not on a domain environment.
  52. Unfortunately, the word _None_ has special meaning in Python - it is a special
  53. value indicating 'nothing', similar to ``null`` or ``nil`` in other languages.
  54. To specify the None group, it must be specified in quotes, e.g.
  55. ``./salt '*' file.chpgrp C:\path\to\file "'None'"``.
  56. Symbolic link loops
  57. ===================
  58. Under Windows, if any symbolic link loops are detected or if there are too many
  59. levels of symlinks (defaults to 64), an error is always raised.
  60. For some functions, this behavior is different to the behavior on Unix
  61. platforms. In general, avoid symlink loops on either platform.