TTAUTH(1)

NAME
ttauth - ToolTalk authority file utility

SYNOPSIS
ttauth [ -f authfile ] [ -vqib ] [ command arg ... ]

DESCRIPTION

The ttauth program is used to edit and display the authorization information used in connecting to ToolTalk. This program is usually used to extract authorization records from one machine and merge them in on another (as is the case when using remote logins or granting access to other users). Commands (described below) may be entered interactively, on the ttauth command line, or in scripts. Note that this program does not contact the ToolTalk server, ttsession. Normally ttauth is not used to create the authority file entry in the first place; ttsession does that.

OPTIONS
The following options may be used with ttauth. They may be given individually (e.g., -q -i) or may combined (e.g., -qi).

-f authfile
    This option specifies the name of the authority file to use. By default, ttauth will use the file specified by the TTAUTHORITY environment variable or .TTauthority in the user's home directory.

-q  This option indicates that ttauth should operate quietly and not print unsolicited status messages. This is the default if an ttauth command is is given on the command line or if the standard output is not directed to a terminal.

-v  This option indicates that ttauth should operate verbosely and print status messages indicating the results of various operations (e.g., how many records have been read in or written out). This is the default if ttauth is reading commands from its standard input and its standard output is directed to a terminal.

-i  This option indicates that ttauth should ignore any authority file locks. Normally, ttauth will refuse to read or edit any authority files that have been locked by other programs (usually ttsession or another ttauth).

-b  This option indicates that ttauth should attempt to break any authority file locks before proceeding. Use this option only to clean up stale locks.

COMMANDS
The following commands may be used to manipulate authority files:

add protoname protodata netid authname authdata
    An authorization entry for the indicated ToolTalk session using the given protocol name (protoname), protocol data (protodata), ToolTalk session id (netid), authentication name (authname), and authentication data (authdata) is added to the authorization file. The protocol name should always be the string TT. The protocol data should always be the empty string "". The ToolTalk session id is formatted string consisting of the ttsession program number, the ttsession authorization level, the IP address of the host running ttsession, and the RPC version number of the ttsession. See the section TTSESSION IDENTIFIERS below for information on constructing ToolTalk session id's for the authority file. The authentication name should always be the string MIT-MAGIC-COOKIE-1. The authentication data is specified as an even-lengthed string of hexadecimal digits, each pair representing one octet. The first digit of each pair gives the most significant 4 bits of the octet, and the second digit of the pair gives the least significant 4 bits. For example, a 32 character hexkey would represent a 128-bit value.

[n]extract filename <protoname=$> <protodata=$> <netid=$> <authname=$>
    Authorization entries which match the specified fields are written to the indicated file. If the nextract command is used, the entries are written in a numeric format suitable for non-binary transmission (such as secure electronic mail). The extracted entries can be read back in using the merge and nmerge commands. If the filename consists of just a single dash, the entries will be written to the standard output.

[n]list <protoname=$> <protodata=$> <netid=$> <authname=$>
    Authorization entries which match the specified fields (or all if nothing is specified) are printed on the standard output. If the nlist command is used, entries will be shown in the numeric format used by the nextract command; otherwise, they are shown in a textual format. Key data is always displayed in the hexadecimal format given in the description of the add command.

[n]merge [filename1 <filename2> <filename3>...]
    Authorization entries are read from the specified files and are merged into the authorization database, superceding any matching existing entries. If the nmerge command is used, the numeric format given in the description of the extract command is used. If a filename consists of just a single dash, the standard input will be read if it hasn't been read before.

remove <protoname=$> <protodata=$> <netid=$> <authname=$>
    Authorization entries which match the specified fields are removed from the authority file.

source filename
    The specified file is treated as a script containing ttauth commands to execute. Blank lines and lines beginning with a sharp sign (#) are ignored. A single dash may be used to indicate the standard input, if it hasn't already been read.

info
    Information describing the authorization file, whether or not any changes have been made, and from where ttauth commands are being read is printed on the standard output.

exit
    If any modifications have been made, the authority file is written out (if allowed), and the program exits. An end of file is treated as an implicit exit command.

quit
    The program exits, ignoring any modifications. This may also be accomplished by pressing the interrupt character.

help [string]
    A description of all commands that begin with the given string (or all commands if no string is given) is printed on the standard output.

?   A short list of the valid commands is printed on the standard output.

TTSESSION IDENTIFIERS
The ToolTalk session identifiers (netid) in the authority file and used by the add, [n]extract, [n]list, and remove commands are derived from the TT_SESSION identifier constructed by ttsession at startup. Ttsession rendezvous with clients by writing the TT_SESSION identifier as a property on the root window or as an environment variable in the client's environment (see ttsession -c). In addition, ttsession creates an entry in the user's authority file. The authority file entry has a netid component which is derived from the TT_SESSION identifier.

The TT_SESSION identifier is composed of the following elements:

    e.g.:  TT_SESSION(STRING) = "01 1433 1342177279 1 1 2002 130.105.9.22 4"
           <Dummy Number>                    = 01
           <ttsession Process Id>            = 1433
           <ttsession Program Number>        = 1342177279
           <DummyNumber>                     = 1
           <ttsession Authorization Level>   = 1
           <ttsession UID>                   = 2002
           <Host IP Address>                 = 130.105.9.22
           <RPC Version Number>              = 4

The ToolTalk session identifiers (netid) in the authority file are composed of the <ttsession Program Number>, <ttsession Authorization Level>, <Host IP Address>, and <RPC Version Number> fields of the TT_SESSION identifier as follows:

    e.g:  1342177279/1/130.105.9.22/4

EXAMPLE

The most common use for ttauth is to extract the entry for the current ttsession, copy it to another machine, and merge it into the user's authority file on the remote machine:

    %  xprop -root | grep TT_SESSION
    TT_SESSION(STRING) = "01 1433 1342177279 1 1 2002 130.105.9.22 4"
    _SUN_TT_SESSION(STRING) = "01 1433 1342177279 1 1 2002 130.105.9.22 4"
    %  ttauth extract - netid=1342177279/1/130.105.9.22/4 | rsh otherhost ttauth merge -

ENVIRONMENT
This ttauth program uses the following environment variables:

TTAUTHORITY
    to get the name of the authority file to use if the -f option isn't used.

HOME
    to get the user's home directory if TTAUTHORITY isn't defined.

FILES

$HOME/.TTauthority
    default authority file if TTAUTHORITY isn't defined.

BUGS

Users that have unsecure networks should take care to use encrypted file transfer mechanisms to copy authorization entries between machines. Similarly, the MIT-MAGIC-COOKIE-1 protocol is not very useful in unsecure environments. Sites that are interested in additional security may need to use encrypted authorization mechanisms such as Kerberos.

Spaces are currently not allowed in the protocol name. Quoting could be added for the truly perverse.

AUTHORS
Jim Fulton, MIT X Consortium, and Mitchell Greess, Solutions Atlantic