# libpathrs: safe path resolution on Linux # Copyright (C) 2019-2024 Aleksa Sarai # Copyright (C) 2019-2024 SUSE LLC # # 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 . [package] name = "pathrs" version = "0.1.3" license = "LGPL-3.0-or-later" authors = ["Aleksa Sarai "] description = "C-friendly API to make path resolution safer on Linux." repository = "https://github.com/openSUSE/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] capi = ["dep:rand", "dep:open-enum"] # Only used for tests. _test_as_root = [] [profile.release] # Enable link-time optimisations. lto = true [dependencies] bitflags = "^2" itertools = "^0.13" # MSRV(1.70): Use OnceLock. # MSRV(1.80): Use LazyLock. lazy_static = "^1" libc = "^0.2" memchr = "^2" # MSRV(1.65): Update to >=0.4.1 which uses let_else. 0.4.0 was broken. open-enum = {version = "=0.3.0", optional = true } rand = { version = "^0.8", optional = true } rustix = { version = "^0.38", features = ["fs"] } thiserror = "^1" [dev-dependencies] anyhow = "^1" clap = { version = "^3", features = ["cargo"] } errno = "^0.3" tempfile = "^3" paste = "^1" pretty_assertions = "^1" # Enable the "process" feature for getcwd() in our tests. rustix = { version = "^0.38", features = ["process"] } [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)' ] }