Getting a network trace from a single application
jonasdn.blogspot.com
Getting a network trace from a single application
1–8 of 8 posts
Re: Getting a network trace from a single application
#2One thing: the "Handle exceptions of setuid() and setgid()" commit message caught my eye, so I took a look:
if (setuid(uid)
You probably want to add an exit() here, as well as to the preceeding setgid() call. Also, the earlier initgroups() can fail, too, so its result should also be checked.Re: Getting a network trace from a single application
#3Re: Getting a network trace from a single application
#4Cool! Namespace are a powerful but not very well known feature of Linux.
Re: Getting a network trace from a single application
#5Looks very nice! One thing: the "Handle exceptions of setuid() and setgid()" commit message caught my eye, so I took a look: if (setuid(uid) You probably want to add an exit() here, as well as to the preceeding setgid() call. Also, the earlier initgroups() can fail, too, so its result should also be checked.
Re: Getting a network trace from a single application
#6Cool! Namespace are a powerful but not very well known feature of Linux.
Well, unless you count docker, rkt, and the whole linux containers thing.
Re: Getting a network trace from a single application
#7Looks very nice! One thing: the "Handle exceptions of setuid() and setgid()" commit message caught my eye, so I took a look: if (setuid(uid) You probably want to add an exit() here, as well as to the preceeding setgid() call. Also, the earlier initgroups() can fail, too, so its result should also be checked.
#define APP_TIMEOUT (2000000L) /* 2 seconds */
...
usleep(APP_TIMEOUT);
usleep limits its argument's range to values from 0 to 1000000 and is considered obsolete. Please use nanosleep instead.Re: Getting a network trace from a single application
#8Looks very nice! One thing: the "Handle exceptions of setuid() and setgid()" commit message caught my eye, so I took a look: if (setuid(uid) You probably want to add an exit() here, as well as to the preceeding setgid() call. Also, the earlier initgroups() can fail, too, so its result should also be checked.
While we are doing this... #define APP_TIMEOUT (2000000L) /* 2 seconds */ ... usleep(APP_TIMEOUT); usleep limits its argument's range to values from 0 to 1000000 and is considered obsolete. Please use nanosleep instead.