#smb #samba #network-protocol #smb2 #smb3

sys pavao

Rust client library for SMB 2/3 based on libsmbclient

5 releases

0.2.3 May 16, 2023
0.2.2 May 16, 2023
0.1.2 May 26, 2022

#841 in Network programming

Download history 74/week @ 2023-05-31 41/week @ 2023-06-07 64/week @ 2023-06-14 73/week @ 2023-06-21 44/week @ 2023-06-28 151/week @ 2023-07-05 85/week @ 2023-07-12 58/week @ 2023-07-19 67/week @ 2023-07-26 41/week @ 2023-08-02 87/week @ 2023-08-09 97/week @ 2023-08-16 60/week @ 2023-08-23 60/week @ 2023-08-30 97/week @ 2023-09-06 59/week @ 2023-09-13

295 downloads per month
Used in 2 crates (via remotefs-smb)




~ A Rust client library for SMB ~

Get started · Crates.io · Documentation

Developed by @veeso

Current version: 0.2.3 (16/05/2023)

License-GPLv3 Repo stars Downloads counter Latest version Ko-fi

Linux CI MacOS CI Coveralls Docs

About Pavão 🦚

Pavão (/pɐ.ˈvɐ̃w̃/) is a Rust client library for SMB version 2 and 3 which exposes type-safe functions to interact with the C libsmbclient.

Pavão |> Pavé |> Animal Crossing |> Carnival |> Rio De Janeiro |> Samba |> SMB

Get started 🏁

Add pavao to your Cargo.toml 🦀

pavao = "0.2"

Install pavao C dependencies on your system 🖥️

MacOS 🍎

Install samba with brew:

brew install samba

Debian based systems 🐧

Install libsmbclient with apt:

apt install -y libsmbclient-dev libsmbclient

⚠️ libsmbclient-dev is required only on the machine where you build the application

RedHat based systems 🐧

Install libsmbclient with dnf:

dnf install libsmbclient-devel libsmbclient

⚠️ libsmbclient-devel is required only on the machine where you build the application

Build from sources 📁

Install libsmbclient building from sources:

wget -O samba.tar.gz https://github.com/samba-team/samba/archive/refs/tags/samba-4.16.1.tar.gz
mkdir -p samba/
tar  xzvf samba.tar.gz -C samba/ --strip-components=1
rm samba.tar.gz
cd samba/
make install
cd ..
rm -rf samba/

Create a pavao application

use pavao::{SmbClient, SmbCredentials, SmbOptions, SmbOpenOptions};

// Initialize a new client
let client = SmbClient::new(
// do anything you want here with client
let mut file = client.open_with("/abc/test.txt", SmbOpenOptions::default().read(true)).unwrap();
// read file...
// disconnect from server

Run examples

Two examples are provided along with this repository and can be found under the examples/ directory.

The tree example can be used to get a fs tree of the smb share and can be run with:

cargo run --example tree -- -u <username> -w <workspace> -s <share> -P <password> smb://<hostname>

while the transfer example shows how to write a file to the remote host and can be run with:

cargo run --example transfer -- -i <file_on_local> -o <file_to_write> -u <username> -w <workspace> -s <share> -P <password> smb://<hostname>

Documentation 📚

The developer documentation can be found on Rust Docs at https://docs.rs/pavao

Support the developer ☕

If you like Pavão and you're grateful for the work I've done, please consider a little donation 🥳

You can make a donation with one of these platforms:

ko-fi PayPal

Contributing and issues 🤝🏻

Contributions, bug reports, new features and questions are welcome! 😉 If you have any question or concern, or you want to suggest a new feature, or you want just want to improve pavao, feel free to open an issue or a PR.

Please follow our contributing guidelines

Changelog ⏳

View Pavão's changelog HERE

License 📃

Pavão is licensed under the GPLv3 license.

You can read the entire license HERE


~22K SLoC