From 9038f56efe3f2672dd0eb3f421c7a8e0ee118956 Mon Sep 17 00:00:00 2001 From: Felix Brucker Date: Sun, 30 Dec 2018 11:58:43 +0100 Subject: [PATCH 1/6] Add Dockerfile --- Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bab5982 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM alpine:latest as builder +RUN apk update && apk upgrade && apk add --no-cache bash util-linux cmake make gcc git sqlite-dev openssl-dev git build-base +WORKDIR /app +COPY . . +RUN cmake . && make +RUN sed -i 's/\/usr\/lib\/uhub\//\/libs\//g' ./doc/*.conf && \ +sed -i 's/\/usr\/lib\/uhub\//\/libs\//g' ./doc/rules.txt && \ +sed -i 's/\/etc\/uhub\//\/conf\//g' ./doc/*.conf && \ +sed -i 's/\/etc\/uhub\//\/conf\//g' ./doc/rules.txt && \ +echo 'Welcome to uHub' > ./doc/motd.txt + +FROM alpine:latest +RUN apk update && apk upgrade && apk add --no-cache bash util-linux openssl-dev sqlite-dev +WORKDIR /app +COPY --from=builder /app/uhub . +COPY --from=builder /app/doc/plugins.conf /app/doc/uhub.conf /app/doc/users.conf /app/doc/rules.txt /app/doc/motd.txt /conf/ +COPY --from=builder /app/*.so /libs/ +ENTRYPOINT ["./uhub"] +CMD ["-c","/conf/uhub.conf"] From 3435d534785cc2358a8559889e19d5b03b256704 Mon Sep 17 00:00:00 2001 From: Boris Pek Date: Sun, 13 Jan 2019 23:55:13 +0300 Subject: [PATCH 2/6] Use secure URL of git submodule in .gitmodules (Closes: #58) --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 176f1d0..c1ff22c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "thirdparty/sqlite"] path = thirdparty/sqlite - url = git://github.com/janvidar/sqlite.git + url = https://github.com/janvidar/sqlite.git From be1ad4f47588bf183489d05b8308d17390395579 Mon Sep 17 00:00:00 2001 From: Boris Pek Date: Sat, 12 Jan 2019 17:29:17 +0300 Subject: [PATCH 3/6] Fix cross-compilation for MS Windows using MinGW [Thanks to Felix Brucker] (Closes: #55) --- CMakeLists.txt | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91fd544..d73a383 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,13 +121,6 @@ add_library(mod_topic MODULE ${PROJECT_SOURCE_DIR}/plugins/mod_topic.c) add_library(mod_no_guest_downloads MODULE ${PROJECT_SOURCE_DIR}/plugins/mod_no_guest_downloads.c) add_library(mod_auth_sqlite MODULE ${PROJECT_SOURCE_DIR}/plugins/mod_auth_sqlite.c) -if(WIN32) - target_link_libraries(uhub ws2_32) - target_link_libraries(autotest-bin ws2_32) - target_link_libraries(mod_logging ws2_32) - target_link_libraries(mod_welcome ws2_32) -endif() - set_target_properties( mod_example mod_welcome @@ -145,19 +138,23 @@ target_link_libraries(uhub ${CMAKE_DL_LIBS} adc network utils) target_link_libraries(uhub-passwd ${SQLITE3_LIBRARIES} utils) target_link_libraries(autotest-bin ${CMAKE_DL_LIBS} adc network utils) target_link_libraries(mod_example utils) -target_link_libraries(mod_welcome utils) +target_link_libraries(mod_welcome network utils) target_link_libraries(mod_auth_simple utils) target_link_libraries(mod_auth_sqlite ${SQLITE3_LIBRARIES} utils) target_link_libraries(mod_chat_history utils) target_link_libraries(mod_chat_history_sqlite ${SQLITE3_LIBRARIES} utils) target_link_libraries(mod_no_guest_downloads utils) target_link_libraries(mod_chat_only utils) -target_link_libraries(mod_logging utils) +target_link_libraries(mod_logging network utils) target_link_libraries(mod_topic utils) target_link_libraries(utils network) -target_link_libraries(mod_welcome network) -target_link_libraries(mod_logging network) +if(WIN32) + target_link_libraries(uhub ws2_32) + target_link_libraries(autotest-bin ws2_32) + target_link_libraries(mod_logging ws2_32) + target_link_libraries(mod_welcome ws2_32) +endif() if(UNIX) add_library(adcclient STATIC ${adcclient_SOURCES}) From ef83b31cec03a676af3f9e4f24ec22a59b2f6847 Mon Sep 17 00:00:00 2001 From: Boris Pek Date: Mon, 14 Jan 2019 22:03:07 +0300 Subject: [PATCH 4/6] Fix spelling errors --- ChangeLog | 6 +++--- cmake/Modules/FindSqlite3.cmake | 2 +- doc/extensions.txt | 2 +- doc/getstarted.txt | 2 +- doc/uhub.conf | 2 +- doc/uhub.spec | 2 +- doc/upstart/etc/init/uhub.conf | 2 +- src/adc/adcconst.h | 6 +++--- src/adc/message.h | 10 +++++----- src/core/command_parser.h | 2 +- src/core/config.xml | 2 +- src/core/inf.c | 2 +- src/core/main.c | 4 ++-- src/core/user.h | 4 ++-- src/core/usermanager.h | 4 ++-- src/network/connection.h | 4 ++-- src/network/ipcalc.h | 2 +- src/network/network.h | 2 +- src/plugins/mod_chat_only.c | 2 +- src/util/misc.h | 2 +- 20 files changed, 32 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ee41ac..9a5c31e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -47,8 +47,8 @@ - marked plugin callbacks that are not called yet - add on_change_nick() to struct plugin_funcs - minimal changes -- Updated init script in debian package. -- Updated list of man pages in debian package. +- Updated init script in Debian package. +- Updated list of man pages in Debian package. - Added man page for uhub-passwd. - Merge branch 'master' of https://github.com/Tilka/uhub - Fix issue with QUI messages being allowed through the hub @@ -78,7 +78,7 @@ - minimal documentation fixes - update client software link - update compile howto link -- fix debian changelog +- fix Debian changelog - Fix bug #158 - Added plugin for setting topic (hub description). - Command arguments handling + cleanups diff --git a/cmake/Modules/FindSqlite3.cmake b/cmake/Modules/FindSqlite3.cmake index 4b2ad61..ddb4a3c 100644 --- a/cmake/Modules/FindSqlite3.cmake +++ b/cmake/Modules/FindSqlite3.cmake @@ -3,7 +3,7 @@ # # SQLITE3_FOUND True if sqlite3 got found # SQLITE3_INCLUDEDIR Location of sqlite3 headers -# SQLITE3_LIBRARIES List of libaries to use sqlite3 +# SQLITE3_LIBRARIES List of libraries to use sqlite3 # SQLITE3_DEFINITIONS Definitions to compile sqlite3 # # Copyright (c) 2007 Juha Tuomala diff --git a/doc/extensions.txt b/doc/extensions.txt index a72b85e..96d7b4f 100644 --- a/doc/extensions.txt +++ b/doc/extensions.txt @@ -31,7 +31,7 @@ The hub should send a packet containing the token back: 'IECH {token} {host:port}', aswell as the same message via TCP. If the client receives the message via UDP, it should now be able to determine the type of NAT. -If the client receives the message via TCP only it knows it has a firewall blocking incomming communication. +If the client receives the message via TCP only it knows it has a firewall blocking incoming communication. If the client does not receive the message, it should assume a firewall is blocking all UDP communication, and resume in passive mode. diff --git a/doc/getstarted.txt b/doc/getstarted.txt index 941a883..402a539 100644 --- a/doc/getstarted.txt +++ b/doc/getstarted.txt @@ -49,7 +49,7 @@ Example: If you are planning to more than 1024 users on hub, you must increase the max number of file descriptors allowed. This limit needs to be higher than the configured max_users in uhub.conf. -In linux can add the following lines to /etc/security/limits.conf (allows for ~4000 users) +In Linux can add the following lines to /etc/security/limits.conf (allows for ~4000 users) * soft nofile 4096 * hard nofile 4096 diff --git a/doc/uhub.conf b/doc/uhub.conf index 8df4ee4..c1a72c6 100644 --- a/doc/uhub.conf +++ b/doc/uhub.conf @@ -2,7 +2,7 @@ # You should normally place this file in /etc/uhub/uhub.conf # and customize some of the settings below. # -# This file is read only to the uhub deamon, and if you +# This file is read only to the uhub daemon, and if you # make changes to it while uhub is running you can send a # HUP signal to it ( $ killall -HUP uhub ), to reparse configuration (only on UNIX). # All configuration directives: http://www.uhub.org/config.php diff --git a/doc/uhub.spec b/doc/uhub.spec index 7a487f9..3d19b4a 100644 --- a/doc/uhub.spec +++ b/doc/uhub.spec @@ -80,7 +80,7 @@ rm -rf $RPM_BUILD_ROOT if [ $1 -gt 1 ] ; then /etc/rc.d/init.d/uhub restart >/dev/null || : fi -# need more informations about add services and users in system +# need more information about add services and users in system /usr/sbin/adduser -M -d /tmp -G nobody -s /sbin/nologin -c 'The Uhub ADC p2p hub Daemon' uhub >/dev/null 2>&1 ||: # write SSL create echo "PLS see /usr/share/doc/uhub/" diff --git a/doc/upstart/etc/init/uhub.conf b/doc/upstart/etc/init/uhub.conf index 8156596..23dc653 100644 --- a/doc/upstart/etc/init/uhub.conf +++ b/doc/upstart/etc/init/uhub.conf @@ -8,7 +8,7 @@ start on filesystem or runlevel [2345] stop on runlevel [!2345] # Allow the service to respawn, but if its happening too often -# (10 times in 5 seconds) theres a problem and we should stop trying. +# (10 times in 5 seconds) there's a problem and we should stop trying. respawn respawn limit 10 5 diff --git a/src/adc/adcconst.h b/src/adc/adcconst.h index 88f4e68..503dc3f 100644 --- a/src/adc/adcconst.h +++ b/src/adc/adcconst.h @@ -118,8 +118,8 @@ typedef uint32_t fourcc_t; #define ADC_INF_FLAG_SUPPORT "SU" /* support (extensions, feature cast) */ #define ADC_INF_FLAG_SHARED_SIZE "SS" /* size of total files shared in bytes */ #define ADC_INF_FLAG_SHARED_FILES "SF" /* number of files shared */ -#define ADC_INF_FLAG_UPLOAD_SPEED "US" /* maximum upload speed acheived in bytes/sec */ -#define ADC_INF_FLAG_DOWNLOAD_SPEED "DS" /* maximum download speed acheived in bytes/sec */ +#define ADC_INF_FLAG_UPLOAD_SPEED "US" /* maximum upload speed achieved in bytes/sec */ +#define ADC_INF_FLAG_DOWNLOAD_SPEED "DS" /* maximum download speed achieved in bytes/sec */ #define ADC_INF_FLAG_UPLOAD_SLOTS "SL" /* maximum upload slots (concurrent uploads) */ #define ADC_INF_FLAG_AUTO_SLOTS "AS" /* automatic slot if upload speed is less than this in bytes/sec */ #define ADC_INF_FLAG_AUTO_SLOTS_MAX "AM" /* maximum number of automatic slots */ @@ -134,7 +134,7 @@ typedef uint32_t fourcc_t; #define ADC_MSG_FLAG_PRIVATE "PM" /* message is a private message */ #define ADC_SCH_FLAG_INCLUDE "AN" /* include given search term */ -#define ADC_SCH_FLAG_EXCLUDE "NO" /* exclude given serach term */ +#define ADC_SCH_FLAG_EXCLUDE "NO" /* exclude given search term */ #define ADC_SCH_FLAG_FILE_EXTENSION "EX" /* search only for files with the given file extension */ #define ADC_SCH_FLAG_FILE_TYPE "TY" /* search only for files with this file type (separate type) */ #define ADC_SCH_FLAG_LESS_THAN "LE" /* search for files with this size or less */ diff --git a/src/adc/message.h b/src/adc/message.h index 2533b6b..3558524 100644 --- a/src/adc/message.h +++ b/src/adc/message.h @@ -51,7 +51,7 @@ enum msg_status_level extern struct adc_message* adc_msg_incref(struct adc_message* msg); /** - * Decrease the reference counter, and free the memory when apropriate. + * Decrease the reference counter, and free the memory when appropriate. */ extern void adc_msg_free(struct adc_message* msg); @@ -159,7 +159,7 @@ extern char* adc_msg_get_argument(struct adc_message* cmd, int offset); * * @arg prefix a 2 character argument prefix * @arg string must be escaped (see adc_msg_escape). - * @return 0 if successful, or -1 if an error occured. + * @return 0 if successful, or -1 if an error occurred. */ extern int adc_msg_replace_named_argument(struct adc_message* cmd, const char prefix[2], const char* string); @@ -167,7 +167,7 @@ extern int adc_msg_replace_named_argument(struct adc_message* cmd, const char pr * Append an argument * * @arg string must be escaped (see adc_msg_escape). - * @return 0 if successful, or -1 if an error occured (out of memory). + * @return 0 if successful, or -1 if an error occurred (out of memory). */ extern int adc_msg_add_argument(struct adc_message* cmd, const char* string); @@ -176,7 +176,7 @@ extern int adc_msg_add_argument(struct adc_message* cmd, const char* string); * * @arg prefix a 2 character argument prefix * @arg string must be escaped (see adc_msg_escape). - * @return 0 if successful, or -1 if an error occured (out of memory). + * @return 0 if successful, or -1 if an error occurred (out of memory). */ extern int adc_msg_add_named_argument(struct adc_message* cmd, const char prefix[2], const char* string); @@ -186,7 +186,7 @@ extern int adc_msg_add_named_argument(struct adc_message* cmd, const char prefix * * @arg prefix a 2 character argument prefix * @arg string must NOT be escaped - * @return 0 if successful, or -1 if an error occured (out of memory). + * @return 0 if successful, or -1 if an error occurred (out of memory). */ extern int adc_msg_add_named_argument_string(struct adc_message* cmd, const char prefix[2], const char* string); diff --git a/src/core/command_parser.h b/src/core/command_parser.h index 60c6790..e191129 100644 --- a/src/core/command_parser.h +++ b/src/core/command_parser.h @@ -30,7 +30,7 @@ struct command_base; * * @param cbase Command base pointer. * @param user User who invoked the command. - * @param message The message that is to be interpreted as a command (including the invokation prefix '!' or '+') + * @param message The message that is to be interpreted as a command (including the invocation prefix '!' or '+') * * @return a hub_command that must be freed with command_free(). @See struct hub_command. */ diff --git a/src/core/config.xml b/src/core/config.xml index 71cc227..baca469 100644 --- a/src/core/config.xml +++ b/src/core/config.xml @@ -170,7 +170,7 @@ Max read buffer before parse, per user 0.1.3 diff --git a/src/core/inf.c b/src/core/inf.c index 0fedc98..bfce6e5 100644 --- a/src/core/inf.c +++ b/src/core/inf.c @@ -88,7 +88,7 @@ static int check_hash_tiger(const char* cid, const char* pid) /* - * FIXME: Only works for tiger hash. If a client doesnt support tiger we cannot let it in! + * FIXME: Only works for tiger hash. If a client doesn't support tiger we cannot let it in! */ static int check_cid(struct hub_info* hub, struct hub_user* user, struct adc_message* cmd) { diff --git a/src/core/main.c b/src/core/main.c index a2a230b..00e90c2 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -151,7 +151,7 @@ int main_loop() setup_signal_handlers(hub); #ifdef SYSTEMD /* Notify the service manager that this daemon has - * been successfully initalized and shall enter the + * been successfully initialized and shall enter the * main loop. */ sd_notifyf(0, "READY=1\n" @@ -471,7 +471,7 @@ int main(int argc, char** argv) } else if (ret == 0) { - /* child process - detatch from TTY */ + /* child process - detach from TTY */ fclose(stdin); fclose(stdout); fclose(stderr); diff --git a/src/core/user.h b/src/core/user.h index ee799a6..711e27c 100644 --- a/src/core/user.h +++ b/src/core/user.h @@ -68,7 +68,7 @@ enum user_quit_reason quit_timeout = 4, /** User timed out (no data for a while) */ quit_send_queue = 5, /** User's send queue was overflowed */ quit_memory_error = 6, /** Not enough memory available */ - quit_socket_error = 7, /** A socket error occured */ + quit_socket_error = 7, /** A socket error occurred */ quit_protocol_error = 8, /** Fatal protocol error */ quit_logon_error = 9, /** Unable to login (wrong password, CID/PID, etc) */ quit_update_error = 10, /** Update error. INF update changed share/slot info and no longer satisfies the hub limits. */ @@ -76,7 +76,7 @@ enum user_quit_reason quit_ghost_timeout = 12, /** The user is a ghost, and trying to login from another connection */ }; -/** Returns an apropriate string for the given quit reason */ +/** Returns an appropriate string for the given quit reason */ extern const char* user_get_quit_reason_string(enum user_quit_reason); struct hub_user_info diff --git a/src/core/usermanager.h b/src/core/usermanager.h index 1826143..62d45d1 100644 --- a/src/core/usermanager.h +++ b/src/core/usermanager.h @@ -42,7 +42,7 @@ extern struct hub_user_manager* uman_init(); * Shuts down the user manager. * All users will be disconnected and deleted as part of this. * - * @return 0 on success, or -1 in an error occured (invalid pointer). + * @return 0 on success, or -1 in an error occurred (invalid pointer). */ extern int uman_shutdown(struct hub_user_manager* users); @@ -106,7 +106,7 @@ extern struct hub_user* uman_get_user_by_nick(struct hub_user_manager* users, co * * @param[out] target the list of users matching the address * @param range the IP range of users to match - * @return The number of users matching the addressess, or -1 on error (mask is wrong). + * @return The number of users matching the addresses, or -1 on error (mask is wrong). */ extern size_t uman_get_user_by_addr(struct hub_user_manager* users, struct linked_list* target, struct ip_range* range); diff --git a/src/network/connection.h b/src/network/connection.h index 490e636..3718fe9 100644 --- a/src/network/connection.h +++ b/src/network/connection.h @@ -88,7 +88,7 @@ extern void net_con_close(struct net_connection* con); * * @return returns the number of bytes sent. * 0 if no data is sent, and this function should be called again (EWOULDBLOCK/EINTR) - * <0 if an error occured, the negative number contains the error code. + * <0 if an error occurred, the negative number contains the error code. */ extern ssize_t net_con_send(struct net_connection* con, const void* buf, size_t len); @@ -97,7 +97,7 @@ extern ssize_t net_con_send(struct net_connection* con, const void* buf, size_t * * @return returns the number of bytes sent. * 0 if no data is sent, and this function should be called again (EWOULDBLOCK/EINTR) - * <0 if an error occured, the negative number contains the error code. + * <0 if an error occurred, the negative number contains the error code. */ extern ssize_t net_con_recv(struct net_connection* con, void* buf, size_t len); diff --git a/src/network/ipcalc.h b/src/network/ipcalc.h index 3974082..c1bd494 100644 --- a/src/network/ipcalc.h +++ b/src/network/ipcalc.h @@ -92,7 +92,7 @@ extern int ip_is_valid_ipv6(const char* address); * * @param text_addr is an ipaddress either ipv6 or ipv4. * Special magic addresses called "any" and "loopback" exist, - * and will work accross IPv6/IPv4. + * and will work across IPv6/IPv4. * @param port Fill the struct sockaddr* with the given port, can safely be ignored. */ extern int ip_convert_address(const char* text_address, int port, struct sockaddr* addr, socklen_t* addr_len); diff --git a/src/network/network.h b/src/network/network.h index f79cce9..1d63a1d 100644 --- a/src/network/network.h +++ b/src/network/network.h @@ -63,7 +63,7 @@ extern int net_monitor_count(); extern int net_monitor_capacity(); /** - * @return the last error code occured. + * @return the last error code occurred. * * NOTE: On Windows this is the last error code from the socket library, but * on UNIX this is the errno variable that can be overwritten by any diff --git a/src/plugins/mod_chat_only.c b/src/plugins/mod_chat_only.c index 7a3a679..b1876f5 100644 --- a/src/plugins/mod_chat_only.c +++ b/src/plugins/mod_chat_only.c @@ -30,7 +30,7 @@ enum Warnings struct user_info { sid_t sid; // The SID of the user - int warnings; // The number of denies (used to track wether or not a warning should be sent). @see enum Warnings. + int warnings; // The number of denies (used to track whether or not a warning should be sent). @see enum Warnings. }; struct chat_only_data diff --git a/src/util/misc.h b/src/util/misc.h index 51acda4..c55f05a 100644 --- a/src/util/misc.h +++ b/src/util/misc.h @@ -86,7 +86,7 @@ void* memmem(const void *haystack, size_t haystacklen, const void *needle, size_ /** * Split the string based on split, and place the different parts into list. - * @return the number of items in the list after split, or -1 if an error occured. + * @return the number of items in the list after split, or -1 if an error occurred. */ struct linked_list; extern int split_string(const char* string, const char* split, struct linked_list* list, int allow_empty); From d25fead3a8b8779f993bc6d987ff6e9e82f4486d Mon Sep 17 00:00:00 2001 From: Boris Pek Date: Mon, 14 Jan 2019 22:16:48 +0300 Subject: [PATCH 5/6] Fix spelling errors --- doc/architecture.txt | 2 +- doc/extensions.txt | 2 +- src/core/config.xml | 2 +- src/network/connection.h | 2 +- src/network/network.h | 2 +- src/util/rbtree.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/architecture.txt b/doc/architecture.txt index 19d1163..2d3a5ea 100644 --- a/doc/architecture.txt +++ b/doc/architecture.txt @@ -67,7 +67,7 @@ Accepting new users | | | | V | | --------------------- --------------------- - | | Send password | ------> | Reveive and check | + | | Send password | ------> | Receive and check | | | request, if needed| | password. | | --------------------- --------------------- | | diff --git a/doc/extensions.txt b/doc/extensions.txt index 96d7b4f..12cf837 100644 --- a/doc/extensions.txt +++ b/doc/extensions.txt @@ -28,7 +28,7 @@ The UDP packet SHOULD be echoed by the hub. This UDP packet should contain simply 'HECH {cid} {token}' (Hub echo). The hub should send a packet containing the token back: -'IECH {token} {host:port}', aswell as the same message via TCP. +'IECH {token} {host:port}', as well as the same message via TCP. If the client receives the message via UDP, it should now be able to determine the type of NAT. If the client receives the message via TCP only it knows it has a firewall blocking incoming communication. diff --git a/src/core/config.xml b/src/core/config.xml index baca469..07571a7 100644 --- a/src/core/config.xml +++ b/src/core/config.xml @@ -567,7 +567,7 @@ diff --git a/src/network/connection.h b/src/network/connection.h index 3718fe9..f4e168b 100644 --- a/src/network/connection.h +++ b/src/network/connection.h @@ -109,7 +109,7 @@ extern ssize_t net_con_recv(struct net_connection* con, void* buf, size_t len); extern ssize_t net_con_peek(struct net_connection* con, void* buf, size_t len); /** - * Set timeout for connetion. + * Set timeout for connection. * * @param seconds the number of seconds into the future. */ diff --git a/src/network/network.h b/src/network/network.h index 1d63a1d..fb34d12 100644 --- a/src/network/network.h +++ b/src/network/network.h @@ -53,7 +53,7 @@ extern int net_initialize(); extern int net_destroy(); /** - * @return the number of sockets currrently being monitored. + * @return the number of sockets currently being monitored. */ extern int net_monitor_count(); diff --git a/src/util/rbtree.c b/src/util/rbtree.c index ae61f2e..2f2be77 100644 --- a/src/util/rbtree.c +++ b/src/util/rbtree.c @@ -356,7 +356,7 @@ static struct rb_node* rb_tree_traverse(struct rb_tree* tree, int dir) if (p->link[!dir] == n) return rb_it_set(tree, p); - // walk up in hte current direction + // walk up in the current direction while (p->link[dir] == n) { n = p; From b27c44e63315ded7f761e4d0f5d4f7b7cb4284fc Mon Sep 17 00:00:00 2001 From: Boris Pek Date: Mon, 14 Jan 2019 22:36:33 +0300 Subject: [PATCH 6/6] cmake: fix build out of source tree when there is only read access to sources. --- .gitignore | 2 -- CMakeLists.txt | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index bf9805f..3747f61 100644 --- a/.gitignore +++ b/.gitignore @@ -21,5 +21,3 @@ debian/uhub.postrm.debhelper debian/uhub.prerm.debhelper debian/uhub.substvars uhub-passwd -src/version.h -src/system.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d73a383..c06d003 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,6 +77,7 @@ check_symbol_exists(memmem string.h HAVE_MEMMEM) check_symbol_exists(strndup string.h HAVE_STRNDUP) include_directories("${PROJECT_SOURCE_DIR}") +include_directories("${PROJECT_BINARY_DIR}") include_directories(${SQLITE3_INCLUDE_DIRS}) link_directories(${SQLITE3_LIBRARY_DIRS}) @@ -220,8 +221,8 @@ if (SYSTEMD_SUPPORT) add_definitions(-DSYSTEMD) endif() -configure_file ("${PROJECT_SOURCE_DIR}/version.h.in" "${PROJECT_SOURCE_DIR}/version.h") -configure_file ("${PROJECT_SOURCE_DIR}/system.h.in" "${PROJECT_SOURCE_DIR}/system.h") +configure_file ("${PROJECT_SOURCE_DIR}/version.h.in" "${PROJECT_BINARY_DIR}/version.h") +configure_file ("${PROJECT_SOURCE_DIR}/system.h.in" "${PROJECT_BINARY_DIR}/system.h") # mark_as_advanced(FORCE CMAKE_BUILD_TYPE) # if (RELEASE)