diff --git a/build/Debug/GNU-Linux/ftpData.o b/build/Debug/GNU-Linux/ftpData.o index 18b2e0a..4e64b40 100644 Binary files a/build/Debug/GNU-Linux/ftpData.o and b/build/Debug/GNU-Linux/ftpData.o differ diff --git a/build/Debug/GNU-Linux/library/fileManagement.o b/build/Debug/GNU-Linux/library/fileManagement.o index 49b49f8..910a535 100644 Binary files a/build/Debug/GNU-Linux/library/fileManagement.o and b/build/Debug/GNU-Linux/library/fileManagement.o differ diff --git a/dist/Debug/GNU-Linux/uftp b/dist/Debug/GNU-Linux/uftp index f118f64..b621134 100755 Binary files a/dist/Debug/GNU-Linux/uftp and b/dist/Debug/GNU-Linux/uftp differ diff --git a/ftpData.c b/ftpData.c index 109283a..05164da 100644 --- a/ftpData.c +++ b/ftpData.c @@ -276,6 +276,7 @@ int writeListDataInfoToSocket(char * thePath, int theSocket, int *filesNumber, i continue; } + //printf("\nFILE SIZE : %lld", data.fileSize); data.owner = FILE_GetOwner(fileList[i]); diff --git a/library/fileManagement.c b/library/fileManagement.c index bddccf1..7badef7 100644 --- a/library/fileManagement.c +++ b/library/fileManagement.c @@ -471,19 +471,20 @@ char * FILE_GetListPermissionsString(char *file) { char * FILE_GetOwner(char *fileName) { + int returnCode = 0; char *toReturn; struct stat info; - if (stat(fileName, &info) == -1 ) + + if ((returnCode = stat(fileName, &info)) == -1) return NULL; - struct passwd *pw = getpwuid(info.st_uid); - - if (pw->pw_name == 0) + struct passwd *pw; + if ( (pw = getpwuid(info.st_uid)) == NULL) return NULL; - + toReturn = (char *) malloc (strlen(pw->pw_name) + 1); strcpy(toReturn, pw->pw_name); - + return toReturn; } @@ -493,9 +494,9 @@ char * FILE_GetGroupOwner(char *fileName) struct stat info; if (stat(fileName, &info) == -1 ) return NULL; - struct group *gr = getgrgid(info.st_gid); + struct group *gr; - if (gr->gr_name == 0) + if ((gr = getgrgid(info.st_gid)) == NULL) return NULL; toReturn = (char *) malloc (strlen(gr->gr_name) + 1); diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 6501282..aef7ea3 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -6,8 +6,6 @@ - - file:/home/ugo/NetBeansProjects/uFTP/uftpd.cfg - +