Windows SHARE_INFO_2 结构

标签 windows winapi

在链接中http://msdn.microsoft.com/en-us/library/bb525410%28v=vs.85%29.aspx shi2_password 字段显示

shi2_passwd

当服务器以共享级安全运行时,指向指定共享密码的 Unicode 字符串的指针。如果服务器以用户级安全运行,则该成员将被忽略。 shi2_passwd 成员的长度不能超过 SHPWLEN+1 个字节(包括终止空字符)。对 NetShareSetInfo 函数的调用将忽​​略此成员。 *请注意,Windows 不支持共享级安全。

文档是关于windows操作系统的,注释是什么意思。

最佳答案

来自 Microsoft SMB Protocol Authentication :

Share-level authentication indicates that access to a share is controlled by a password assigned to that share only. Unlike user-level security, this security level does not require a user name for authentication and no user identity is established.

来自 Google Books: Integrating Linux and Windows :

[Share-level authentication] was the first security model that SMB had and is the only security model available in the Core and CorePlus protocols. Windows for Workgroups' vserver.exe implements share level security by default, as does Windows 95.

所以你的问题:

The documentation is about the Windows OS, what does the note mean?

我猜结构成员是为了向后兼容(所以你可以在支持共享级别身份验证的服务器上发出命令,旧的客户端仍然可以访问新的服务器)但不再积极支持。

编辑:至于您似乎好奇的支持部分:存在“不支持”的 Windows 功能,并且出于各种原因:

  • 它们的存在可以帮助内部功能(没有文档,没有支持,您也许可以看到或找到功能,但不应该使用它)。

  • 它们可以被标记为弃用或过时(文档可能存在,但仍然没有支持,因为建议使用不同的、更新的实现)。

“不支持”表示您can't issue a support call to Microsoft寻求有关该主题的帮助,因为他们(不再)支持它。参见示例 Support is ending for Windows XP - Microsoft Windows (停止支持的整个产品)或 CRT functions not supported with /ZW ,在某些使用场景中不支持特定的库函数。

因此,虽然“不受支持”的功能可能完全像您设想的那样工作,但一旦它不支持,您就只能靠自己了。

关于您的 SMB 问题,我的两个引文已经回答了这个问题:共享级身份验证是 SMB 的第一个安全实现,但您现在不应该再使用用户级身份验证。

关于Windows SHARE_INFO_2 结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22630868/

相关文章:

windows - 传递参数和文件名?

windows - 在 Windows 上的 emacs 中使用 "git add -p"的最佳方法是什么?

python - 如何在Python中更改光标图像

c# - Linux 上 Mono 中的 Windows kernel32 函数

windows - 我们不能将 abc.c 和 ABC.c 放在同一个文件夹中吗?有人可以解释一下原因吗

python - 与 bsddb 有关的许可证问题

windows - Windows 上的 git 和系统变量

windows - "This program might not have installed correctly"

c++ - 在模态对话框中显示图标

c++ - 如何获取从 QMainWindow 派生的类的 HWND