diff --git a/CMakeLists.txt b/CMakeLists.txt index da833bb6d49..3d5809188e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -208,7 +208,9 @@ endif() add_link_options(--sysroot ${CMAKE_BINARY_DIR}/Root) include_directories(Userland/Libraries/LibC) +include_directories(Userland/Libraries/LibCrypt) include_directories(Userland/Libraries/LibM) +include_directories(Userland/Libraries/LibPthread) include_directories(Userland/Libraries/LibSystem) include_directories(Userland/Services) include_directories(Userland) diff --git a/Ports/openssh/package.sh b/Ports/openssh/package.sh index aa67b85d6a1..dcfb688dd98 100755 --- a/Ports/openssh/package.sh +++ b/Ports/openssh/package.sh @@ -8,6 +8,8 @@ depends="zlib openssl" useconfigure=true configopts="--prefix=/usr/local --disable-utmp --disable-strip --sysconfdir=/etc/ssh --with-ssl-dir=${SERENITY_INSTALL_ROOT}/usr/local/lib" +export LDFLAGS="-lcrypt -lcore" + pre_configure() { run autoreconf } diff --git a/Userland/Libraries/LibC/unistd.h b/Userland/Libraries/LibC/unistd.h index 7f541064343..acfd13c2bc4 100644 --- a/Userland/Libraries/LibC/unistd.h +++ b/Userland/Libraries/LibC/unistd.h @@ -171,14 +171,6 @@ enum { long sysconf(int name); -struct crypt_data { - int initialized; - char result[65]; -}; - -char* crypt(const char* key, const char* salt); -char* crypt_r(const char* key, const char* salt, struct crypt_data* data); - // If opterr is set (the default), print error messages to stderr. extern int opterr; // On errors, optopt is set to the erroneous *character*. diff --git a/Userland/Libraries/LibCore/Account.cpp b/Userland/Libraries/LibCore/Account.cpp index e357cdd498c..869958c6040 100644 --- a/Userland/Libraries/LibCore/Account.cpp +++ b/Userland/Libraries/LibCore/Account.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/Userland/Libraries/LibCrypt/crypt.cpp b/Userland/Libraries/LibCrypt/crypt.cpp index c969d7bc504..bf14db6c91d 100644 --- a/Userland/Libraries/LibCrypt/crypt.cpp +++ b/Userland/Libraries/LibCrypt/crypt.cpp @@ -6,8 +6,9 @@ #include #include #include +#include +#include #include -#include extern "C" { diff --git a/Userland/Libraries/LibCrypt/crypt.h b/Userland/Libraries/LibCrypt/crypt.h new file mode 100644 index 00000000000..c51744a6665 --- /dev/null +++ b/Userland/Libraries/LibCrypt/crypt.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2018-2020, Andreas Kling + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +/* standard symbolic constants and types + * + * values from POSIX standard unix specification + * + * https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html + */ + +#pragma once + +#include + +__BEGIN_DECLS + +struct crypt_data { + int initialized; + char result[65]; +}; + +char* crypt(const char* key, const char* salt); +char* crypt_r(const char* key, const char* salt, struct crypt_data* data); + +__END_DECLS