Skip to content

Commit

Permalink
Merge pull request #17 from hfiref0x/dev
Browse files Browse the repository at this point in the history
v 2.1.0.2005
  • Loading branch information
hfiref0x authored May 21, 2020
2 parents d9286bc + f0d4c4d commit f73706a
Show file tree
Hide file tree
Showing 18 changed files with 666 additions and 657 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) LightFTP 2007 - 2019 Project authors
Copyright (c) LightFTP 2007 - 2020 Project authors

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# System Requirements

* x86-32/x64 POSIX compliant OS, e.g. Linux.
* x86-32/x64 Windows Vista/7/8/8.1/10 with Cygwin (see Build section of this readme).
* x86-32/x64 Windows 7/8/8.1/10 with Cygwin (see Build section of this readme).
* No admin/root privileges required. FTP server must be allowed in firewall.

# Configuration
Expand Down Expand Up @@ -69,6 +69,12 @@ Path to PEM private key file for your certificate.

Password to decrypt private key.

keepalive

Send keepalive packets (some NATs may require this).
Default: 0 (disabled)


# User sections

Note for "accs" field:
Expand Down Expand Up @@ -101,7 +107,7 @@ Example of configuration file can be found in Source directory as fftp.conf.
* In order to build from source in Linux you need GCC C compiler, run make command in the Release directory. LigthFTP uses GnuTLS, make sure you have headers (libgnutls-dev or gnutls-dev) installed;
* Old Windows Visual Studio source code and project files located in Source/Deprecated directory, in order to build from this source you need Microsoft Visual Studio 2013/2015 and later versions.

### Example for Linux Mint 19.1/Ubuntu 18.04
### Example for Linux Mint 19.3/Ubuntu 18.04

You need GCC and Make installed. If they are not installed you can install them as part of build-essential package:

Expand Down Expand Up @@ -131,4 +137,4 @@ Result binary is fftp. Next setup ftp config, example config file is Source/fftp

# Authors

(c) 2007 - 2019 LightFTP Project
(c) 2007 - 2020 LightFTP Project
27 changes: 15 additions & 12 deletions Source.sha256
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
52989e3efcc842d7f1c07cc6d49a20b2981e46599bdd74e067a070b154c00a22 *Source\cfgparse.c
8214f7f15adb8eab19a336b9e867ce35c2cc11317c6b8b612204e90a1ab9ccd8 *Source\cfgparse.h
8925cd669e8c4b3696d27e8fa98c9e20010e7058c685aecf50669a4190383bb6 *Source\changelog.txt
5f60ff45d21faa296673f793d6afef8a0c2c9b97a7b0aa51134750f7158f15c2 *Source\fftp.conf
44f52ba4091e99b60e06fad1c973ce95012c274eaa3bc0010d589540e3f264bc *Source\ftpserv.c
de11d783b7cdea34ef90eca2f957333cf17485b537fd9a4d6b24a8d9f357d82f *Source\ftpserv.h
8dc0b4a40e2bac991a7d878aa80d53d9bf175b739a6c591e9401a77b285fca1c *Source\main.c
31f77f2c56d71b285cb689af8e7400602af0adaf0df8cfe3bc9ae57a1e79c5f1 *Source\x_malloc.c
18364d8691f4bb9ec5f684940e05ddd70de658446417c1f6071a21ad7f4b3717 *Source\cfgparse.c
fb951da7cb5aa17b79cc455bbcb3d7a3ef09182db34298a921138bdd9950cd17 *Source\cfgparse.h
e0013dc69f2e46b70c360611463886be20b382709ef7c3c954bd3ab8963370b3 *Source\changelog.txt
89f8ce6af9377236e226c810e228947c27fc1b233b0f164104ad26bbfe8ecda6 *Source\fftp.conf
c02df4fe98511859d400a4357c66720254f8b7053f8655f26e6842ba6022227a *Source\fspathtools.c
6a6f5df59cb19f62a964312a5efc1d285eba1d1a97563e4214c5b41666baf0ee *Source\fspathtools.h
552be952422a3e3959e4f130be0c7fdff6ab0ef124eb161df21b0a264b0b2a32 *Source\ftpconst.c
a8f896fe8fc640aa71335d1a6269ff790d9b7a4ed6379eeed86d2deca7234c7c *Source\ftpserv.c
111269c386d9c6a34ebc12b4d51785ade70cc606d67d5840ab4e8c65d279e837 *Source\ftpserv.h
eaff0ee73df59a2c5b53d12d65a62bc74023296099b93869c2192f69c21b1a93 *Source\main.c
106d68ea37dd580b94c15cf1ca800929ccf92168d5b4794ea884916c8cc440bf *Source\x_malloc.c
79876657549a772e6e48fdacc83f18352ad9a23529cab840e169fdfe62d6a01e *Source\x_malloc.h
65c2c882ead0e9266325893b457b8506db2a081eb3936939dedfce52c22c31ea *Source\Debug\makefile
2850a07ea90193cc0206674ad1b62a0df01b343c7b5e548f7ecaca616ffb3a07 *Source\Debug\makefile
fa3d96ba5c45cb2b0004c8ea687045e16768ec90ec788f0958905083164e52f1 *Source\Debug\objects.mk
45bf7584af2acb3c6c806bd48b0774c661e081efdaff00d735554cde1ed76fbb *Source\Debug\sources.mk
09c8a40d264228fad831f5995ca698c522f812ac9c8e1658ce7a371b47ae6eff *Source\Debug\subdir.mk
7f0e62dea14799046248c445771acf51b0e1015cb8512449ddf8c681a01bfa5c *Source\Debug\subdir.mk
71f29f165b2554ec548bc56a113f38c0c993c2b34265acfd6d4c64a05f3db1ef *Source\Deprecated\Windows\fftp.sln
8708f082b6072e0ab2c55984c2bd252f80049f2d4dceabf6fd8cf4815331cf7f *Source\Deprecated\Windows\fftp\debug.conf
6315323d32acdc93160ed785f82631e686645370ae62082199f5c8000fc98e08 *Source\Deprecated\Windows\fftp\fftp.vcxproj
Expand All @@ -35,9 +38,9 @@ ef1b18997ea473ac8d516ef60efc64b9175418b8f078e088d783fdaef2544969 *Source\Depreca
60f19c6b805801e13824c4d9d44748da8245cd936971411d3d36b873121888eb *Source\Deprecated\Windows\fftp\minirtl\_strlen.c
87cc72bb8e3f1534bee09ee278ecd928d975ebb94aeffc767b67249815a0bf3a *Source\Deprecated\Windows\fftp\minirtl\_strncmpi.c
0434d69daa20fbf87d829ffc17e43dcc2db3386aff434af888011fdec2f645a4 *Source\Deprecated\Windows\fftp\minirtl\_strncpy.c
65c2c882ead0e9266325893b457b8506db2a081eb3936939dedfce52c22c31ea *Source\Release\makefile
2850a07ea90193cc0206674ad1b62a0df01b343c7b5e548f7ecaca616ffb3a07 *Source\Release\makefile
fa3d96ba5c45cb2b0004c8ea687045e16768ec90ec788f0958905083164e52f1 *Source\Release\objects.mk
45bf7584af2acb3c6c806bd48b0774c661e081efdaff00d735554cde1ed76fbb *Source\Release\sources.mk
871ea443b36ccdc99c0676567a58fe71051f2f2654e6227b311238f4d643398f *Source\Release\subdir.mk
c8a7f73c7aa597f350c40cb64a7dd4b51ad68862f46cc7ee8d3d5a0ea77f7e47 *Source\Release\subdir.mk
f7d0ab874ee47ea673ddcdd3dfd9662646f9c1a796b94f3e1b33e1321baf52c3 *Source\TLS-cert\gencert.sh
f3c8e1fdc3b05facb5e87ef1fc11b5fc1ee4d1d4832578f4fc1c23ecd488bab4 *Source\TLS-cert\mycert-req.txt
2 changes: 1 addition & 1 deletion Source/Debug/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ all: fftp
fftp: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C Linker'
gcc -o "fftp" $(OBJS) $(USER_OBJS) $(LIBS)
gcc -pthread -o "fftp" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '

Expand Down
8 changes: 7 additions & 1 deletion Source/Debug/subdir.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../cfgparse.c \
../fspathtools.c \
../ftpconst.c \
../ftpserv.c \
../main.c \
../x_malloc.c

OBJS += \
./cfgparse.o \
./fspathtools.o \
./ftpconst.o \
./ftpserv.o \
./main.o \
./x_malloc.o

C_DEPS += \
./cfgparse.d \
./fspathtools.d \
./ftpconst.d \
./ftpserv.d \
./main.d \
./x_malloc.d
Expand All @@ -26,7 +32,7 @@ C_DEPS += \
%.o: ../%.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
gcc -std=c99 -O0 -g3 -Wall -pthread -c -fmessage-length=0 -fno-ident -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
gcc -std=c99 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O0 -g3 -pedantic -Wall -Wextra -Wno-unused-parameter -c -fmessage-length=0 -fno-ident -D_GNU_SOURCE -v -pthread -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Expand Down
2 changes: 1 addition & 1 deletion Source/Release/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ all: fftp
fftp: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C Linker'
gcc -o "fftp" $(OBJS) $(USER_OBJS) $(LIBS)
gcc -pthread -o "fftp" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '

Expand Down
8 changes: 7 additions & 1 deletion Source/Release/subdir.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../cfgparse.c \
../fspathtools.c \
../ftpconst.c \
../ftpserv.c \
../main.c \
../x_malloc.c

OBJS += \
./cfgparse.o \
./fspathtools.o \
./ftpconst.o \
./ftpserv.o \
./main.o \
./x_malloc.o

C_DEPS += \
./cfgparse.d \
./fspathtools.d \
./ftpconst.d \
./ftpserv.d \
./main.d \
./x_malloc.d
Expand All @@ -26,7 +32,7 @@ C_DEPS += \
%.o: ../%.c
@echo 'Building file: $<'
@echo 'Invoking: GCC C Compiler'
gcc -std=c99 -O3 -Wall -Wextra -c -fmessage-length=0 -Wno-unused-parameter -Wno-unused-result -fno-ident -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
gcc -std=c99 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O3 -pedantic -Wall -Wextra -c -fmessage-length=0 -Wno-unused-parameter -Wno-unused-result -fno-ident -v -pthread -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"
@echo 'Finished building: $<'
@echo ' '

Expand Down
11 changes: 4 additions & 7 deletions Source/cfgparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "x_malloc.h"

char * skip_comments_and_blanks(char *p)
char *skip_comments_and_blanks(char *p)
{
while (*p != 0) {

Expand Down Expand Up @@ -47,9 +44,9 @@ char * skip_comments_and_blanks(char *p)
return p;
}

/* TODO: Refactor this function */
/* TODO: Rewrite this function */

int ParseConfig(
int config_parse(
const char *pcfg,
const char *section_name,
const char *key_name,
Expand Down Expand Up @@ -202,7 +199,7 @@ int ParseConfig(
return 0;
}

char *InitConfig(char *cfg_filename)
char *config_init(char *cfg_filename)
{
int f_config;
char *buffer = NULL;
Expand Down
6 changes: 3 additions & 3 deletions Source/cfgparse.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
*
* Created on: Aug 20, 2016
*
* Modified on: Feb 09, 2018
* Modified on: May 15, 2020
*
* Author: lightftp
*/

#ifndef CFGPARSE_H_
#define CFGPARSE_H_

char *InitConfig(char *cfg_filename);
int ParseConfig(const char *pcfg, const char *section_name, const char *key_name, char *value, unsigned long value_size_max);
char *config_init(char *cfg_filename);
int config_parse(const char *pcfg, const char *section_name, const char *key_name, char *value, unsigned long value_size_max);

#endif /* CFGPARSE_H_ */
3 changes: 3 additions & 0 deletions Source/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
- Removed
* Fixed/Changed

May 17, 2020, v2.1
* bugfixes and refactoring

Jun 28, 2018, v2.0a

+ simplify path processing functions
Expand Down
3 changes: 3 additions & 0 deletions Source/fftp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ Keyfile=/home/user/certificate/privkey.pem
# Password to decrypt private key.
KeyfilePassword=pemkeypassword

# Send keepalive packets (some NATs may require this)
keepalive=1

# USERS SECTIONS
#
# Note for "accs" field:
Expand Down
Loading

0 comments on commit f73706a

Please sign in to comment.