问题标签 [cifs]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
304 浏览

java - 使用 Java 查询 Active Directory 以查找可用的 CIFS 共享

这是场景:

我有几个CIFS分区,基于 AD 的用户可以安装和使用这些分区来访问他们的文件等。

现在我们需要通过基于 Java 的 Web 应用程序将其公开给用户。所以理想情况下,当用户登录时;他/她应该能够看到CIFS他可以访问的所有分区。这意味着 Java 应用程序应该能够通过LDAP等方式查询 Active Directory 服务器,以识别哪些所有CIFS分区都可用以及各自的ACLs.

所以问题是:

  1. 我们可以使用LDAP(Java-based library)查询AD来找出哪些用户可以访问哪些CIFS共享?
  2. 有没有其他方法可以从 Java 应用程序中做到这一点?
0 投票
3 回答
1545 浏览

linux - CIFS/SMB 写入优化

我正在考虑对 CIFS/SMB 进行写入优化,以抑制重复块的写入。例如,我从远程共享读取文件并修改文件末尾附近的部分。当我保存文件时,我只想将文件中实际更改的部分的写请求发送回远程端。所以基本上,抑制所有写入,直到遇到非重复写入为止。届时,抑制将被禁用,并且将照常允许写入。问题是我找不到任何文档 MS-SMB/MS-SMB2/MS-CIFS 或其他表明这是否是有效的做法。有谁知道这是否有效?

0 投票
0 回答
196 浏览

c# - 创建要映射为网络驱动器的 WebService

编辑:如何创建可以映射为网络驱动器的 Web 服务?Flickr、Google Drive 和 Skydrive 都支持这一点,我也想做一个 web 服务。

0 投票
1 回答
238 浏览

linux - 我的 CIFS 挂载是否存在时钟差异?

我在我的 Linux 机器上安装了一个 Windows 共享,cifs并且由于机器之间的时差而遇到一些问题。例如,在 Emacs 中处理文件时,如果我尝试保存更改,Emacs 会警告我该文件自上次读入后已更改。

我的猜测是,当我保存文件时,更改会传回托管共享的机器,并且修改时间会根据该机器的时钟更新。也就是说,我不熟悉如何cifs工作。如果这是一个合理的解释,我该如何解决这个问题?如果不是,那么根本问题可能是什么?

0 投票
2 回答
3161 浏览

python - How to tell if a file is being written to a Windows CIFS share from Linux

I'm trying to write a script to take video files (ranging from several MB to several GB) written to a shared folder on a Windows server.

Ideally, the script will run on a Linux machine watching the Windows shared folder at an interval of something like every 15-120 seconds, and upload any files that have fully finished writing to the shared folder to an FTP site.

I haven't been able to determine any criteria that allows me to know for certain whether a file has been fully written to the share. It seems like Windows reserves a spot on the share for the entire size of the file (so the file size does not grow incrementally), and the modified date seems to be the time the file started writing, but it is not incremented as the file continues to grow. LSOF and fuser do not seem to be aware of the file, and even Samba tools don't seem to indicate it's locked, but I'm not sure if that's because I haven't mounted with the correct options. I've tried things like trying to open the file or rename it, and the best I've been able to come up with is a "Text File Busy" error code, but this seems to cause major delays in file copying. Naively uploading the file without checking to see if it has finished copying not only does not throw any kind of error, but actually seems to upload nul or random bytes from the allocated space to the FTP resulting in a totally corrupt file (if the network writing process is slower than the FTP) .

I have zero control over the writing process. It will take place on dozens of machines and consist pretty much exclusively of Windows OS file copies to a network share.

I can control the share options on the Windows server, and I have full control over the Linux box. Is there some method of checking locks on a Windows CIFS share that would allow me to be sure that the file has completely finished writing before I try to upload it via FTP? Or is the only possible solution to have the Linux server locally own the share?

Edit

The tldr, I'm really looking for the equivalent of something like 'lsof' that works for a cifs mounted share. I don't care how low level, though it would be ideal if it was something I could call from Python. I can't move the share or rename the files before they arrive.

0 投票
1 回答
22538 浏览

caching - 如何在 linux 的客户端禁用 CIFS (samba) 中的缓存

开发了一个应用程序,可以在具有 2.6.10 内核的目标上运行。windows机器上的共享文件夹通过命令挂载:

正如您从命令选项中可以理解的那样forcedirectio,我想在客户端禁用缓存。但我不能。

目标上的可用 RAM 量为 40 MB。当我复制一个大小约为 10MB 的文件时,可用 RAM 大小减少到 30MB。

内核 2.6.10 使用 cifs.1.28。我还将 oplockEnabled 设置为 0(在源代码和 /proc/fs/cifs/OplockEnabled 中)。但它并没有停止缓存。如何真正禁用 cifs 客户端上的缓存?

0 投票
1 回答
299 浏览

ios - 开发自定义 ios/ipad 应用程序以访问 Active Directory 中的 windows 共享文件夹

这是一个广泛的问题,所以我不希望有任何明确/准确的答案。我只想要想法。

我需要开发一个自定义 iPad 应用程序以从 Active Directory 中的 Windows 共享文件夹访问文档(上传/下载),同时保留用户权限/访问权限。这些是我的想法:

  • 首先,我查看了开源项目 seafile。它基本上是一个与 windows 文件夹同步的存储库,但它以自己的方式管理用户权限。
  • 其次,我想在我的应用程序上实现 cifs 协议。但我读过它是一个很难实现的协议。
  • 第三,我想在服务器上运行一个可以访问活动目录的应用程序并实现 iPad 和服务器应用程序之间的连接,所以我摆脱了 cifs 协议。

我不知道如何处理这个问题,因为在 1-2 个月的时间表中,这似乎是一项艰巨的任务。我可以使用一些开源工具/应用程序/项目吗?任何想法表示赞赏。

0 投票
1 回答
439 浏览

c++ - readdir 在已安装的 cifs 目录上花费了很长时间

我正在运行以下代码:

当它到达我有 readdir() 的已安装 CIFS 文件夹时,有时需要15 分钟才能返回。有人愿意告诉我正在发生的事情以及如何获得更友好的体验吗?每次我运行代码并且具有共享文件夹的计算机处于脱机状态时,都会发生这种情况。它也是任意发生的(据我所知),也许是当具有共享文件夹硬盘的计算机“空闲”时。

你说的文件夹是怎么挂载的?

192.168.0.6 正在运行 Windows 8,如果这很重要的话。谢谢!

0 投票
1 回答
2609 浏览

ubuntu-12.04 - Alfresco 4.2c CIFS 配置问题

我在 Ubuntu 12.04 上全新安装了 Alfresco 4.2。我已经“成功”配置了 CIFS 并修改了 iptables 以包括 SMB 和 NetBios 的(NAT)端口(1445 TCP -- 445 TCP 和 1137-1139 TCP/UDP 到 137-139 TCP/UDP)。此外,这台机器是亚马逊的 EC2 实例,因此我创建了安全组以包括入站流量 445,137-139 TCP 和 137-139 UDP。当使用网络驱动器从 Windows 机器连接时,我成功连接(似乎端口 445 正在工作)但只显示两个文件夹(一个是站点名称,另一个是 swsdp)。当我移动到站点文件夹时,没有内容(\server\alfresco\site-name),因此缺少 documentLibrary 和所有子文件夹。我已经仔细检查了用于连接的用户是否有权查看内容(即使以管理员身份连接,问题仍然存在)。

我遵循了 http://andoylang.wordpress.com/2010/07/20/alfresco-with-cifs/上建议的步骤, 并尝试在 linux 框中隔离问题。当我使用 sbmclient 连接时,出现以下错误:

我对身份验证服务失败的理解也是如此。我在 /opt/bitnami/apache-tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties 获得了以下调试条目:

但是日志文件中没有与此 Auth 错误相关的输出。这是启用此调试的正确 log4j 文件吗?我还能做些什么来解决这个问题?

0 投票
0 回答
490 浏览

svn - 来自 Ubuntu 的已安装驱动器上的 SVN 存储库

为了我的个人开发,我一直在将 SVN 与 NAS 驱动器上的存储库一起使用。
由于它是单用户,我不担心 file:// 比赛。
只要我使用 Windows 机器,一切都很好。
现在我正在尝试在 Ubuntu 上进行开发,并已成功安装 NAS 并检查代码。但是,在提交时,我收到一个错误:

我正在使用 cifs(来自 fstab)安装并尝试以普通用户和 sudo 的身份提交并获得相同的结果。
NAS 驱动器是我局域网上的 WD World Edition

有任何想法吗?