Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile warning and cannot run #25

Open
lystormenvoy opened this issue Jul 16, 2024 · 1 comment
Open

Compile warning and cannot run #25

lystormenvoy opened this issue Jul 16, 2024 · 1 comment

Comments

@lystormenvoy
Copy link

gcc version: gcc (GCC) 12.3.1 (openEuler 12.3.1-30.oe2403)
source: 2.6.0-stable in github's release

I compile with these warning but it seems can finish the compile.
I copy the uftpd.cfg to /etc
I run uFTP it print Hello uFTP server v2.6.0 stable starting.. then I use ps -ef | grep uFTP and can't see process.

Compiler: gcc
Output Directory: ./build/
CGI FILES: start uFTP end
Clean ok
./library/fileManagement.c: In functionFILE_IsFile’:
./library/fileManagement.c:211:44: warning: passing argument 1 ofFILE_CheckIfLinkExistdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
  211 |     if(checkExist && FILE_CheckIfLinkExist(TheFileName) == 0)
      |                                            ^~~~~~~~~~~
./library/fileManagement.c:80:34: note: expectedchar *but argument is of typeconst char *80 | int FILE_CheckIfLinkExist(char * filename)
      |                           ~~~~~~~^~~~~~~~
./library/fileManagement.c: In functionFILE_GetDirectoryInodeList’:
./library/fileManagement.c:267:17: warning: ‘memsetused with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
  267 |                 memset(thePathToCheck, 0, PATH_MAX);
      |                 ^~~~~~
./library/fileManagement.c:269:24: warning: passing argument 1 ofstrcpyfrom incompatible pointer type [-Wincompatible-pointer-types]
  269 |                 strcpy(thePathToCheck, DirectoryInodeName);
      |                        ^~~~~~~~~~~~~~
      |                        |
      |                        char **
In file included from ./library/fileManagement.c:29:
/usr/include/string.h:141:39: note: expectedchar * restrict’ but argument is of typechar **141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
./library/fileManagement.c:270:24: warning: passing argument 1 ofstrcatfrom incompatible pointer type [-Wincompatible-pointer-types]
  270 |                 strcat(thePathToCheck, "/");
      |                        ^~~~~~~~~~~~~~
      |                        |
      |                        char **
/usr/include/string.h:149:39: note: expectedchar * restrict’ but argument is of typechar **149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
./library/fileManagement.c:271:24: warning: passing argument 1 ofstrcatfrom incompatible pointer type [-Wincompatible-pointer-types]
  271 |                 strcat(thePathToCheck, dir->d_name);
      |                        ^~~~~~~~~~~~~~
      |                        |
      |                        char **
/usr/include/string.h:149:39: note: expectedchar * restrict’ but argument is of typechar **149 | extern char *strcat (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
./library/fileManagement.c:273:60: warning: format ‘%sexpects argument of typechar *’, but argument 2 has typechar **’ [-Wformat=]
  273 |                 printf("\n ************* thePathToCheck = %s", thePathToCheck);
      |                                                           ~^   ~~~~~~~~~~~~~~
      |                                                            |   |
      |                                                            |   char **
      |                                                            char *
./library/fileManagement.c:274:69: warning: passing argument 1 ofFILE_CheckIfLinkExistfrom incompatible pointer type [-Wincompatible-pointer-types]
  274 |                 if (checkIfInodeExist == 1 && FILE_CheckIfLinkExist(thePathToCheck) == 0)
      |                                                                     ^~~~~~~~~~~~~~
      |                                                                     |
      |                                                                     char **
./library/fileManagement.c:80:34: note: expectedchar *but argument is of typechar **80 | int FILE_CheckIfLinkExist(char * filename)
      |                           ~~~~~~~^~~~~~~~
./library/fileManagement.c: In functioncheckUserFilePermissions’:
./library/fileManagement.c:674:11: warning: unused variabletoReturn’ [-Wunused-variable]
  674 |     char *toReturn;
      |           ^~~~~~~~
./library/fileManagement.c: In functionFILE_GetGroupOwner’:
./library/fileManagement.c:733:15: warning: unused variablelp’ [-Wunused-variable]
  733 |     short int lp;
      |               ^~
./library/fileManagement.c: In functionFILE_doChownFromUidGidString’:
./library/fileManagement.c:850:26: warning: unused variablegrp’ [-Wunused-variable]
  850 |     const struct group  *grp;
      |                          ^~~
./library/fileManagement.c: In functionFILE_getGID’:
./library/fileManagement.c:879:15: warning: unused variablelp’ [-Wunused-variable]
  879 |     short int lp;
      |               ^~
./library/fileManagement.c: In functionFILE_AppendStringToFile’:
./library/fileManagement.c:763:1: warning: control reaches end of non-void function [-Wreturn-type]
  763 | }
      | ^
./library/dynamicVectors.c: In functionDYNV_VectorGeneric_Init’:
./library/dynamicVectors.c:42:32: warning: assignment tovoid (*)(void *, int,  void (*)(void *))’ from incompatible pointer typevoid (*)(DYNV_VectorGenericDataType *, int,  void (*)(void *))’ {akavoid (*)(struct DYNV_VectorGenericDataStruct *, int,  void (*)(void *))’} [-Wincompatible-pointer-types]
   42 |     TheVectorGeneric->DeleteAt = &DYNV_VectorGeneric_DeleteAt;
      |                                ^
./library/dynamicVectors.c:43:31: warning: assignment tovoid (*)(void *, void (*)(struct DYNV_VectorGenericDataStruct *))’ from incompatible pointer typevoid (*)(DYNV_VectorGenericDataType *, void (*)(DYNV_VectorGenericDataType *))’ {akavoid (*)(struct DYNV_VectorGenericDataStruct *, void (*)(struct DYNV_VectorGenericDataStruct *))’} [-Wincompatible-pointer-types]
   43 |     TheVectorGeneric->Destroy = &DYNV_VectorGeneric_Destroy;
      |                               ^
./library/dynamicVectors.c:44:31: warning: assignment tovoid (*)(void *, void (*)(void *))’ from incompatible pointer typevoid (*)(DYNV_VectorGenericDataType *, void (*)(void *))’ {akavoid (*)(struct DYNV_VectorGenericDataStruct *, void (*)(void *))’} [-Wincompatible-pointer-types]
   44 |     TheVectorGeneric->PopBack = &DYNV_VectorGeneric_PopBack;
      |                               ^
./library/dynamicVectors.c:45:32: warning: assignment tovoid (*)(void *, void *, int)’ from incompatible pointer typevoid (*)(DYNV_VectorGenericDataType *, void *, int)’ {akavoid (*)(struct DYNV_VectorGenericDataStruct *, void *, int)’} [-Wincompatible-pointer-types]
   45 |     TheVectorGeneric->PushBack = &DYNV_VectorGeneric_PushBack;
      |                                ^
./library/dynamicVectors.c:46:35: warning: assignment tovoid (*)(void *)’ from incompatible pointer typevoid (*)(DYNV_VectorGenericDataType *)’ {akavoid (*)(struct DYNV_VectorGenericDataStruct *)’} [-Wincompatible-pointer-types]
   46 |     TheVectorGeneric->SoftDestroy = &DYNV_VectorGeneric_SoftDestroy;
      |                                   ^
./library/dynamicVectors.c:47:35: warning: assignment tovoid (*)(void *)’ from incompatible pointer typevoid (*)(DYNV_VectorGenericDataType *)’ {akavoid (*)(struct DYNV_VectorGenericDataStruct *)’} [-Wincompatible-pointer-types]
   47 |     TheVectorGeneric->SoftPopBack = &DYNV_VectorGeneric_SoftPopBack;
      |                                   ^
./library/dynamicVectors.c: In functionDYNV_VectorString_Init’:
./library/dynamicVectors.c:186:25: warning: assignment tovoid (*)(void *, int)’ from incompatible pointer typevoid (*)(DYNV_VectorString_DataType *, int)’ {akavoid (*)(struct DYNV_VectorString *, int)’} [-Wincompatible-pointer-types]
  186 |     TheVector->DeleteAt = &DYNV_VectorString_DeleteAt;
      |                         ^
./library/dynamicVectors.c:187:24: warning: assignment tovoid (*)(void *)’ from incompatible pointer typevoid (*)(DYNV_VectorString_DataType *)’ {akavoid (*)(struct DYNV_VectorString *)’} [-Wincompatible-pointer-types]
  187 |     TheVector->Destroy = &DYNV_VectorString_Destroy;
      |                        ^
./library/dynamicVectors.c:188:24: warning: assignment tovoid (*)(void *)’ from incompatible pointer typevoid (*)(DYNV_VectorString_DataType *)’ {akavoid (*)(struct DYNV_VectorString *)’} [-Wincompatible-pointer-types]
  188 |     TheVector->PopBack = &DYNV_VectorString_PopBack;
      |                        ^
./library/dynamicVectors.c:189:25: warning: assignment tovoid (*)(void *, char *, int)’ from incompatible pointer typevoid (*)(DYNV_VectorString_DataType *, char *, int)’ {akavoid (*)(struct DYNV_VectorString *, char *, int)’} [-Wincompatible-pointer-types]
  189 |     TheVector->PushBack = &DYNV_VectorString_PushBack;
      |                         ^
./library/configRead.c: In functionparseConfigurationFile’:
./library/configRead.c:531:17: warning: passing argument 1 ofstrncpyfrom incompatible pointer type [-Wincompatible-pointer-types]
  531 |         strncpy(&ftpParameters->natIpAddress, ((parameter_DataType *) parametersVector->Data[searchIndex])->value, STRING_SZ_SMALL);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 |
      |                 char (*)[100]
In file included from ./library/configRead.c:28:
/usr/include/string.h:144:40: note: expectedchar * restrict’ but argument is of typechar (*)[100]’
  144 | extern char *strncpy (char *__restrict __dest,
      |                       ~~~~~~~~~~~~~~~~~^~~~~~
./library/configRead.c:636:113: warning: variablereturnCodeset but not used [-Wunused-but-set-variable]
  636 |         int searchUserIndex, searchPasswordIndex, searchHomeIndex, searchUserOwnerIndex, searchGroupOwnerIndex, returnCode;
      |                                                                                                                 ^~~~~~~~~~
./library/configRead.c:736:30: warning: variablereturnCodeset but not used [-Wunused-but-set-variable]
  736 |         int searchUserIndex, returnCode;
      |                              ^~~~~~~~~~
ftpCommandElaborate.c: In functionparseCommandUser’:
ftpCommandElaborate.c:98:9: warning: implicit declaration of functionaddLog’ [-Wimplicit-function-declaration]
   98 |         addLog("socketPrintfError ", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |         ^~~~~~
ftpCommandElaborate.c: In functionparseCommandPass’:
ftpCommandElaborate.c:183:17: warning: ‘memsetused with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
  183 |                 memset(theLogString, 0, STRING_SZ_LARGE);
      |                 ^~~~~~
ftpCommandElaborate.c:184:26: warning: passing argument 1 ofsnprintffrom incompatible pointer type [-Wincompatible-pointer-types]
  184 |                 snprintf(theLogString, STRING_SZ_LARGE, "An ip %s has been blacklisted due too many password errors. Trying to login as user: %s ", data->clients[socketId].clientIpAddress, data->clients[socketId].login.name.text);
      |                          ^~~~~~~~~~~~
      |                          |
      |                          char **
In file included from ftpCommandElaborate.c:32:
/usr/include/stdio.h:383:39: note: expectedchar * restrict’ but argument is of typechar **383 | extern int snprintf (char *__restrict __s, size_t __maxlen,
      |                      ~~~~~~~~~~~~~~~~~^~~
ftpCommandElaborate.c: In functionparseCommandRetr’:
ftpCommandElaborate.c:1060:17: warning: unused variablewriteReturn’ [-Wunused-variable]
 1060 |             int writeReturn = socketPrintf(data, socketId, "s", "550 no reading permission on the file\r\n");
      |                 ^~~~~~~~~~~
ftpCommandElaborate.c: In functionwriteRetrFile’:
ftpCommandElaborate.c:2195:19: warning: variabletheFileSizeset but not used [-Wunused-but-set-variable]
 2195 |     long long int theFileSize;
      |                   ^~~~~~~~~~~
ftpCommandElaborate.c: In functionparseCommandRetr’:
ftpCommandElaborate.c:1062:16: warning: ‘returnCodemay be used uninitialized [-Wmaybe-uninitialized]
 1062 |             if (returnCode <= 0)
      |                ^
ftpCommandElaborate.c:1026:9: note: ‘returnCodewas declared here
 1026 |     int returnCode;
      |         ^~~~~~~~~~
ftpCommandElaborate.c: In functionsetPermissions’:
ftpCommandElaborate.c:2467:73: warning: ‘%sdirective output may be truncated writing up to 4095 bytes into a region of size 4065 [-Wformat-truncation=]
 2467 |         snprintf(errorString, PATH_MAX, "CHMOD not a file or directory: %s", theFinalFilename);
      |                                                                         ^~   ~~~~~~~~~~~~~~~~
ftpCommandElaborate.c:2467:9: note: ‘snprintfoutput between 32 and 4127 bytes into a destination of size 4096
 2467 |         snprintf(errorString, PATH_MAX, "CHMOD not a file or directory: %s", theFinalFilename);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ftpData.c: In functionmy_realpath’:
ftpData.c:63:9: warning: implicit declaration of functionaddLog’ [-Wimplicit-function-declaration]
   63 |         addLog("getcwd error ", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |         ^~~~~~
ftpData.c: In functiongetSafePath’:
ftpData.c:158:9: warning: unused variabletheDirectoryToCheckIndex’ [-Wunused-variable]
  158 |     int theDirectoryToCheckIndex = 0;
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
ftpData.c: In functionwriteListDataInfoToSocket’:
ftpData.c:371:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  371 |         if (data.isLink = 1 &&
      |             ^~~~
ftpData.c:409:46: warning: the comparison will always evaluate as ‘false’ for the address oflastModifiedDataStringwill never be NULL [-Waddress]
  409 |                 ,data.lastModifiedDataString == NULL? "Unknown" : data.lastModifiedDataString
      |                                              ^~
In file included from ftpCommandsElaborate.h:46,
                 from ftpData.c:36:
ftpData.h:284:10: note: ‘lastModifiedDataStringdeclared here
  284 |     char lastModifiedDataString[LIST_DATA_TYPE_MODIFIED_DATA_STR_SIZE];
      |          ^~~~~~~~~~~~~~~~~~~~~~
ftpData.c:445:46: warning: the comparison will always evaluate as ‘false’ for the address oflastModifiedDataStringwill never be NULL [-Waddress]
  445 |                 ,data.lastModifiedDataString == NULL? "Unknown" : data.lastModifiedDataString
      |                                              ^~
ftpData.h:284:10: note: ‘lastModifiedDataStringdeclared here
  284 |     char lastModifiedDataString[LIST_DATA_TYPE_MODIFIED_DATA_STR_SIZE];
      |          ^~~~~~~~~~~~~~~~~~~~~~
ftpData.c: In functiongetSafePath’:
ftpData.c:195:13: warning: ‘strncatspecified bound 4096 equals destination size [-Wstringop-overflow=]
  195 |             strncat(theDirectoryToCheck, "/", PATH_MAX);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ftpData.c:185:9: warning: ‘strncatspecified bound 4096 equals destination size [-Wstringop-overflow=]
  185 |         strncat(theDirectoryToCheck, theDirectoryNamePointer, PATH_MAX);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ftpData.c:198:9: warning: ‘strncatspecified bound 4096 equals destination size [-Wstringop-overflow=]
  198 |         strncat(theDirectoryToCheck, theDirectoryNamePointer, PATH_MAX);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./library/openSsl.c: In functioninitOpenssl’:
./library/openSsl.c:53:5: warning: ‘ERR_load_BIO_stringsis deprecated: Since OpenSSL 3.0 [-Wdeprecated-declarations]
   53 |     ERR_load_BIO_strings();
      |     ^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/cryptoerr.h:17,
                 from /usr/include/openssl/crypto.h:38,
                 from /usr/include/openssl/comp.h:22,
                 from /usr/include/openssl/ssl.h:28,
                 from ./library/openSsl.c:30:
/usr/include/openssl/cryptoerr_legacy.h:31:27: note: declared here
   31 | OSSL_DEPRECATEDIN_3_0 int ERR_load_BIO_strings(void);
      |                           ^~~~~~~~~~~~~~~~~~~~
./library/openSsl.c: In functioncreateClientContext’:
./library/openSsl.c:98:7: warning: implicit declaration of functionaddLog’ [-Wimplicit-function-declaration]
   98 |       addLog("Unable to create server SSL context", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |       ^~~~~~
./library/openSsl.c: At top level:
./library/openSsl.c:198:22: warning: ‘id_function’ defined but not used [-Wunused-function]
  198 | static unsigned long id_function(void)
      |                      ^~~~~~~~~~~
./library/openSsl.c:190:13: warning: ‘locking_function’ defined but not used [-Wunused-function]
  190 | static void locking_function(int mode, int n, const char *file, int line)
      |             ^~~~~~~~~~~~~~~~
ftpServer.c: In functionworkerCleanup’:
ftpServer.c:68:9: warning: variableerrorset but not used [-Wunused-but-set-variable]
   68 |     int error;
      |         ^~~~~
In file included from ftpServer.c:53:
ftpServer.c: In functionconnectionWorkerHandle’:
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:189:70: note: in expansion of macroCURRENT_FUNC189 |             addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                      ^~~~~~~~~~~~
In file included from ftpServer.c:48:
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:208:78: note: in expansion of macroCURRENT_FUNC208 |                     addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                              ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:218:78: note: in expansion of macroCURRENT_FUNC218 |                     addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                              ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:230:70: note: in expansion of macroCURRENT_FUNC230 |             addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                      ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:251:70: note: in expansion of macroCURRENT_FUNC251 |             addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                      ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:270:66: note: in expansion of macroCURRENT_FUNC270 |         addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                  ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:282:66: note: in expansion of macroCURRENT_FUNC282 |         addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                  ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:346:78: note: in expansion of macroCURRENT_FUNC346 |                     addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                              ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:359:74: note: in expansion of macroCURRENT_FUNC359 |                 addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                          ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:414:74: note: in expansion of macroCURRENT_FUNC414 |                 addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                          ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
ftpServer.c:401:17: warning: variabletheReturnCodeset but not used [-Wunused-but-set-variable]
  401 |             int theReturnCode;
      |                 ^~~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:437:72: note: in expansion of macroCURRENT_FUNC437 |               addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                        ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:446:72: note: in expansion of macroCURRENT_FUNC446 |               addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                        ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:455:72: note: in expansion of macroCURRENT_FUNC455 |               addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                        ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:470:74: note: in expansion of macroCURRENT_FUNC470 |                 addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                          ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:485:74: note: in expansion of macroCURRENT_FUNC485 |                 addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                          ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:497:72: note: in expansion of macroCURRENT_FUNC497 |               addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                        ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
ftpServer.c: In functionrunFtpServer’:
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:559:89: note: in expansion of macroCURRENT_FUNC559 |         addLog("Pthead create error restarting the server", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                                         ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:641:86: note: in expansion of macroCURRENT_FUNC641 |                             addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                                      ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:712:96: note: in expansion of macroCURRENT_FUNC712 |                                       addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                                                ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:723:92: note: in expansion of macroCURRENT_FUNC723 |                                   addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                                            ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
ftpServer.c:738:84: note: in expansion of macroCURRENT_FUNC738 |                           addLog("Closing the client", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                                    ^~~~~~~~~~~~
library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
./library/daemon.c: In functiondaemonize’:
./library/daemon.c:83:18: warning: variablefd2set but not used [-Wunused-but-set-variable]
   83 |     i, fd0, fd1, fd2;
      |                  ^~~
./library/daemon.c:83:13: warning: variablefd1set but not used [-Wunused-but-set-variable]
   83 |     i, fd0, fd1, fd2;
      |             ^~~
./library/daemon.c:83:8: warning: variablefd0set but not used [-Wunused-but-set-variable]
   83 |     i, fd0, fd1, fd2;
      |        ^~~
./library/signals.c: In functionignore_sigpipe’:
./library/signals.c:59:9: warning: implicit declaration of functionaddLog’ [-Wimplicit-function-declaration]
   59 |         addLog("Could not ignore the SIGPIPE signal", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |         ^~~~~~
./library/signals.c: At top level:
./library/signals.c:42:13: warning: ‘ignore_sigpipe’ defined but not used [-Wunused-function]
   42 | static void ignore_sigpipe(void)
      |             ^~~~~~~~~~~~~~
./library/connection.c: In functioncreateSocket’:
./library/connection.c:372:17: warning: implicit declaration of functionaddLog’ [-Wimplicit-function-declaration]
  372 |                 addLog("socketopt failed", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                 ^~~~~~
./library/connection.c: In functionevaluateClientSocketConnection’:
./library/connection.c:772:29: warning: unused variabletheReturnCode’ [-Wunused-variable]
  772 |                         int theReturnCode = socketPrintf(ftpData, availableSocketIndex, "sss", "530 too many connection from your ip address ", ftpData->clients[availableSocketIndex].clientIpAddress, " \r\n");
      |                             ^~~~~~~~~~~~~
./library/connection.c:725:21: warning: variableerrorset but not used [-Wunused-but-set-variable]
  725 |                 int error, numberOfConnectionFromSameIp, i;
      |                     ^~~~~
./library/connection.c:804:21: warning: variabletheReturnCodeset but not used [-Wunused-but-set-variable]
  804 |                 int theReturnCode = 0;
      |                     ^~~~~~~~~~~~~
./library/log.c: In functiondelete_old_logs’:
./library/log.c:107:5: warning: ‘returnwith no value, in function returning non-void [-Wreturn-type]
  107 |     return;
      |     ^~~~~~
./library/log.c:84:12: note: declared here
   84 | static int delete_old_logs(const char* folder_path, int days_to_keep)
      |            ^~~~~~~~~~~~~~~
./library/log.c: In functionlogInit’:
./library/log.c:243:9: warning: ‘returnwith no value, in function returning non-void [-Wreturn-type]
  243 |         return;
      |         ^~~~~~
./library/log.c:235:5: note: declared here
  235 | int logInit(char * folder, int numberOfLogFiles)
      |     ^~~~~~~
./library/log.c:255:52: warning: passing argument 3 ofpthread_createfrom incompatible pointer type [-Wincompatible-pointer-types]
  255 |     returnCode = pthread_create(&pLogThread, NULL, &logThread, NULL);
      |                                                    ^~~~~~~~~~
      |                                                    |
      |                                                    void (*)(void *)
In file included from ./library/log.c:3:
/usr/include/pthread.h:204:36: note: expectedvoid * (*)(void *)’ but argument is of typevoid (*)(void *)’
  204 |                            void *(*__start_routine) (void *),
      |                            ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./library/log.c:15:
./library/../debugHelper.h:9:26: warning: passing argument 4 ofaddLogdiscardsconstqualifier from pointer target type [-Wdiscarded-qualifiers]
    9 |     #define CURRENT_FUNC __func__
      |                          ^~~~~~~~
./library/log.c:258:89: note: in expansion of macroCURRENT_FUNC258 |         addLog("Pthead create error restarting the server", CURRENT_FILE, CURRENT_LINE, CURRENT_FUNC);
      |                                                                                         ^~~~~~~~~~~~
In file included from ./library/log.c:14:
./library/log.h:29:68: note: expectedchar *but argument is of typeconst char *29 | void addLog(char* logString, char * currFile, int currLine, char * currFunction);
      |                                                             ~~~~~~~^~~~~~~~~~~~
./library/log.c: In functionlogThread’:
./library/log.c:202:9: warning: ‘strncatspecified bound 4096 equals destination size [-Wstringop-overflow=]
  202 |         strncat(theLogFilename, logName, PATH_MAX);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./library/log.c: In functionaddLog’:
./library/log.c:294:5: warning: ‘strncatspecified bound 5120 equals destination size [-Wstringop-overflow=]
  294 |     strncat(theLogString, logString, LOG_LINE_SIZE);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./library/log.c:295:5: warning: ‘strncatspecified bound 5120 equals destination size [-Wstringop-overflow=]
  295 |     strncat(theLogString, debugInfo, LOG_LINE_SIZE);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build process end
@kingk85
Copy link
Owner

kingk85 commented Jul 21, 2024

Seems like there is a permission issue, try to:

Check your configuration.
Execute as root uFTP.

If you still have problem you can disable daemon mode, and check the execution on the console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants