wednesday night / a site for sore eyes
choose one: a few recent posts; links to embarassing things; rss was for robots.

<< April 11, 2006 >>
good times

every day i spend with my macbook pro is a day that i learn a little something about myself and my operating system. for example, did you know that seteuid(geteuid()) can fail? it sure doesn't on linux, but slack this:

#include <sys/types.h> #include <unistd.h> #include <stdio.h> #include <stdlib.h> int main (int argc, char *argv[]) { if (seteuid (70) < 0) { perror ("could not do initial seteuid"); printf ("uid: %d euid: %d\n", (int)getuid(), (int)geteuid()); return 1; } if (seteuid (geteuid()) < 0) { perror ("could not do secondary seteuid"); printf ("uid: %d euid: %d\n", (int)getuid(), (int)geteuid()); return 2; } printf ("all ok!\n"); return 0; }

$ uname -msrn Darwin hot-pants.local 8.6.1 i386 $ gcc /tmp/checkuid.c -o /tmp/checkuid $ /tmp/checkuid could not do initial seteuid: Operation not permitted uid: 1078 euid: 1078 $ sudo /tmp/checkuid could not do secondary seteuid: Operation not permitted uid: 0 euid: 70 $

(queue the more you know music)

* * *