bug dprintf

This commit is contained in:
Ugo Cirmignani
2018-05-14 22:47:39 +02:00
parent f8422c068c
commit 88bff49c27
18 changed files with 19 additions and 29 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -515,8 +515,7 @@ int parseCommandCwd(clientDataType *theClientData)
{ {
setDynamicStringDataType(&theClientData->login.absolutePath, absolutePathPrevious.text, absolutePathPrevious.textLen); setDynamicStringDataType(&theClientData->login.absolutePath, absolutePathPrevious.text, absolutePathPrevious.textLen);
setDynamicStringDataType(&theClientData->login.ftpPath, ftpPathPrevious.text, ftpPathPrevious.textLen); setDynamicStringDataType(&theClientData->login.ftpPath, ftpPathPrevious.text, ftpPathPrevious.textLen);
returnCode = dprintf(theClientData->socketDescriptor, "550 Can't change directory to %s: No such file or directory\r\n", theClientData->login.absolutePath.text);
returnCode = dprintf(theClientData->socketDescriptor, "550 Can't change directory to %s: No such file or directory\r\n");
} }
if (returnCode <= 0) return FTP_COMMAND_PROCESSED_WRITE_ERROR; if (returnCode <= 0) return FTP_COMMAND_PROCESSED_WRITE_ERROR;

View File

@ -467,28 +467,20 @@ void getListDataInfo(char * thePath, DYNV_VectorGenericDataType *directoryInfo)
strftime(data.lastModifiedDataString, 80, "%b %d %Y", localtime(&data.lastModifiedData)); strftime(data.lastModifiedDataString, 80, "%b %d %Y", localtime(&data.lastModifiedData));
/* /*
%a Abbreviated weekday name Sun -1 List one file per line
%A Full weekday name Sunday -A List all files except "." and ".."
%b Abbreviated month name Mar -a List all files including those whose names start with "."
%B Full month name March -C List entries by columns
%c Date and time representation Sun Aug 19 02:56:02 2012 -d List directory entries instead of directory contents
%d Day of the month (01-31) 19 -F Append file type indicator (one of "*", "/", "=", "@" or "|") to names
%H Hour in 24h format (00-23) 14 -h Print file sizes in human-readable format (e.g. 1K, 234M, 2G)
%I Hour in 12h format (01-12) 05 -L List files pointed to by symlinks
%j Day of the year (001-366) 231 -l Use a long listing format
%m Month as a decimal number (01-12) 08 -n List numeric UIDs/GIDs instead of user/group names
%M Minute (00-59) 55 -R List subdirectories recursively
%p AM or PM designation PM -r Sort filenames in reverse order
%S Second (00-61) 02 -S Sort by file size
%U Week number with the first Sunday as the first day of week one (00-53) 33 -t Sort by modification time
%w Weekday as a decimal number with Sunday as 0 (0-6) 4
%W Week number with the first Monday as the first day of week one (00-53) 34
%x Date representation 08/19/12
%X Time representation 02:50:06
%y Year, last two digits (00-99) 01
%Y Year 2012
%Z Timezone name or abbreviation CDT
%% A % sign %
*/ */
directoryInfo->PushBack(directoryInfo, &data, sizeof(ftpListDataType)); directoryInfo->PushBack(directoryInfo, &data, sizeof(ftpListDataType));

View File

@ -169,7 +169,7 @@ void *connectionWorkerHandle(void * socketId)
if (ftpData.clients[theSocketId].workerData.theStorFile == NULL) if (ftpData.clients[theSocketId].workerData.theStorFile == NULL)
{ {
perror("Can't open the file"); perror("Can't open the file");
returnCode = dprintf(ftpData.clients[theSocketId].socketDescriptor, "550 Unable to write the file\r\n"); returnCode = dprintf(ftpData.clients[theSocketId].socketDescriptor, "553 Unable to write the file\r\n");
if (returnCode <= 0) if (returnCode <= 0)
{ {

View File

@ -101,8 +101,8 @@ void applyConfiguration(ftpParameters_DataType *ftpParameters)
if (returnCode == 1) if (returnCode == 1)
{ {
printf("\nThe process is already running.."); printf("\nThe process is already running..");
exit(0); exit(0);
} }
} }
} }

View File

@ -8,7 +8,7 @@
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group> <group>
<file>file:/home/ugo/NetBeansProjects/uFTP/ftpData.c</file> <file>file:/home/ugo/NetBeansProjects/uFTP/ftpData.c</file>
<file>file:/home/ugo/NetBeansProjects/uFTP/library/signals.c</file> <file>file:/home/ugo/NetBeansProjects/uFTP/ftpCommandElaborate.c</file>
<file>file:/home/ugo/NetBeansProjects/uFTP/ftpServer.c</file> <file>file:/home/ugo/NetBeansProjects/uFTP/ftpServer.c</file>
</group> </group>
</open-files> </open-files>

View File

@ -18,7 +18,6 @@ FTP_PORT = 21
#values true or false #values true or false
SINGLE_INSTANCE = false SINGLE_INSTANCE = false
#Run in background, daemon mode ok #Run in background, daemon mode ok
#values true or false #values true or false
DAEMON_MODE = false DAEMON_MODE = false