---
name: "identuser"
section: "3"
platform: "linux"
package: "zmailer"
version: "2.99.51.52pre3-2"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/identuser"
---

# identuser(3)

remote identification library using the Identification Server

## NAME

identuser - remote identification library using the Identification Server

## SYNTAX

**#include \<identuser.h\>**

unsigned short **ident\_tcpport**;

char \***ident\_xline(***user,fd,&inremote***)**;

int **ident\_fd(***fd,&inremote,&local,&remote***)**;\
 int **ident\_fd2(***fd,&inlocal,&inremote,&local,&remote***)**;

int **ident\_tcpsock(***fd,inlocal,inremote***)**;

char \***ident\_tcpuser(***inremote,local,remote***)**;\
 char \***ident\_tcpuser2(***inlocal,inremote,local,remote***)**;\
 char \***ident\_tcpuser3(***inlocal,inremote,local,remote,timeout***)**;

char \***ident\_sockuser(***s,local,remote***)**;

char \**user*;\
 int *fd*;\
 int *s*;\
 unsigned long *inlocal*;\
 unsigned long *inremote*;\
 unsigned short *local*;\
 unsigned short *remote*;\
 int *timeout*;

## DESCRIPTION

The **identuser** library provides a simple interface for finding out the remote identity of a connection through the Identification Server as specified by RFC 931/1413. Use the -lidentuser loader option to compile a program with this library.

**ident\_xline(*user,fd,&inremote*)** returns a line of the form X-Ident-User: user or X-Forgery-By: username, depending upon what the host on the other side of *fd* thinks of the user. This is particularly appropriate for mail and news headers.

If the remote host reports that *user* owns the connection on that side, **ident\_xline** will return X-Ident-User: user. If the remote host reports that a different username owns the connection, **ident\_xline** will return X-Forgery-By: username. If user is NULL, it returns X-Ident-User: username with the username reported by the remote host. If  *fd* is not a TCP connection or identification is impossible, **ident\_xline** returns NULL, setting errno appropriately.

The line is not cr-lf terminated. It is stored in a static area which is overwritten on each call to **ident\_xline.** **ident\_xline** places the Internet address of the other host into *inremote.*

**ident\_fd2(*fd,&inlocal,&inremote,&local,&remote*)** retrieves address information from the connection in socket *fd.* It places the Internet addresses of the connection into *inlocal* and *inremote* and the local and remote TCP ports into  *local* and  *remote.* **ident\_fd2** returns -1 upon error, setting errno appropriately.

**ident\_tcpuser2(*inlocal,inremote,local,remote*)** returns the name of the user on the other end of the TCP connection between *remote@inremote* and *local@inlocal.* If identification is impossible, **ident\_tcpuser2** returns NULL, setting errno appropriately. The user name is stored in a static area which is overwritten on each call to **ident\_tcpuser2,** **ident\_tcpuser,** **ident\_sockuser,** and **ident\_xline.**

***s* = ident\_tcpsock(*fd,inlocal,inremote*)** sets *s* to a non-blocking socket which is connecting to the Identification Server at *inremote.* It returns -1 on error, setting errno appropriately. **ident\_sockuser(*s,local,remote*)** makes sure that the socket has connected and then does the same job as **ident\_tcpuser2,** returning the name of the user on the other end of the TCP connection between *remote@inremote* and *local@inlocal,* or NULL (with errno set) if identification is not possible. *s* is closed by **ident\_sockuser.** The advantage of using **ident\_tcpsock** and **ident\_sockuser** instead of **ident\_tcpuser2** is that you can perform other actions while waiting for the identification request to complete. You can select *s* for writing to see if it is ready for **ident\_sockuser** yet.

**ident\_tcpuser3(*inlocal,inremote,local,remote,timeout*)** is like **ident\_tcpuser2** but returns NULL with errno set to ETIMEDOUT if the identification request has not been accepted or refused after *timeout* seconds.

**ident\_fd(*fd,&inremote,&local,&remote*)** is the same as **ident\_fd2** but throws away the *inlocal* information. **ident\_tcpuser(*inremote,local,remote*)** is the same as **ident\_tcpuser2** but may not bind to the proper local address on hosts with multiple IP addresses. These functions do not perform properly on multihomed hosts and should not be used. They are provided only for backwards compatibility.

The identification routines check with the remote Identification Server on port **ident\_tcpport,** which defaults to 113 as specified by RFC 931/1413. You can set **ident\_tcpport** to other values for nonstandard implementations.

## RESTRICTIONS

**identuser** does no backslash interpretation upon the remote user name. This is conformance with the proposed revision to RFC 931/1413.

**identuser** does not use the operating system type information provided by the Identification Server.

## VERSION

identuser version 4.0, February 9, 1992.

## AUTHOR

Placed into the public domain by Daniel J. Bernstein.

## REFERENCES

The identification server is more secure than passwords in some ways, but less secure than passwords in many ways. (It's certainly better than no password at all---e.g., for mail or news.) It is not the final solution. For an excellent discussion of security problems within the TCP/IP protocol suite, see Steve Bellovin's article \`\`Security Problems in the TCP/IP Protocol Suite.''

## SEE ALSO

[tcpclient(1)](/tcpclient/1.md), [tcpserver(1)](/tcpserver/1.md), getpeername(3), getsockname(3), [tcp(4)](/tcp/4.md), [identd(8)](/identd/8.md)
