author | viric <viriketo@gmail.com> |
Wed, 19 Oct 2016 22:08:34 +0200 | |
changeset 349 | 3916245a60b5 |
parent 267 | 11631dd11ff8 |
child 286 | f648473fd056 |
permissions | -rw-r--r-- |
49 | 1 |
/* |
2 |
Task Spooler - a task queue system for the unix user |
|
267 | 3 |
Copyright (C) 2007-2009 LluĂs Batlle i Rossell |
49 | 4 |
|
5 |
Please find the license in the provided COPYING file. |
|
6 |
*/ |
|
3 | 7 |
#include <stdio.h> |
146 | 8 |
#include <sys/time.h> |
3 | 9 |
#include "main.h" |
10 |
||
111
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
11 |
void msgdump(FILE *f, const struct msg *m) |
3 | 12 |
{ |
111
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
13 |
fprintf(f, "msgdump:\n"); |
3 | 14 |
switch(m->type) |
15 |
{ |
|
31 | 16 |
case KILL_SERVER: |
111
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
17 |
fprintf(f, " KILL SERVER\n"); |
3 | 18 |
break; |
19 |
case NEWJOB: |
|
111
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
20 |
fprintf(f, " NEWJOB\n"); |
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
21 |
fprintf(f, " Commandsize: %i\n", m->u.newjob.command_size); |
3 | 22 |
break; |
23 |
case NEWJOB_OK: |
|
111
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
24 |
fprintf(f, " NEWJOB_OK\n"); |
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
25 |
fprintf(f, " JobID: '%i'\n", m->u.jobid); |
3 | 26 |
break; |
27 |
case RUNJOB: |
|
111
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
28 |
fprintf(f, " RUNJOB\n"); |
3 | 29 |
break; |
32 | 30 |
case RUNJOB_OK: |
111
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
31 |
fprintf(f, " RUNJOB_OK\n"); |
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
32 |
fprintf(f, " Outputsize: %i\n", m->u.output.ofilename_size); |
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
33 |
fprintf(f, " pid: %i\n", m->u.output.pid); |
32 | 34 |
break; |
3 | 35 |
case ENDJOB: |
111
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
36 |
fprintf(f, " ENDJOB\n"); |
3 | 37 |
break; |
38 |
case LIST: |
|
111
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
39 |
fprintf(f, " LIST\n"); |
3 | 40 |
break; |
5 | 41 |
case LIST_LINE: |
111
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
42 |
fprintf(f, " LIST_LINE\n"); |
146 | 43 |
fprintf(f, " Linesize: %i\n", m->u.size); |
32 | 44 |
break; |
45 |
case ASK_OUTPUT: |
|
111
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
46 |
fprintf(f, " ASK_OUTPUT\n"); |
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
47 |
fprintf(f, " Jobid: %i\n", m->u.jobid); |
32 | 48 |
break; |
49 |
case ANSWER_OUTPUT: |
|
111
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
50 |
fprintf(f, " ANSWER_OUTPUT\n"); |
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
51 |
fprintf(f, " Outputsize: %i\n", m->u.output.ofilename_size); |
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
52 |
fprintf(f, " PID: %i\n", m->u.output.pid); |
5 | 53 |
break; |
44 | 54 |
default: |
111
d6bc62904b5a
Fixed a buffer overflow in jobs.c, when sending the lines for LISTJOBS.
viric@mandarina
parents:
92
diff
changeset
|
55 |
fprintf(f, " Unknown message: %i\n", m->type); |
3 | 56 |
} |
57 |
} |