• Lv1
    粉丝0

积分0 / 贡献0

提问1答案被采纳0文章0

作者动态

    OpenHarmony里有没有shadow文件,支持通过getspnam函数,从/etc/shadow 文件中读取用户的加密密码信息吗

    111p 显示全部楼层 发表于 2025-3-17 10:18:47

    【问题描述】

    1. 我现在在编译三方库openssh,但是在make阶段报错,显示找不到getspnam函数,然后我去shadow.h和libcrypt.a里面找了,都没有找到gestpnam函数的实现,所以我想问一下OpenHarmony支持通过getspnam函数,从/etc/shadow 文件中读取用户的加密密码信息吗,假如不支持的话,就可以把shadow给禁用了

    2. 运行的指令 ./configure --host=aarch64-linux CC=/home/wbk/opt/native/llvm/bin/aarch64-unknown-linux-ohos-clang CXX=/home/wbk/opt/native/llvm/bin/aarch64-unknown-linux-ohos-clang++ --prefix=/home/wbk/opt/output/openssh_v8 --with-ssl-dir=/home/wbk/opt/output/openssl_v8 --with-zlib=/home/wbk/opt//output/zlib_v8 CFLAGS="--sysroot=/home/wbk/opt/native/sysroot" LDFLAGS="-L/home/wbk/opt/native/sysroot/usr/lib -lcrypt"

    3. 报错显示

      /home/wbk/opt/native/llvm/bin/aarch64-unknown-linux-ohos-clang --sysroot=/home/wbk/opt/native/sysroot -pipe -Wunknown-warning-option -Qunused-arguments -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -Wmisleading-indentation -Wbitwise-instead-of-logical -fno-strict-aliasing -mretpoline -D_FORTIFY_SOURCE=2 -ftrapv -fzero-call-used-regs=all -fno-builtin-memset -fstack-protector-strong -fPIC -I. -I.. -I. -I./.. -I/home/wbk/opt/output/openssl_v8/include -I/home/wbk/opt//output/zlib_v8/include -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_GNU_SOURCE -DHAVE_CONFIG_H -c xcrypt.c xcrypt.c:134:21: warning: call to undeclared function 'getspnam'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] struct spwd spw = getspnam(pw->pw_name); ^ xcrypt.c:134:15: error: incompatible integer to pointer conversion initializing 'struct spwd ' with an expression of type 'int' [-Wint-conversion] struct spwd *spw = getspnam(pw->pw_name); ^ ~~~~~ 1 warning and 1 error generated. make[1]: [Makefile:106: xcrypt.o] Error 1 make[1]: Leaving directory '/home/wbk/opt/openssh-9.5p1/openbsd-compat' make: [Makefile:199: openbsd-compat/libopenbsd-compat.a] Error 2

      image.png

    【运行环境】

    交叉编译工具链版本:5.0.0 openssh版本:9.5

    您尚未登录,无法参与评论,登录后可以:
    参与开源共建问题交流
    认同或收藏高质量问答
    获取积分成为开源共建先驱

    Copyright   ©2025  OpenHarmony开发者论坛  京ICP备2020036654号-3 |技术支持 Discuz!

    返回顶部