Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Jeffrey Sturm — — source: Informix-list mailing list archive (1991-1998)
Scott Ellard (cse@wetware.com) wrote:
: In article <JDHICKS.94Sep8050114@netcom10.netcom.com> jdhicks@netcom10.netcom.com (JD Hicks) writes:
: >We are installing NIS on our Network. One of the problems that we have run
: >in to is that Informix Products seem to need a physical entry in the passwd
: >file. While UNIX is smart enough to use NIS at log in time, Informix apps
: >like dbaccess error out with a "-468 Cannot obtain user id from system: unable
: >to start database server." When I issue an id command it returns my User and
: >Group name and id's so I know that UNIX considers me a legitimate user. This
: >implies that Informix is trying to read the passwd and group files on its own.
: >Has any one else had problems with this? Is there a work around?
: I'm curious. What is the right way for Informix to do this?
: What are the appropriate API calls?
Calling getpwuid() returns the passwd struct for a given UID. It searches
/etc/passwd first, then uses NIS if available.
This code snippet will print your user name:
#include <stdio.h>
#include <pwd.h>
int main(void)
{
struct passwd *p;
if (p = getpwuid(getuid()))
printf("%s\\n", p->pw_name);
return 0;
}
--
Jeffrey Sturm
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.