Categories: Homework on time

Academia Vocational Fixing the Vulnerabilities in C Daemon Function Project there are vulnerabilities in the code that need to be fixed. after securing it

Academia Vocational Fixing the Vulnerabilities in C Daemon Function Project there are vulnerabilities in the code that need to be fixed. after securing it you need to provide a word document explaining:1- what you did2- how you did it 3- why you chose these methods. 4- for each fix a screenshot is a must. ? clang -std=c11 -Wall -Wextra original.c
original.c:58:20: warning: comparison of integers of different signs: ‘ssize_t’
(aka ‘long’) and ‘size_t’ (aka ‘unsigned long’) [-Wsign-compare]
while (byteswrote < len) ~~~~~~~~~~ ^ ~~~ original.c:83:19: warning: comparison of integers of different signs: 'ssize_t' (aka 'long') and 'size_t' (aka 'unsigned long') [-Wsign-compare] while (bytesread < len) ~~~~~~~~~ ^ ~~~ original.c:106:8: warning: unused variable 'p' [-Wunused-variable] char *p; ^ original.c:193:50: warning: unused parameter 'action' [-Wunused-parameter] void listArticles(int sock, FILE *logfile, char *action) ^ original.c:217:29: warning: unused parameter 'sock' [-Wunused-parameter] void command(FILE *log, int sock, char *action) ^ original.c:223:29: warning: unused parameter 'sock' [-Wunused-parameter] void addUser(FILE *log, int sock, char *action) ^ original.c:328:2: warning: 'snprintf' size argument is too large; destination buffer has size 512, but size argument is 1023 [-Wfortify-source] snprintf(search, sizeof(userfile)-1, "stat %s`ls %s | grep %s`", USERPATH, USERPATH, userfile); ^ original.c:365:7: warning: unused variable 'type' [-Wunused-variable] char type = 0; ^ original.c:523:23: warning: unused parameter 'signumber' [-Wunused-parameter] void spawnhandler(int signumber) ^ original.c:597:2: warning: implicit declaration of function 'daemon' is invalid in C99 [-Wimplicit-function-declaration] daemon(0,0); ^ original.c:582:14: warning: unused parameter 'argc' [-Wunused-parameter] int main(int argc, char *argv[]) ^ original.c:582:26: warning: unused parameter 'argv' [-Wunused-parameter] int main(int argc, char *argv[]) ^ 12 warnings generated. ? gcc -std=c11 -Wall -Wextra original.c original.c: In function 'writeSock': original.c:58:20: warning: comparison of integer expressions of different signedness: 'ssize_t' {aka 'long int'} and 'size_t' {aka 'long unsigned int'} [Wsign-compare] 58 | while (byteswrote < len) | ^ original.c: In function 'readSock': original.c:83:19: warning: comparison of integer expressions of different signedness: 'ssize_t' {aka 'long int'} and 'size_t' {aka 'long unsigned int'} [Wsign-compare] 83 | while (bytesread < len) | ^ original.c: In function 'writeArticle': original.c:106:8: warning: unused variable 'p' [-Wunused-variable] 106 | char *p; | ^ original.c: In function 'listArticles': original.c:193:50: warning: unused parameter 'action' [-Wunused-parameter] 193 | void listArticles(int sock, FILE *logfile, char *action) | ~~~~~~^~~~~~ original.c: In function 'command': original.c:217:29: warning: unused parameter 'sock' [-Wunused-parameter] 217 | void command(FILE *log, int sock, char *action) | ~~~~^~~~ original.c: In function 'addUser': original.c:223:29: warning: unused parameter 'sock' [-Wunused-parameter] 223 | void addUser(FILE *log, int sock, char *action) | ~~~~^~~~ original.c: In function 'adminFunctions': original.c:244:9: warning: variable 'len' set but not used [-Wunused-but-setvariable] 244 | size_t len; | ^~~ original.c: In function 'userFunctions': original.c:271:9: warning: variable 'len' set but not used [-Wunused-but-setvariable] 271 | size_t len; | ^~~ original.c: In function 'findarg': original.c:365:7: warning: unused variable 'type' [-Wunused-variable] 365 | char type = 0; | ^~~~ original.c: In function 'spawnhandler': original.c:523:23: warning: unused parameter 'signumber' [-Wunused-parameter] 523 | void spawnhandler(int signumber) | ~~~~^~~~~~~~~ original.c: In function 'main': original.c:597:2: warning: implicit declaration of function 'daemon' [-Wimplicitfunction-declaration] 597 | daemon(0,0); | ^~~~~~ original.c:582:14: warning: unused parameter 'argc' [-Wunused-parameter] 582 | int main(int argc, char *argv[]) | ~~~~^~~~ original.c:582:26: warning: unused parameter 'argv' [-Wunused-parameter] 582 | int main(int argc, char *argv[]) | ~~~~~~^~~~~~ original.c: In function 'authenticate': original.c:328:61: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 990 [-Wformat-truncation=] 328 | snprintf(search, sizeof(userfile)-1, "stat %s`ls %s | grep %s`", USERPATH, USERPATH, userfile); | ^~ ~~~~~~~~ original.c:328:2: note: 'snprintf' output between 35 and 1058 bytes into a destination of size 1023 328 | snprintf(search, sizeof(userfile)-1, "stat %s`ls %s | grep %s`", USERPATH, USERPATH, userfile); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~ original.c:336:36: warning: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 1015 [-Wformat-truncation=] 336 | snprintf(path, sizeof(path)-1, "%s%s", USERPATH, userfile); | ^~ ~~~~~~~~ original.c:336:2: note: 'snprintf' output between 9 and 1032 bytes into a destination of size 1023 336 | snprintf(path, sizeof(path)-1, "%s%s", USERPATH, userfile); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Purchase answer to see full attachment

Don't use plagiarized sources. Get Your Custom Essay on
Academia Vocational Fixing the Vulnerabilities in C Daemon Function Project there are vulnerabilities in the code that need to be fixed. after securing it
Just from $13/Page
Order Essay
superadmin

Recent Posts

Consider the following information, and answer the question below. China and England are internation

Consider the following information, and answer the question below. China and England are international trade…

4 years ago

The CPA is involved in many aspects of accounting and business. Let’s discuss some other tasks, othe

The CPA is involved in many aspects of accounting and business. Let's discuss some other…

4 years ago

For your initial post, share your earliest memory of a laser. Compare and contrast your first percep

For your initial post, share your earliest memory of a laser. Compare and contrast your…

4 years ago

2. The Ajax Co. just decided to save $1,500 a month for the next five years as a safety net for rece

2. The Ajax Co. just decided to save $1,500 a month for the next five…

4 years ago

How to make an insertion sort to sort an array of c strings using the following algorithm: * beg, *

How to make an insertion sort to sort an array of c strings using the…

4 years ago

Assume the following Keynesian income-expenditure two-sector model:

Assume the following Keynesian income-expenditure two-sector model:                                                AD = Cp + Ip                                                Cp = Co…

4 years ago