【问题标题】:Code signature in (/usr/local/lib/libwep) not valid on MacOS 10.14.6(/usr/local/lib/libwep) 中的代码签名在 MacOS 10.14.6 上无效
【发布时间】:2020-04-15 14:42:37
【问题描述】:

我正在尝试关注 100 days of Rust, day 12 并使用简单的 Actix 网络服务器失败。这是我到目前为止的代码(从博客复制并粘贴):

Cargo.toml

[package]
name = "blog-comments-rust"
version = "0.1.0"
authors = ["stwissel <stw@linux.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
actix-web = "2.0.0"
actix-rt = "1.1.0"

main.rs

use actix_web::{web, App, HttpResponse, HttpServer, Responder};

async fn index() -> impl Responder {
    HttpResponse::Ok().body("hello world!")
}

#[actix_rt::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| App::new().route("/", web::get().to(index)))
        .bind("127.0.0.1:8000")?
        .run()
        .await
}

当我使用 cargo run 运行它时,编译器会尝试编译依赖项,但在许多模块上都失败了:

  • backtrace-sys v0.1.35
  • brotli-sys v0.3.2

两者都有相同的错误:

cargo:warning=dyld: Library not loaded: /usr/local/lib/libwep
cargo:warning=  Referenced from: /usr/bin/cc
cargo:warning=  Reason: no suitable image found.  Did find:
cargo:warning=  /usr/local/lib/libwep: code signature in (/usr/local/lib/libwep) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
cargo:warning=  /usr/local/lib/libwep: stat() failed with errno=1
signal: 6

--- stderr
dyld: Library not loaded: /usr/local/lib/libwep
  Referenced from: /usr/bin/git
  Reason: no suitable image found.  Did find:
    /usr/local/lib/libwep: code signature in (/usr/local/lib/libwep) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
    /usr/local/lib/libwep: stat() failed with errno=1

我相信这是 macOS 问题,而不是 Rust 问题。我正在使用 macOS 10.14.6。我的libwep参数:

  • 403,776 字节(磁盘上 406 KB)
  • 创建/修改 2017 年 1 月 27 日 07:40
ls -la libwep
-rwxr-xr-x  1 root  wheel  403776 Jan 27  2017 libwep

Full error log.

我可以做些什么来编译我的代码?

【问题讨论】:

标签: macos rust


【解决方案1】:

事实证明@Shepmaster 和@trojanfoe 是对的。 (除了我的代码充满了语法废话)。罪魁祸首是ForcePoint DLP。未签名的库对于“安全性”来说是一个无赖。我有一张 corpIt 的票,看看他们回来了。

目前的解决方案,在 ftiff 的文章中间Triton AP-Endpoint on OSX@trojanfoe 指出:

sudo wepsvc –stop

如果我能侥幸逃脱,我宁愿 sudo wepsvc –uninstall,但我们需要让 Central Services 开心。

【讨论】:

    猜你喜欢
    • 2012-06-06
    • 2014-10-01
    • 2014-07-17
    • 1970-01-01
    • 2019-12-21
    • 2013-04-25
    • 2021-02-09
    • 2022-01-24
    • 1970-01-01
    相关资源
    最近更新 更多