4 ms·
Getting a network trace from a single application
- ckastner 10y agoLooks very nice! One thing: the "Handle exceptions of setuid() and setgid()" commit message caught my eye, so I took a look: if (setuid(uid) < 0) { fprintf(stderr, "Unable to set process user ID"); } 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.
- heinrich5991 10y agoLooks like a '\n' is missing there.
- jakobdabo 10y agoWhile 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.
- jonasdn 10y agoThank you, applied :)
- mrb 10y agoCool! Namespace are a powerful but not very well known feature of Linux.
- andrewstuart2 10y agoWell, unless you count docker, rkt, and the whole linux containers thing.
- rincebrain 10y agoThere are a number of consumers of namespaces, particularly of late, but they've been around (depending on which type) for years at this point, and many users (or even admins) have little knowledge of their existence or usage unless it comes time to deploy $CONTAINER and their platform does not have them enabled.