mirror of
https://github.com/falk-werner/webfused
synced 2024-10-27 20:44:08 +00:00
make userdb optional
This commit is contained in:
parent
3c0fce8eee
commit
dfd2cd4bc0
40
meson.build
40
meson.build
@ -1,30 +1,42 @@
|
|||||||
project('webfused', 'c', 'cpp', version: '0.6.0', license: 'LGPL-3.0+')
|
project('webfused', 'c', 'cpp', version: '0.6.0', license: 'LGPL-3.0+')
|
||||||
|
|
||||||
without_tests = get_option('without_tests')
|
without_tests = get_option('without_tests')
|
||||||
|
without_userdb = get_option('without_userdb')
|
||||||
|
|
||||||
c_compiler = meson.get_compiler('c')
|
c_compiler = meson.get_compiler('c')
|
||||||
|
|
||||||
openssl_dep = dependency('openssl', version: '>=1.1.1')
|
libconfig_dep = dependency('libconfig', version: '>=1.4')
|
||||||
libconfig_dep = dependency('libconfig', version: '>=1.5')
|
|
||||||
pam_dep = c_compiler.find_library('pam')
|
pam_dep = c_compiler.find_library('pam')
|
||||||
|
|
||||||
libwebsockets_dep = dependency('libwebsockets', version: '>=4.0.0')
|
libwebsockets_dep = dependency('libwebsockets', version: '>=4.0.0')
|
||||||
jansson_dep = dependency('jansson', version: '>=2.11')
|
libfuse_dep = dependency('fuse3', version: '>=3.1.0')
|
||||||
libfuse_dep = dependency('fuse3', version: '>=3.8.0')
|
|
||||||
|
|
||||||
webfuse_adapter_dep = dependency('webfuse', version: '>=0.5.0')
|
webfuse_adapter_dep = dependency('webfuse', version: '>=0.5.0')
|
||||||
|
|
||||||
inc_dir = include_directories('src')
|
inc_dir = include_directories('src')
|
||||||
|
|
||||||
libuserdb = static_library('userdb',
|
if not without_userdb
|
||||||
'src/userdb/userdb.c',
|
openssl_dep = dependency('openssl', version: '>=1.1.1')
|
||||||
include_directories: inc_dir,
|
jansson_dep = dependency('jansson', version: '>=2.7')
|
||||||
dependencies: [libconfig_dep, openssl_dep, jansson_dep])
|
|
||||||
|
|
||||||
libuserdb_dep = declare_dependency(
|
libuserdb = static_library('userdb',
|
||||||
include_directories: inc_dir,
|
'src/userdb/userdb_openssl.c',
|
||||||
link_with: libuserdb,
|
include_directories: inc_dir,
|
||||||
dependencies: [libconfig_dep, openssl_dep, jansson_dep])
|
dependencies: [openssl_dep, jansson_dep])
|
||||||
|
|
||||||
|
libuserdb_dep = declare_dependency(
|
||||||
|
include_directories: inc_dir,
|
||||||
|
link_with: libuserdb,
|
||||||
|
dependencies: [openssl_dep, jansson_dep])
|
||||||
|
else
|
||||||
|
libuserdb = static_library('userdb',
|
||||||
|
'src/userdb/userdb_none.c',
|
||||||
|
include_directories: inc_dir)
|
||||||
|
|
||||||
|
libuserdb_dep = declare_dependency(
|
||||||
|
include_directories: inc_dir,
|
||||||
|
link_with: libuserdb)
|
||||||
|
endif
|
||||||
|
|
||||||
libwebfused = static_library('webfused',
|
libwebfused = static_library('webfused',
|
||||||
'src/webfused/daemon.c',
|
'src/webfused/daemon.c',
|
||||||
@ -43,13 +55,13 @@ libwebfused = static_library('webfused',
|
|||||||
'src/webfused/log/stderr_logger.c',
|
'src/webfused/log/stderr_logger.c',
|
||||||
'src/webfused/log/syslog_logger.c',
|
'src/webfused/log/syslog_logger.c',
|
||||||
include_directories: inc_dir,
|
include_directories: inc_dir,
|
||||||
dependencies: [libuserdb_dep, webfuse_adapter_dep, pam_dep],
|
dependencies: [libuserdb_dep, webfuse_adapter_dep, libconfig_dep, pam_dep],
|
||||||
install: false)
|
install: false)
|
||||||
|
|
||||||
libwebfused_dep = declare_dependency(
|
libwebfused_dep = declare_dependency(
|
||||||
include_directories: inc_dir,
|
include_directories: inc_dir,
|
||||||
link_with: libwebfused,
|
link_with: libwebfused,
|
||||||
dependencies: [libuserdb_dep, webfuse_adapter_dep, pam_dep],
|
dependencies: [libuserdb_dep, webfuse_adapter_dep, libconfig_dep, pam_dep],
|
||||||
install: false)
|
install: false)
|
||||||
|
|
||||||
webfused = executable('webfused',
|
webfused = executable('webfused',
|
||||||
|
@ -1 +1,2 @@
|
|||||||
option('without_tests', type: 'boolean', value: false, description: 'disable unit tests')
|
option('without_tests', type: 'boolean', value: false, description: 'disable unit tests')
|
||||||
|
option('without_userdb', type: 'boolean', value: false, description: 'disable userdb')
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
#include <openssl/opensslv.h>
|
#include <openssl/opensslv.h>
|
||||||
#include <openssl/engine.h>
|
#include <openssl/engine.h>
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <jansson.h>
|
|
||||||
#include <userdb/userdb.h>
|
#include <userdb/userdb.h>
|
||||||
|
|
||||||
|
|
||||||
|
74
src/userdb/userdb_none.c
Normal file
74
src/userdb/userdb_none.c
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
#include "userdb.h"
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
struct userdb * userdb_create(
|
||||||
|
char const * pepper)
|
||||||
|
{
|
||||||
|
(void) pepper;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void userdb_dispose(struct userdb * db)
|
||||||
|
{
|
||||||
|
(void) db;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool userdb_save(
|
||||||
|
struct userdb * db,
|
||||||
|
char const * filename)
|
||||||
|
{
|
||||||
|
(void) db;
|
||||||
|
(void) filename;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool userdb_load_file(
|
||||||
|
struct userdb * db,
|
||||||
|
char const * filename)
|
||||||
|
{
|
||||||
|
(void) db;
|
||||||
|
(void) filename;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool userdb_load_string(
|
||||||
|
struct userdb * db,
|
||||||
|
char const * contents)
|
||||||
|
{
|
||||||
|
(void) db;
|
||||||
|
(void) contents;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void userdb_add(
|
||||||
|
struct userdb * db,
|
||||||
|
char const * username,
|
||||||
|
char const * password)
|
||||||
|
{
|
||||||
|
(void) db;
|
||||||
|
(void) username;
|
||||||
|
(void) password;
|
||||||
|
}
|
||||||
|
|
||||||
|
void userdb_remove(
|
||||||
|
struct userdb * db,
|
||||||
|
char const * user)
|
||||||
|
{
|
||||||
|
(void) db;
|
||||||
|
(void) user;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool userdb_check(
|
||||||
|
struct userdb * db,
|
||||||
|
char const * username,
|
||||||
|
char const * password)
|
||||||
|
{
|
||||||
|
(void) db;
|
||||||
|
(void) username;
|
||||||
|
(void) password;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
@ -9,8 +9,8 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
|
||||||
#if ((LIBCONFIG_VER_MAJOR != 1) || (LIBCONFIG_VER_MINOR < 5))
|
#if ((LIBCONFIG_VER_MAJOR != 1) || (LIBCONFIG_VER_MINOR < 4))
|
||||||
#error "linconfig 1.5 or higher needed"
|
#error "libconfig 1.5 or higher needed"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user