2 #include <sys/socket.h>
3 #include <netinet/in.h>
7 #include <sys/select.h>
12 int main(int argc,char **argv,char **envp) {
22 printf("Usage: %s [name or id]\n\nAsks (a hopefully running) ptdbnssd for an AFSID or a PT-username, returns both.\n",argv[0]);
26 if ( ( arg[0] > '0' ) && ( arg[0] < '9' ) ) {
29 res=ptsid2name(uid,&buf,&buflen);
30 if ( res == NSS_STATUS_SUCCESS ) {
31 printf("uid=%i name=%s\n",uid,buffer);
32 //printf("homedir_method=%i, shell_method=%i\n",conf.homedirs_method,conf.shells_method);
35 if ( res == NSS_STATUS_NOTFOUND ) {
36 printf("W: AFSID %i not found.\n",uid);
39 if ( res == NSS_STATUS_UNAVAIL ) {
40 printf("E: Error talking to ptdbnssd.\n");
47 res=ptsname2id(arg,&uid);
48 if ( res == NSS_STATUS_SUCCESS ) {
49 printf("uid=%i name=%s\n",uid,arg);
50 //printf("homedir_method=%i, shell_method=%i\n",conf.homedirs_method,conf.shells_method);
53 if ( res == NSS_STATUS_NOTFOUND ) {
54 printf("W: PT-user '%s' not found.\n",buf);
57 if ( res == NSS_STATUS_UNAVAIL ) {
58 printf("E: Error talking to ptdbnssd.\n");