I have a build of PostgreSQL's Initdb utility that was compiled and linked on a remote build server running Fedora. On my system (Ubuntu 13.04 64-bit) when the utility is run using the command initdb -D /home/me/postgres_files/ -L /home/me/postgres_init_files/
the following is returned:
initdb: could not obtain information about current user: Success
This does not occur if I build the utility locally, only with a remote build from our build farm. I have so far managed to track the issue down to the following piece of code in initdb.c
:
pw = getpwuid(geteuid());
if (!pw)
{
fprintf(stderr,
_("%s: could not obtain information about current user: %s\n"),
progname, strerror(errno));
exit(1);
}
It would seem that either the call to geteuid() or getpwuid() is failing, but errno is not being set by the failing function. Unfortunately I can't easily go in and debug the utility directly as this only occurs on a remotely build version of the utility!
I would be greatly appreciative if anyone could shed some light on this.
Thanks.