Author Archive

Basement update

Monday, March 3rd, 2008

Tomorrow is hopefully my last inspection before I can start covering the walls in SheetRock. =) As you can imagine I am about to go crazy with the lack of a place to tinker for the last several months. It will all be worth it when my shiny new workshop is up and going.

I’ll get some pictures of my second-rate carpentry up some day.

One year

Saturday, February 16th, 2008

I’m a little late posting this (OK, two months late), but Maddox celebrated his first birthday in December. As you can see he is a little party animal.

Bouncy horse

Pipe Viewer

Wednesday, February 13th, 2008

A colleague at work showed me this utility for viewing statistics on information flow through pipes. It is really slick.

OpenOffice and Active Directory?

Wednesday, January 9th, 2008

I tried to start OpenOffice today on my Red Hat 5 workstation and nothing happened. Starting from the command line I saw this error:

(soffice.bin:14419): GLib-WARNING **: getpwuid_r(): failed due to unknown user id (118141)

The user id (118141) is my Active Directory login mapped to a local UID on my Linux workstation. To make a long story short, the ncsd daemon was not running and getpwuid_r() exhibited strange (to me at least) behavior. Starting ncsd immediately let OpenOffice start.

In the process of testing this I whipped up this C program to test the getpwuid_r() function.

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <pwd.h>

int main(int argc, char *argv[]){
if(argc != 2){
exit(1);
}
uid_t me = atoi(argv[1]);
struct passwd pwbuf;
char buf[2048];
struct passwd *pwbufp;

int ret = getpwuid_r(me, &pwbuf, buf, 2048, &pwbufp);

if(ret == 0){
printf("OK %s\n", pwbuf.pw_name);
} else {
printf("Failed, returned %d\n", ret);
}

exit(0);
}

I observed that when the ncsd daemon not running getpwuid_r() would return info correctly for entries in /etc/passwd but not others. Any uid not in /etc/passwd would be returned as if it was the last entry in /etc/passwd. For example, the last entry on my workstation happens to be uid 26, user postgres. Any uid that I passed to the check program that did not exist in /etc/passwd was returned as postgres. Weird. I didn’t investigate any further once Google provided the ncsd hint.