1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
# SPDX-License-Identifier: MPL-2.0 OR LGPL-3.0-or-later
#
# libpathrs: safe path resolution on Linux
# Copyright (C) 2019-2025 Aleksa Sarai <cyphar@cyphar.com>
# Copyright (C) 2019-2025 SUSE LLC
#
# == MPL-2.0 ==
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
# Alternatively, this Source Code Form may also (at your option) be used
# under the terms of the GNU Lesser General Public License Version 3, as
# described below:
#
# == LGPL-3.0-or-later ==
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
[package]
name = "pathrs"
version = "0.2.1"
license = "MPL-2.0 OR LGPL-3.0-or-later"
authors = ["Aleksa Sarai <cyphar@cyphar.com>"]
description = "C-friendly API to make path resolution safer on Linux."
repository = "https://github.com/cyphar/libpathrs"
readme = "README.md"
keywords = ["file", "fs", "security", "linux"]
categories = ["filesystem"]
edition = "2021"
rust-version = "1.63"
[badges]
maintenance = { status = "experimental" }
[lib]
# When building the CAPI, our Makefile adds --crate-type={cdylib,staticlib}.
crate-type = ["rlib"]
[features]
default = []
capi = ["dep:bytemuck", "bitflags/bytemuck", "dep:rand", "dep:open-enum"]
# All of these _test_* features are only used for our own tests -- they must
# not be used by actual users of libpathrs! The leading "_" should mean that
# they are hidden from documentation (such as the features list on crates.io).
_test_as_root = []
[profile.release]
# Enable link-time optimisations.
lto = true
[dependencies]
bitflags = "2.2"
bytemuck = { version = "1", features = ["extern_crate_std", "derive"], optional = true }
itertools = "0.14"
libc = "0.2.175"
memchr = "2"
# MSRV(1.80): Use LazyLock.
# MSRV(1.65): Update to once_cell >= 1.21.
once_cell = "1"
# MSRV(1.65): Update to >=0.4.1 which uses let_else. 0.4.0 was broken.
open-enum = { version = "0.3", optional = true }
rand = { version = "0.9", optional = true }
rustix = { version = "1.1", features = ["fs", "process", "thread", "mount"] }
rustversion = "1"
thiserror = "2"
static_assertions = "1.1"
[dev-dependencies]
anyhow = "1"
clap = { version = "3", features = ["cargo"] }
errno = "0.3"
indoc = "2"
tempfile = "3"
paste = "1"
path-clean = "1"
pretty_assertions = { version = "1.4.1", features = ["unstable"] }
[build-dependencies]
tempfile = "3"
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
# We have special handling for coverage runs (which set cfg(coverage)).
'cfg(coverage)',
# We set these cfgs when building with --features=capi.
'cfg(cdylib)', 'cfg(staticlib)'
] }
[workspace]
resolver = "2"
members = [
"contrib/fake-enosys",
"e2e-tests/cmd/rust",
]
|