Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Samba is GPL, but there are other options. I Googled 'smb client library' and saw at three viable-looking libraries on the first page:

https://github.com/naxos/SMBClient

> SMBClient is a small dynamic library that allows iOS apps to access SMB/CIFS file servers.

https://github.com/videolabs/libdsm

> lib Defective SMb (libDSM) is a SMB protocol client implementation in pure old C, with a lot less features than Samba but with a much simpler, and a more permissive license

[…]

> The initial goal of this project is to have a library that can access most SMB shares to read files and that has a license compatible with the iOS/Android/WinRT appstores in order to integrate it into VLC for iOS and VLC for Android.

https://jcifs.samba.org

> JCIFS is an Open Source client library that implements the CIFS/SMB networking protocol in 100% Java. […] This client is used extensively in production on large Intranets.

(Java would be annoying to run on iOS, but probably doable, perhaps using Google's Java-to-Objective-C translator.)

There's also Apple's own SMB implementation, which used to be included in opensource.apple.com source drops, although it seems to be gone as of macOS 10.11; here's the latest version:

https://opensource.apple.com/source/smb/smb-759.40.1/

Or you could go to the BSD SMB implementation that it was based on. I'm not sure how difficult it would be to port either of these to run as a standalone library - it looks like parts are already a library, but smbfs itself is a kernel module - but it's probably viable. In fact, 'fs-utils' from the rumpkernel project, which is an existing effort to port filesystem modules from the BSD kernel to userspace, seems to have a version of it:

https://github.com/rumpkernel/fs-utils/blob/master/lib/exter...

…Forgive me for the wall of links. I guess one example library would have been enough, but I was curious what options were out there.

I don't know how these libraries compare to each other and to Samba in terms of quality and compatibility. Most likely Samba is the best, but they all seem widely used enough that I'd expect them to do the job in most cases.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: