SourceFiles.org - Use the Source, Luke
Home | Register | News | Forums | Guide | MyLinks | Bookmark

Related Sites

Latest News
  General News
  Reviews
  Press Releases
  Software
  Hardware
  Security
  Tutorials
  Off Topic


Back to files

<title>XDM-External Greeter</title>
<h1>XDM-External Greeter</h1>

<h3>What is it?</h3>
<p>
XDM-External Greeter is a patch to XDM that allows it to call an external program that prompts the user for their username and password. This external program communicates the username and password back to XDM, using a protocol defined below.
<p>
This distribution also includes <a href=gtkgreet/README.html>Gtkgreet</a>, a program that implements this interface. <p>
<h3>Version</h3>
This is version 1.00 of XDM-External Greeter <p>
<h3>Compiliation</h3>
<p>
Since XDM-External Greeter is a patch to the original XDM source code, you'll need a copy of that source code to compile it. You can always grab this from the X distribution. however, For your convenience, however, links to the base XDM have been provided on the XDM-External Greeter web site at <a href="http://tr.ml.org/~tom/software/xdm/">http://tr.ml.org/~tom/software/xdm/</a>;. <p>
Once you have the XDM source code, you'll need to place it underneath this directory. All of the XDM code should be in the directory xdm. Assuming took one of the distributions of XDM from the web site, you can simply do: <pre>

$ tar -xvzf xdm.tar.gz
</pre>
If the file xdm/Imakefile exists, you're probably in pretty good shape. <p>
You can now run 'make' . This will patch the xdm source code, build XDM-External Greeter, and build Gtkgreet. Assuming that both XDM and Gtkgreet have built without any problems, you can go ahead and switch to root and run 'make install'. <pre>

$ make
</pre>
<p>
With any luck, you'll have a sucessfully compiled XDM-External Greeter. Should you not have GTK installed, you can do a 'make xdm' to make only xdm. However, you will need to point XDM-EG at a different external program. <p>
<h2>Installation</h2>
To install the software, change to root and run the command <p>
<pre>

# make install
</pre>
This will install the xdm binary as <i>XROOT</i>/bin/xdm, supporting files in <i>XROOT</i>/lib/X11/xdm, and Gtkgreet as /usr/local/bin/gtkgreet. <i>XROOT</i> is system dependant, although on Linux it's usually /usr/X11R6. <p>
If you already have configuration files for XDM, this process will not overwrite them. As a result, you'll have to go in and edit the config file by hand. The config file is located at <i>XROOT</i>/lib/X11/xdm/xdm-config. <p>
You need to make sure the following line exists: <p>
<pre>

DisplayManager.egp:/usr/local/bin/gtkgreet </pre>
This points to the location of the program that will be used to prompt the user for their name and password. (Make sure this program exists... Bad Things will happen if it doesn't.)
<p>
After this, configure xdm as appropriate for your system. <p>
<h3>Running</h3>
Assuming the configuration is correct, you should be able to run XDM normally. <p>
<h3>Known Bugs/Todo</h3>
<p>
As of this version, no pinging of remote X servers occurs. <p>

<h3>Protocol</h3>
The programs used to prompt the user for a username and password are called an open file descriptor 3, upon which they must speak a simple protocol. <p>
Data types used are:

<dl>
<dt><kbd>UC</kbd></dt>
<dd>A UC is an unsigned char. It can contain a value between 0 and 255.</dd> <dt><kbd>String</kbd></dt>
<dd>A String consists of a UC denoting a length, followed by that many bytes of data.

The length does not count the UC containing the length. The strings should not be assumed to be null-terminated. </dd> </dl>

The protocol consists of one or more cycles, where each cycle consists of a login attempt. After enough data has been gathered to attempt a login, the prompting program should write the following information out to file descriptor 3. (Remember to disable buffering!)

<pre>

       String:  username                    Required
       String:  password                    Required
       UC:      extension designator        Optional
       ????:    extension data                 "
       UC:      extension designator           "   
       ????:    extension data                 "
                .                              "
                .                              "
                .                              "
       UC:      0                           Required

</pre>
<p>
After sending this information, the program should wait for one of two signals. If it receives SIGTERM, the program should indicate success and terminate. If it receives SIGUSR1, the login failed, and the program should proceed on fo another cycle.
<p>
As of right now, there's only one extension. <p>
<pre>

Extension Designator: 01
Extension Data: String

This extension allows the specification of additional parameters to the command line of Xsession. For example, one can use this to specify "failsafe", which will usually cause Xsession to start only a minimal session.
</pre>
<h3>License</h3>
<p>
New code developed for this project is distributed under the <a href=COPYING>Gnu Public License</a>. <h3>Contact Information</h3>
<p>
The author of these patches is Tom Rothamel &lt;tom-xdm@tr.ml.org&gt;. <p>
There's also an XDM-External Greet web site, located at <a href="http://tr.ml.org/~tom/software/xdm/">http://tr.ml.org/~tom/software/xdm/</a>;. On it, you'll be able to find the latest version, as well as the XDM sources and user contributed greeter programs. <p>
In a related note, don't hesitate to send your own greeter modules to the address specified above.
<p>
<h3>Thanks</h3>
First, I'd like to thank all of those who worked on the original XDM code, without which there'd be nothing for me to patch. I'd also like to thank Brad Keryan for reviewing this code.


Other Sites

Discussion Groups
  Beginners
  Distributions
  Networking / Security
  Software
  PDAs

About | FAQ | Privacy | Awards | Contact
Comments to the webmaster are welcome.
Copyright 2006 Sourcefiles.org All rights reserved.