diff --git a/build/modules/configRead.o b/build/modules/configRead.o index c4431d7..e81b2d3 100644 Binary files a/build/modules/configRead.o and b/build/modules/configRead.o differ diff --git a/build/modules/connection.o b/build/modules/connection.o index 876db42..ce97e90 100644 Binary files a/build/modules/connection.o and b/build/modules/connection.o differ diff --git a/build/modules/dynamicMemory.o b/build/modules/dynamicMemory.o index e151d4d..ec502b0 100644 Binary files a/build/modules/dynamicMemory.o and b/build/modules/dynamicMemory.o differ diff --git a/build/modules/fileManagement.o b/build/modules/fileManagement.o index 070c2b4..0d8bd36 100644 Binary files a/build/modules/fileManagement.o and b/build/modules/fileManagement.o differ diff --git a/build/modules/ftpCommandElaborate.o b/build/modules/ftpCommandElaborate.o index e0c762b..b384d52 100644 Binary files a/build/modules/ftpCommandElaborate.o and b/build/modules/ftpCommandElaborate.o differ diff --git a/build/modules/ftpServer.o b/build/modules/ftpServer.o index 4c0533d..faf8ea2 100644 Binary files a/build/modules/ftpServer.o and b/build/modules/ftpServer.o differ diff --git a/build/uFTP b/build/uFTP index 7741522..7cd5f31 100755 Binary files a/build/uFTP and b/build/uFTP differ diff --git a/ftpCommandElaborate.c b/ftpCommandElaborate.c index 4b39d03..db73d23 100644 --- a/ftpCommandElaborate.c +++ b/ftpCommandElaborate.c @@ -157,7 +157,7 @@ int parseCommandPass(ftpDataType * data, int socketId) if (strlen(thePass) >= 1) { - printf("\nLogin try with user %s, password %s", data->clients[socketId].login.name.text, thePass); + //printf("\nLogin try with user %s, password %s", data->clients[socketId].login.name.text, thePass); //PAM AUTH METHOD IF ENABLED if (data->ftpParameters.pamAuthEnabled == 1) @@ -165,7 +165,7 @@ int parseCommandPass(ftpDataType * data, int socketId) loginCheck( data->clients[socketId].login.name.text, thePass, &data->clients[socketId].login, &data->clients[socketId].memoryTable); if (data->clients[socketId].login.userLoggedIn == 1) { - printf("\n User logged with PAM ok!"); + //printf("\n User logged with PAM ok!"); returnCode = socketPrintf(data, socketId, "s", "230 Login Ok.\r\n"); if (returnCode <= 0) return FTP_COMMAND_PROCESSED_WRITE_ERROR; @@ -291,7 +291,7 @@ int parseCommandAuth(ftpDataType * data, int socketId) int parseCommandPwd(ftpDataType * data, int socketId) { - printf("\n pwd is %s", data->clients[socketId].login.ftpPath.text); + //printf("\n pwd is %s", data->clients[socketId].login.ftpPath.text); int returnCode; returnCode = socketPrintf(data, socketId, "sss", "257 \"", data->clients[socketId].login.ftpPath.text ,"\" is your current location\r\n"); @@ -745,18 +745,18 @@ int parseCommandCwd(ftpDataType * data, int socketId) thePath = getFtpCommandArg("CWD", data->clients[socketId].theCommandReceived, 0); - printf("\ncdw requested path: %s", thePath); + //printf("\ncdw requested path: %s", thePath); if (strlen(thePath) > 0) { //printf("Memory data address 1st call : %lld", &data->clients[socketId].memoryTable); isSafePath = getSafePath(&theSafePath, thePath, &data->clients[socketId].login, &data->clients[socketId].memoryTable); - printf("\ncdw safe path: %s", theSafePath.text); + //printf("\ncdw safe path: %s", theSafePath.text); } if (isSafePath == 1) { - printf("\n The Path requested for CWD IS:%s", theSafePath.text); + //printf("\n The Path requested for CWD IS:%s", theSafePath.text); setDynamicStringDataType(&absolutePathPrevious, data->clients[socketId].login.absolutePath.text, data->clients[socketId].login.absolutePath.textLen, &data->clients[socketId].memoryTable); setDynamicStringDataType(&ftpPathPrevious, data->clients[socketId].login.ftpPath.text, data->clients[socketId].login.ftpPath.textLen, &data->clients[socketId].memoryTable); @@ -784,10 +784,9 @@ int parseCommandCwd(ftpDataType * data, int socketId) } - printf("\ndata->clients[socketId].login.absolutePath = %s", data->clients[socketId].login.absolutePath.text); - printf("\ndata->clients[socketId].login.ftpPath = %s", data->clients[socketId].login.ftpPath.text); - printf("\nChecking the directory: %s", data->clients[socketId].login.absolutePath.text); - fflush(0); +// printf("\ndata->clients[socketId].login.absolutePath = %s", data->clients[socketId].login.absolutePath.text); +// printf("\ndata->clients[socketId].login.ftpPath = %s", data->clients[socketId].login.ftpPath.text); +// printf("\nChecking the directory: %s", data->clients[socketId].login.absolutePath.text); diff --git a/ftpServer.c b/ftpServer.c index b6dc7f2..47ce49d 100644 --- a/ftpServer.c +++ b/ftpServer.c @@ -722,7 +722,7 @@ static int processCommand(int processingElement) { int toReturn = 0; //printTimeStamp(); - printf ("\nCommand received from (%d): %s", processingElement, ftpData.clients[processingElement].theCommandReceived); + //printf ("\nCommand received from (%d): %s", processingElement, ftpData.clients[processingElement].theCommandReceived); cleanDynamicStringDataType(&ftpData.clients[processingElement].ftpCommand.commandArgs, 0, &ftpData.clients[processingElement].memoryTable); cleanDynamicStringDataType(&ftpData.clients[processingElement].ftpCommand.commandOps, 0, &ftpData.clients[processingElement].memoryTable); diff --git a/library/auth.c b/library/auth.c index 9d88abc..128b808 100644 --- a/library/auth.c +++ b/library/auth.c @@ -107,13 +107,13 @@ void loginCheck(char *name, char *password, loginDataType *login, DYNMEM_MemoryT login->ownerShip.ownerShipSet = 1; login->userLoggedIn = 1; - printf("\nLogin as: %s", pass->pw_name); - printf("\nPasswd: %s", pass->pw_passwd); - printf("\nDir: %s", pass->pw_dir); - printf("\nGid: %d", pass->pw_gid); - printf("\nUid: %d", pass->pw_uid); - printf("\nlogin->homePath.text: %s", login->homePath.text); - printf("\nlogin->absolutePath.text: %s", login->absolutePath.text); +// printf("\nLogin as: %s", pass->pw_name); +// printf("\nPasswd: %s", pass->pw_passwd); +// printf("\nDir: %s", pass->pw_dir); +// printf("\nGid: %d", pass->pw_gid); +// printf("\nUid: %d", pass->pw_uid); +// printf("\nlogin->homePath.text: %s", login->homePath.text); +// printf("\nlogin->absolutePath.text: %s", login->absolutePath.text); } } else diff --git a/library/configRead.c b/library/configRead.c index 07e3bc4..eed6064 100644 --- a/library/configRead.c +++ b/library/configRead.c @@ -146,7 +146,6 @@ void initFtpData(ftpDataType *ftpData) //printf("\nDYNMEM_malloc called"); //printf("\nElement location: %ld", (long int) ftpData->generalDynamicMemoryTable); - //fflush(0); //printf("\nElement size: %ld", ftpData->generalDynamicMemoryTable->size); //printf("\nElement address: %ld", (long int) ftpData->generalDynamicMemoryTable->address); //printf("\nElement nextElement: %ld",(long int) ftpData->generalDynamicMemoryTable->nextElement); diff --git a/library/connection.c b/library/connection.c index 3636ad3..2e794a5 100644 --- a/library/connection.c +++ b/library/connection.c @@ -52,7 +52,7 @@ int socketPrintf(ftpDataType * ftpData, int clientId, const char *__restrict __f int theStringSize = 0, theCommandSize = 0; memset(&theBuffer, 0, SOCKET_PRINTF_BUFFER); memset(&commandBuffer, 0, COMMAND_BUFFER); - printf("\nWriting to socket id %d, TLS %d: ", clientId, ftpData->clients[clientId].tlsIsEnabled); + //printf("\nWriting to socket id %d, TLS %d: ", clientId, ftpData->clients[clientId].tlsIsEnabled); pthread_mutex_lock(&ftpData->clients[clientId].writeMutex); @@ -140,7 +140,7 @@ int socketPrintf(ftpDataType * ftpData, int clientId, const char *__restrict __f #endif } - printf("\n%s", commandBuffer); + //printf("\n%s", commandBuffer); pthread_mutex_unlock(&ftpData->clients[clientId].writeMutex); diff --git a/library/dynamicMemory.c b/library/dynamicMemory.c index 43e9b38..806fb74 100644 --- a/library/dynamicMemory.c +++ b/library/dynamicMemory.c @@ -129,7 +129,6 @@ void *DYNMEM_realloc(void *theMemoryAddress, size_t bytes, DYNMEM_MemoryTable_Da if(!found) { - //fflush(0); //Debug TRAP //char *theData ="c"; //strcpy(theData, "NOOOOOOOOOOOOOOOO"); @@ -183,7 +182,6 @@ void DYNMEM_free(void *f_address, DYNMEM_MemoryTable_DataType ** memoryListHead) if(!found) { //printf("\n\nMemory address : %ld not found\n\n", f_address); - //fflush(0); //Debug TRAP //char *theData ="c"; //strcpy(theData, "ciaociaociao"); diff --git a/library/fileManagement.c b/library/fileManagement.c index 3dce163..d7acf1d 100644 --- a/library/fileManagement.c +++ b/library/fileManagement.c @@ -585,8 +585,7 @@ int checkParentDirectoryPermissions(char *fileName, int uid, int gid) theFileName[theFileNameLen++] = fileName[i]; } - printf ("\n checking parent permissions on : %s", theFileName); - fflush(0); + //printf ("\n checking parent permissions on : %s", theFileName); return checkUserFilePermissions(theFileName, uid, gid); } @@ -596,7 +595,7 @@ int checkUserFilePermissions(char *fileName, int uid, int gid) if (uid == 0 || gid == 0) { - printf("\n User is root"); + //printf("\n User is root"); return FILE_PERMISSION_RW; } @@ -621,19 +620,19 @@ int checkUserFilePermissions(char *fileName, int uid, int gid) if (info.st_uid == uid || info.st_gid == gid) { - printf("\n User is owner"); + //printf("\n User is owner"); filePermissions = FILE_PERMISSION_RW; } else { mode_t perm = info.st_mode; if ((perm & S_IROTH)){ - printf("\nfile can be readen"); + //printf("\nfile can be readen"); filePermissions |= FILE_PERMISSION_R; } if ((perm & S_IWOTH)){ - printf("\nfile can be written"); + //printf("\nfile can be written"); filePermissions |= FILE_PERMISSION_W; } }