Giter Site home page Giter Site logo

uftp's People

Contributors

kingk85 avatar xentas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

uftp's Issues

Can't compile by NDK Android

fd_set => unknown type name
solved by: add header #include <sys/select.h>

pthread_cancel => unknown in lib android SDK
solved by: change
pthread_cancel(data->clients[clientId].workerData.workerThread);
to
int returnCode = pthread_kill(data->clients[clientId].workerData.workerThread, SIGUSR1);

Mixing active and passive ftp connections cause errors

Test case:
1: Start uFTP
2: Start an "active ftp" connection (e.g. DOS ftp). Log in and run "dir".
3: Start a "passive ftp" connection (e.g. from linux), log in and run "get" on a large file.
4: While the passive connection is still transferring the file, run "dir" on the "active (DOS) ftp".
This will end/terminate the ongoing "passive ftp" file transfer.
Sometimes there are also a never ending "2 Errno = 11" message.

BR
AD

please provide binarys for all common architectures

i miss arm (boards like raspberry pi or odroid-xu series ) and mips (for routers with openwrt), maybe also ppc and ppc64. you can use qemu-system and debian for tests and compilings, its quite simple to setup, and if you want i can help you or provide build server compute time...

thanks in advance

The "SITE CHMOD" FTP command seems not working

Hello. First, I want to thank a developer for this FTP server, which is able to run even in a custom environment where OpenSSH and Dropbear does not!

However, the "SITE CHMOD" command seems not working. For example:

curl --quote '-SITE CHMOD 0700 ros' --upload-file /var/tftpboot/ros ftp://192.168.15.100:21

The transfer completes successfully, but the curl complains: curl: (21) QUOT string not accepted: SITE CHMOD 0700 ros

ftp> quote SITE CHMOD 0777 ros
---> SITE CHMOD 0777 ros
550 Some errors occurred while changing file permissions.

I want to upload the file and mark it as executable automatically. Maybe there is some another way to do it, but for instance umask is not supported. How this can be done?

Passive mode connection is always closed

Hello! There is a problem.

Phenomenon: Passive connection is no problem after compiling under GCC, but there will be problems with passive connections under other embedded compilers.

Reason: GCC will default to an uninitialized local variable assignment is 0, but some of the compiler will not.

void setRandomicPort(ftpDataType *data, int socketPosition)
{
    unsigned short int randomicPort = 5000;
    int i;//-> int i = 0;

   randomicPort = data->ftpParameters.connectionPortMin + (rand()%(data->ftpParameters.connectionPortMax - data->ftpParameters.connectionPortMin)); 

   while (i < data->ftpParameters.maxClients)
   {
       if (randomicPort == data->clients[i].workerData.connectionPort)
       {
        randomicPort = data->ftpParameters.connectionPortMin + (rand()%(data->ftpParameters.connectionPortMax - data->ftpParameters.connectionPortMin)); 
        i = 0;
       }
       else 
       {
        i++;
       }
   }
      
   data->clients[socketPosition].workerData.connectionPort = randomicPort;

   printf("\n  data->clients[%d].workerData.connectionPort = %d", socketPosition, data->clients[socketPosition].workerData.connectionPort);

}

How could I build a static compilation version?

Thank you for your wonderful work. Now I need a static compilation version of uFTP, and I did these:

  1. I add -static option in line 49 of Makefile

  2. I disabled [ENABLE_OPENSSL_SUPPORT] in line 25,26 of Makefile

  3. make, and then get a new uFTP program

but when I execute this, I got this output:
[
Hello uFTP server v2.2.0 RC1 starting..

Reading configuration from
-> /etc/uftpd.cfg
Segmentation fault
]

Could you help me with this? Thanks.

Is not compatible with modern ssh client

I'm very disappointed with this piece of software, because it simply unusable for me. I tried to use it with FileZilla, Cyberduck and builtin python ftp lib and they all cannot even list directories because of lack of EPSV command support. I moved to another solution, but i still have question: how am i supposed to use uFTP? What clients are compatible?

running as non-root user

Hi,
I wondered if it is possible to run this as a non-root user? Obviously this would need to be on a non-privileged port.

Thanks
Neil

Run ordinary shell script under arm64

hi, I successfully compiled in a cross compilation environment ,but can't copy to system env folder(cp: can't create '/sbin/uFTP': Read-only file system),then run under script use ./uFTP , uutput is as follows, no background process :

Hello uFTP server v2.2.0 RC1 starting..

Reading configuration from
-> ./uftpd.cfg
so, How do I run processes in the background in this case ,thanks.

Wrong permissions

Set permissions and root restriction of the configuration file.

chown root:root /sbin/uFTP
chown root:root /etc/uftpd.cfg
chmod -rwx /etc/uftpd.cfg
> chmod u+rwx /etc/uftpd.cfg

Executable? facepalm

Missed option to set ports range for client connections.

uFTP server uses any arbitrary port number for client connections, which is very inconvenient or even not acceptable in some cases...
Documentation does not contain any related information.
This option should provide an opportunity to specify an exact ports range uFTP server will use for clients connections, e.g., from TCP 1024 to TCP 1124, so that server admin can tune up firewall and another software running on the server respectively. Apparently, such option is not available...

get on a non existing file cause server error and eventually hang

Hi
When requesting a file (e.g. get somefile.txt) that does not exist the uFTP server stops working correctly and eventually there is a permanent hang when applying more ftp commands. Tested on an arm platform.
E.g:

uFTP

Hello uFTP server v2.2.0 RC1 starting..

Reading configuration from
 -> /etc/uftpd.cfg

Reset of worker id: 0
Reset of worker id: 1
Reset of worker id: 2
Reset of worker id: 3
Reset of worker id: 4
Reset of worker id: 5
Reset of worker id: 6
Reset of worker id: 7
Reset of worker id: 8
Reset of worker id: 9
Reset of worker id: 10
Reset of worker id: 11
Reset of worker id: 12
Reset of worker id: 13
Reset of worker id: 14
Reset of worker id: 15
Reset of worker id: 16
Reset of worker id: 17
Reset of worker id: 18
Reset of worker id: 19
Reset of worker id: 20
Reset of worker id: 21
Reset of worker id: 22
Reset of worker id: 23
Reset of worker id: 24
Reset of worker id: 25
Reset of worker id: 26
Reset of worker id: 27
Reset of worker id: 28
Reset of worker id: 29
uFTP server starting..
data->clients[socketId].login.ownerShip.ownerShipSet = 1
data->clients[socketId].login.ownerShip.gid = 1000
data->clients[socketId].login.ownerShip.uid = 1000
createActiveSocket created socket = 6

Worker 0 is waiting for commands!
Reset of worker id: 0
PORT JOIN RETURN STATUS 0
createActiveSocket created socket = 0

Worker 0 is waiting for commands!
 COMMAND NOT SUPPORTED ********* RETR somefile.txt

Reset of worker id: 0
 inet_pton error occured

 Closing the client 4
Reset of worker id: 0
data->clients[socketId].login.ownerShip.ownerShipSet = 1
data->clients[socketId].login.ownerShip.gid = 1000
data->clients[socketId].login.ownerShip.uid = 1000
PORT JOIN RETURN STATUS 0
createActiveSocket created socket = 5

Worker 0 is waiting for commands!
Reset of worker id: 0
data->clients[socketId].login.ownerShip.ownerShipSet = 1
data->clients[socketId].login.ownerShip.gid = 1000
data->clients[socketId].login.ownerShip.uid = 1000
createActiveSocket created socket = 5

Worker 0 is waiting for commands!
Reset of worker id: 0
1 Error: : Bad file descriptor
1 Errno = 9
2 Errno = 11
2 Errno = 11
2 Errno = 11
.. This goes on forever

BR
AD

Will not compile

./library/fileManagement.c: In function ‘checkUserFilePermissions’:
./library/fileManagement.c:612:11: warning: unused variable ‘toReturn’ [-Wunused-variable]
     char *toReturn;
           ^
./library/configRead.c: In function ‘parseConfigurationFile’:
./library/configRead.c:562:113: warning: variable ‘returnCode’ set but not used [-Wunused-but-set-variable]
         int searchUserIndex, searchPasswordIndex, searchHomeIndex, searchUserOwnerIndex, searchGroupOwnerIndex, returnCode;
                                                                                                                 ^
ftpCommandElaborate.c: In function ‘writeRetrFile’:
ftpCommandElaborate.c:1409:8: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=]
        printf("\nError %d while writing retr file.", writtenSize);
        ^
ftpCommandElaborate.c:1348:19: warning: variable ‘theFileSize’ set but not used [-Wunused-but-set-variable]
     long long int theFileSize;
                   ^
ftpData.c: In function ‘cancelWorker’:
ftpData.c:571:6: warning: variable ‘returnCode’ set but not used [-Wunused-but-set-variable]
  int returnCode = pthread_cancel(data->clients[clientId].workerData.workerThread);
      ^
./library/openSsl.c: In function ‘createServerContext’:
./library/openSsl.c:71:5: warning: implicit declaration of function ‘TLS_server_method’ [-Wimplicit-function-declaration]
     method = TLS_server_method();
     ^
./library/openSsl.c:71:12: warning: assignment makes pointer from integer without a cast
     method = TLS_server_method();
            ^
./library/openSsl.c: In function ‘createClientContext’:
./library/openSsl.c:88:5: warning: implicit declaration of function ‘TLS_client_method’ [-Wimplicit-function-declaration]
     method = TLS_client_method();  /* Create new client-method instance */
     ^
./library/openSsl.c:88:12: warning: assignment makes pointer from integer without a cast
     method = TLS_client_method();  /* Create new client-method instance */
            ^
./library/openSsl.c: In function ‘configureContext’:
./library/openSsl.c:145:5: warning: implicit declaration of function ‘SSL_CTX_set_ecdh_auto’ [-Wimplicit-function-declaration]
     SSL_CTX_set_ecdh_auto(ctx, 1);
     ^
./library/openSsl.c: In function ‘locking_function’:
./library/openSsl.c:191:5: warning: implicit declaration of function ‘pthread_mutex_lock’ [-Wimplicit-function-declaration]
     MUTEX_LOCK(mutex_buf[n]);
     ^
./library/openSsl.c:193:5: warning: implicit declaration of function ‘pthread_mutex_unlock’ [-Wimplicit-function-declaration]
     MUTEX_UNLOCK(mutex_buf[n]);
     ^
./library/openSsl.c: In function ‘id_function’:
./library/openSsl.c:198:3: warning: implicit declaration of function ‘pthread_self’ [-Wimplicit-function-declaration]
   return ((unsigned long)THREAD_ID);
   ^
./library/openSsl.c: In function ‘thread_setup’:
./library/openSsl.c:209:5: warning: implicit declaration of function ‘pthread_mutex_init’ [-Wimplicit-function-declaration]
     MUTEX_SETUP(mutex_buf[i]);
     ^
./library/openSsl.c: In function ‘thread_cleanup’:
./library/openSsl.c:224:5: warning: implicit declaration of function ‘pthread_mutex_destroy’ [-Wimplicit-function-declaration]
     MUTEX_CLEANUP(mutex_buf[i]);
     ^
ftpServer.c: In function ‘workerCleanup’:
ftpServer.c:71:9: warning: variable ‘error’ set but not used [-Wunused-but-set-variable]
     int error;
         ^
ftpServer.c: In function ‘connectionWorkerHandle’:
ftpServer.c:380:17: warning: variable ‘theReturnCode’ set but not used [-Wunused-but-set-variable]
             int theReturnCode;
                 ^
./library/daemon.c: In function ‘daemonize’:
./library/daemon.c:80:18: warning: variable ‘fd2’ set but not used [-Wunused-but-set-variable]
     i, fd0, fd1, fd2;
                  ^
./library/daemon.c:80:13: warning: variable ‘fd1’ set but not used [-Wunused-but-set-variable]
     i, fd0, fd1, fd2;
             ^
./library/daemon.c:80:8: warning: variable ‘fd0’ set but not used [-Wunused-but-set-variable]
     i, fd0, fd1, fd2;
        ^
./library/daemon.c: In function ‘respawnProcess’:
./library/daemon.c:158:5: warning: implicit declaration of function ‘waitpid’ [-Wimplicit-function-declaration]
     waitpid(spawnedProcess, &returnStatus, 0);
     ^
./library/signals.c:40:13: warning: ‘ignore_sigpipe’ defined but not used [-Wunused-function]
 static void ignore_sigpipe(void)
             ^
./library/connection.c: In function ‘evaluateClientSocketConnection’:
./library/connection.c:743:22: warning: unused variable ‘theReturnCode’ [-Wunused-variable]
                  int theReturnCode = socketPrintf(ftpData, availableSocketIndex, "sss", "530 too many connection from your ip address ", ftpData->clients[availableSocketIndex].clientIpAddress, " \r\n");
                      ^
./library/connection.c:696:21: warning: variable ‘error’ set but not used [-Wunused-but-set-variable]
                 int error, numberOfConnectionFromSameIp, i;
                     ^
./library/connection.c:772:18: warning: variable ‘theReturnCode’ set but not used [-Wunused-but-set-variable]
              int theReturnCode = 0;
                  ^
./build/modules/openSsl.o: In function `createServerContext':
openSsl.c:(.text+0x44): undefined reference to `TLS_server_method'
./build/modules/openSsl.o: In function `createClientContext':
openSsl.c:(.text+0xac): undefined reference to `TLS_client_method'
./build/modules/openSsl.o: In function `configureContext':
openSsl.c:(.text+0x198): undefined reference to `SSL_CTX_set_ecdh_auto'
collect2: error: ld returned 1 exit status
Makefile:49: recipe for target 'uFTP' failed
make: *** [uFTP] Error 1

That's two hours of my life I'm never getting back.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.