#!/bin/sh
# This is a shell archive (shar 3.24)
# made 06/01/1992 03:22 UTC by stolcke@icsib30
# Source directory /tmp_mnt/n/icsia/export/src/local/X11R5/local/XDM
#
# existing files WILL be overwritten
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#   2204 -r--r--r-- README.sessreg
#  10856 -r--r--r-- sessreg.c
#   5140 -r--r--r-- sessreg.man
#
if touch 2>&1 | fgrep '[-amc]' > /dev/null
 then TOUCH=touch
 else TOUCH=true
fi
# ============= README.sessreg ==============
echo "x - extracting README.sessreg (Text)"
sed 's/^X//' << 'SHAR_EOF' > README.sessreg &&
X
XThis is a modified version of the sessreg program found in the
Xmit/clients/xdm directory of the X11R5 distribution.  It contains three
Xenhancements for improved user logging under BSD.
X
X1 - In addition to /etc/utmp and /usr/adm/wtmp, this version also updates
X    /usr/adm/lastlog.  Cf. the new -L option.
X
X2 - When using the -x option, sessreg dynamically allocates utmp entries
X    for displays/line names not found in the Xservers file.  This is
X    crucial for XDM setups where servers request XDM management on demand.
X
X3 - If the -h option is specified it is used to determine the display
X    name, rather than the -l option.  See below for a rationale.
X
XThis version also has a bug fixed that would cause the utmp offset
Xfor a tty slot to be off by one entry (thanks to Per Hedeland for
Xpointing this out).  In BSD, the offset 0 entry in /etc/utmp is always
Xunused because slot numbers start with 1.
X
XI don't like the suggestion given in the sessreg man page of
Xusing the display name as the argument to the -l option.  This causes
Xvarious programs that read /etc/utmp to choke as they try to
Xfind non-existent devices (e.g., /dev/:0).  Also, the resulting format
Xis not consistent with the utmp entries written by xterm.
X
XMy suggestion is to stick the display name in the hostname field of
Xutmp and use a dummy line name for all XDM logins.  Enhancement 2 above
Xwill dynamically allocate utmp entries for these.  For example, in
XXstartup use
X
X	sessreg -a -l null -h $DISPLAY -x /usr/lib/X11/xdm/Xservers $USER
X
Xand in Xreset,
X
X	sessreg -d -l null -h $DISPLAY -x /usr/lib/X11/xdm/Xservers $USER
X
XThe -l null option will cause /dev/null to act as a dummy device so
Xprograms like finger(1) and w(1) are kept happy.
XYou might replace "null" with something more descriptive like "XDM",
Xand make /dev/XDM a link to /dev/null.  This will produce sensible
Xfinger(1) output like
X
X	% finger
X	Login       Name              TTY Idle    When    Where
X	paterno  Fabio Paterno         XD 5:34 Sat 09:13  mocha:0             
X
Xand useful login records like
X
X	% last paterno
X	paterno   XDM      mocha:0          Sat May 30 09:13   still logged in
X
XComments welcome!
X
XA. Stolcke
Xstolcke@icsi.berkeley.edu
X5/31/92
SHAR_EOF
$TOUCH -am 0531201692 README.sessreg &&
chmod 0444 README.sessreg ||
echo "restore of README.sessreg failed"
set `wc -c README.sessreg`;Wc_c=$1
if test "$Wc_c" != "2204"; then
	echo original size 2204, current size $Wc_c
fi
# ============= sessreg.c ==============
echo "x - extracting sessreg.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > sessreg.c &&
X/*
X * $XConsortium: sessreg.c,v 1.8 91/07/18 22:00:12 rws Exp $
X *
X * Copyright 1990 Massachusetts Institute of Technology
X *
X * Permission to use, copy, modify, distribute, and sell this software and its
X * documentation for any purpose is hereby granted without fee, provided that
X * the above copyright notice appear in all copies and that both that
X * copyright notice and this permission notice appear in supporting
X * documentation, and that the name of M.I.T. not be used in advertising or
X * publicity pertaining to distribution of the software without specific,
X * written prior permission.  M.I.T. makes no representations about the
X * suitability of this software for any purpose.  It is provided "as is"
X * without express or implied warranty.
X *
X * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
X * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
X * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
X * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
X * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
X *
X * Author:  Keith Packard, MIT X Consortium
X */
X
X/*
X * sessreg
X *
X * simple wtmp/utmp frobber
X *
X * usage: sessreg [ -w <wtmp-file> ] [ -u <utmp-file> ]
X *		  [ -l <line> ]
X *		  [ -h <host-name> ]				/ BSD only
X *		  [ -s <slot-number> ] [ -x Xservers-file ]	/ BSD only
X *		  [ -t <ttys-file> ]				/ BSD only
X *	          [ -a ] [ -d ] user-name
X *
X * one of -a or -d must be specified
X */
X
X
X# include	<X11/Xos.h>
X# include	<X11/Xfuncs.h>
X# include	<stdio.h>
X# include	<utmp.h>
X
X#ifdef SYSV
X#define NO_LL
X#endif
X
X#ifndef NO_LL
X# include	<lastlog.h>
X# include	<pwd.h>
X#endif
X
X#ifdef SVR4
X#define SYSV			/* nice System V utmp interface still the same */
X#endif
X
X#ifndef WTMP_FILE
X# define WTMP_FILE	"/usr/adm/wtmp"
X#endif
X#ifndef UTMP_FILE
X# define UTMP_FILE	"/etc/utmp"
X#endif
X#ifndef NO_LL
X#ifndef LLOG_FILE
X# define LLOG_FILE	"/usr/adm/lastlog"
X#endif
X#endif
X#ifndef SYSV
X# ifndef SERVERS_FILE
X#  define SERVERS_FILE	"/usr/lib/X11/xdm/Xservers"
X# endif
X# ifndef TTYS_FILE
X#  define TTYS_FILE	"/etc/ttys"
X# endif
X#endif
X
X#ifdef X_NOT_STDC_ENV
Xextern long	time ();
X#endif
X#ifdef X_NOT_POSIX
Xextern long	lseek ();
Xextern char	*ttyname ();
X#endif
X
Xint	wflag, uflag, lflag;
Xchar	*wtmp_file, *utmp_file, *line;
Xint	utmp_none, wtmp_none;
X/*
X * BSD specific variables.  To make life much easier for Xstartup/Xreset
X * maintainers, these arguments are accepted but ignored for sysV
X */
Xint	hflag, sflag, xflag, tflag;
Xchar	*host_name;
Xint	slot_number;
Xchar	*xservers_file, *ttys_file;
Xchar	*user_name;
Xint	aflag, dflag;
X#ifndef NO_LL
Xchar	*llog_file;
Xint	llog_none, Lflag;
X#endif
X
Xchar	*program_name;
X
Xusage (x)
X{
X	if (x) {
X		fprintf (stderr, "%s: usage %s {-a -d} [-w wtmp-file] [-u utmp-file] [-L lastlog-file]\n", program_name, program_name);
X		fprintf (stderr, "             [-t ttys-file] [-l line-name] [-h host-name]\n");
X		fprintf (stderr, "             [-s slot-number] [-x servers-file] user-name\n");
X		exit (1);
X	}
X	return x;
X}
X
Xchar *
Xgetstring (avp, flagp)
Xchar	***avp;
Xint	*flagp;
X{
X	char	**a = *avp;
X
X	usage ((*flagp)++);
X	if (*++*a)
X		return *a;
X	++a;
X	usage (!*a);
X	*avp = a;
X	return *a;
X}
X
Xsyserr (x, s)
Xint	x;
Xchar	*s;
X{
X	if (x == -1) {
X		perror (s);
X		exit (1);
X	}
X	return x;
X}
X
Xsysnerr (x, s)
Xint	x;
Xchar	*s;
X{
X	if (x == 0) {
X		perror (s);
X		exit (1);
X	}
X	return x;
X}
X
Xmain (argc, argv)
Xint	argc;
Xchar	**argv;
X{
X#ifndef SYSV
X	int		utmp;
X#endif
X	char		*line_tmp;
X	int		wtmp;
X	long		current_time;
X	struct utmp	utmp_entry;
X
X	program_name = argv[0];
X	while (*++argv && **argv == '-') {
X		switch (*++*argv) {
X		case 'w':
X			wtmp_file = getstring (&argv, &wflag);
X			if (!strcmp (wtmp_file, "none"))
X				wtmp_none = 1;
X			break;
X		case 'u':
X			utmp_file = getstring (&argv, &uflag);
X			if (!strcmp (utmp_file, "none"))
X				utmp_none = 1;
X			break;
X		case 'L':
X			llog_file = getstring (&argv, &Lflag);
X			if (!strcmp (llog_file, "none"))
X				llog_none = 1;
X			break;
X		case 't':
X			ttys_file = getstring (&argv, &tflag);
X			break;
X		case 'l':
X			line = getstring (&argv, &lflag);
X			break;
X		case 'h':
X			host_name = getstring (&argv, &hflag);
X			break;
X		case 's':
X			slot_number = atoi (getstring (&argv, &sflag));
X			break;
X		case 'x':
X			xservers_file = getstring (&argv, &xflag);
X			break;
X		case 'a':
X			aflag++;
X			break;
X		case 'd':
X			dflag++;
X			break;
X		default:
X			usage (1);
X		}
X	}
X	usage (!(user_name = *argv++));
X	usage (*argv != 0);
X	/*
X	 * complain if neither aflag nor dflag are set,
X	 * or if both are set.
X	 */
X	usage (!(aflag ^ dflag));
X	usage (xflag && !lflag);
X	/* set up default file names */
X	if (!wflag)
X		wtmp_file = WTMP_FILE;
X	if (!uflag)
X		utmp_file = UTMP_FILE;
X#ifndef NO_LL
X	if (!Lflag)
X		llog_file = LLOG_FILE;
X#endif
X#ifndef SYSV
X	if (!tflag)
X		ttys_file = TTYS_FILE;
X	if (!sflag && !utmp_none) {
X		if (xflag)
X			sysnerr (slot_number = Xslot (ttys_file, xservers_file, line, host_name, aflag), "Xslot");
X		else
X			sysnerr (slot_number = ttyslot (), "ttyslot");
X	}
X#endif
X	if (!lflag) {
X		sysnerr ((int) (line_tmp = ttyname (0)), "ttyname");
X		line = rindex (line_tmp, '/');
X		if (line)
X			line = line + 1;
X		else
X			line = line_tmp;
X	}
X	current_time = time ((long *) 0);
X	set_utmp (&utmp_entry, line, user_name, host_name, current_time, aflag);
X	if (!utmp_none) {
X#ifdef SYSV
X		utmpname (utmp_file);
X		setutent ();
X		(void) getutid (&utmp_entry);
X		pututline (&utmp_entry);
X		endutent ();
X#else
X		utmp = open (utmp_file, O_RDWR);
X		if (utmp != -1) {
X			syserr ((int) lseek (utmp, (long) slot_number * sizeof (struct utmp), 0), "lseek");
X			sysnerr (write (utmp, (char *) &utmp_entry, sizeof (utmp_entry))
X				        == sizeof (utmp_entry), "write utmp entry");
X			close (utmp);
X		}
X#endif
X	}
X	if (!wtmp_none) {
X		wtmp = open (wtmp_file, O_WRONLY|O_APPEND);
X		if (wtmp != -1) {
X			sysnerr (write (wtmp, (char *) &utmp_entry, sizeof (utmp_entry))
X				        == sizeof (utmp_entry), "write wtmp entry");
X			close (wtmp);
X		}
X	}
X#ifndef NO_LL
X	if (aflag && !llog_none) {
X		int llog = open (llog_file, O_WRONLY);
X		if (llog != -1) {
X			int	user_id;
X			struct passwd *pwd = getpwnam(user_name);
X			struct lastlog ll;
X
X			sysnerr( pwd != NULL, "get user id");
X
X			bzero((char *)&ll, sizeof(ll));
X			ll.ll_time = current_time;
X			if (line)
X			 (void) strncpy (ll.ll_line, line, sizeof (ll.ll_line));
X			if (host_name)
X			 (void) strncpy (ll.ll_host, host_name, sizeof (ll.ll_host));
X
X			sysnerr (lseek(llog, (long) pwd->pw_uid*sizeof(ll), 0) != -1, "seeking lastlog entry");
X			sysnerr (write (llog, (char *) &ll, sizeof (ll))
X				        == sizeof (ll), "write lastlog entry");
X			close (llog);
X		}
X	}
X#endif
X	return 0;
X}
X
X/*
X * fill in the appropriate records of the utmp entry
X */
X
Xset_utmp (u, line, user, host, date, addp)
Xstruct utmp	*u;
Xchar		*line, *user, *host;
Xlong		date;
X{
X	if (line)
X		(void) strncpy (u->ut_line, line, sizeof (u->ut_line));
X	else
X		bzero (u->ut_line, sizeof (u->ut_line));
X	if (addp && user)
X		(void) strncpy (u->ut_name, user, sizeof (u->ut_name));
X	else
X		bzero (u->ut_name, sizeof (u->ut_name));
X#ifdef SYSV
X	if (line) {
X		int	i;
X		/*
X		 * this is a bit crufty, but
X		 * follows the apparent conventions in
X		 * the ttys file.  ut_id is only 4 bytes
X		 * long, and the last 4 bytes of the line
X		 * name are written into it, left justified.
X		 */
X		i = strlen (line);
X		if (i >= sizeof (u->ut_id))
X			i -= sizeof (u->ut_id);
X		else
X			i = 0;
X		(void) strncpy (u->ut_id, line + i, sizeof (u->ut_id));
X	} else
X		bzero (u->ut_id, sizeof (u->ut_id));
X	if (addp) {
X		u->ut_pid = getppid ();
X		u->ut_type = USER_PROCESS;
X	} else {
X		u->ut_pid = 0;
X		u->ut_type = DEAD_PROCESS;
X	}
X#else
X	if (addp && host)
X		(void) strncpy (u->ut_host, host, sizeof (u->ut_host));
X	else
X		bzero (u->ut_host, sizeof (u->ut_host));
X#endif
X	u->ut_time = date;
X}
X
X#ifndef SYSV
X/*
X * compute the slot-number for an X display.  This is computed
X * by counting the lines in /etc/ttys and adding the line-number
X * that the display appears on in Xservers.  This is a poor
X * design, but is limited by the non-existant interface to utmp.
X * If host_name is non-NULL, assume it contains the display name,
X * otherwise use the display_name argument (i.e., the tty name).
X */
X
XXslot (ttys_file, servers_file, display_name, host_name, addp)
Xchar	*ttys_file;
Xchar	*servers_file;
Xchar	*display_name;
Xchar	*host_name;
Xint	addp;
X{
X	FILE	*ttys, *servers;
X	int	c;
X	int	slot = 1;
X	int	column0 = 1;
X	char	servers_line[1024];
X	char	disp_name[512];
X	int	len;
X	char	*pos;
X
X	/* remove screen number from the display name */
X	strcpy(disp_name, host_name ? host_name : display_name);
X	pos = rindex(disp_name, ':');
X	if (pos) {
X	    pos = index(pos, '.');
X	    if (pos)
X		*pos = '\0';
X	}
X	sysnerr (ttys = fopen (ttys_file, "r"), ttys_file);
X	while ((c = getc (ttys)) != EOF)
X		if (c == '\n') {
X			++slot;
X			column0 = 1;
X		} else
X			column0 = 0;
X	if (!column0)
X		++slot;
X	(void) fclose (ttys);
X	sysnerr (servers = fopen (servers_file, "r"), servers_file);
X
X	len = strlen (disp_name);
X	column0 = 1;
X	while (fgets (servers_line, sizeof (servers_line), servers)) {
X		if (column0 && *servers_line != '#') {
X			if (!strncmp (disp_name, servers_line, len) &&
X			    (servers_line[len] == ' ' ||
X			     servers_line[len] == '\t'))
X				return slot;
X			++slot;
X		}
X		if (servers_line[strlen(servers_line)-1] != '\n')
X			column0 = 0;
X		else
X			column0 = 1;
X	}
X	/*
X	 * display not found in Xservers file - allocate utmp entry dinamically
X	 */
X	return findslot (display_name, host_name, addp, slot);
X}
X
X/*
X * find a free utmp slot for the X display.  This allocates a new entry
X * past the regular tty entries if necessary, reusing existing entries
X * (identified by (line,hostname)) if possible.
X */
Xfindslot (line_name, host_name, addp, slot)
Xchar	*line_name;
Xchar	*host_name;
Xint	addp;
Xint	slot;
X{
X	int	utmp;
X	struct	utmp entry;
X	int	found = 0;
X	int	freeslot = -1;
X
X	syserr(utmp = open (utmp_file, O_RDONLY), "open utmp");
X
X	/*
X	 * first, try to locate a previous entry for this display
X	 * also record location of a free slots in case we need a new one
X	 */
X	syserr ((int) lseek (utmp, (long) slot * sizeof (struct utmp), 0), "lseek");
X
X	if (!host_name)
X		host_name = "";
X
X	while (read (utmp, (char *) &entry, sizeof (entry)) == sizeof (entry)) {
X		if (strncmp(entry.ut_line, line_name,
X			sizeof(entry.ut_line)) == 0 &&
X		    strncmp(entry.ut_host, host_name,
X			sizeof(entry.ut_host)) == 0) {
X			found = 1;
X			break;
X		}
X		if (freeslot < 0 && *entry.ut_name == '\0')
X			freeslot = slot;
X		++slot;
X	}
X
X	close (utmp);
X
X	if (found)
X		return slot;
X	else if (!addp)
X		return 0;	/* trying to delete a non-existing entry */
X	else if (freeslot < 0)
X		return slot;	/* first slot past current entries */
X	else
X		return freeslot;
X}
X#endif
SHAR_EOF
$TOUCH -am 0531200792 sessreg.c &&
chmod 0444 sessreg.c ||
echo "restore of sessreg.c failed"
set `wc -c sessreg.c`;Wc_c=$1
if test "$Wc_c" != "10856"; then
	echo original size 10856, current size $Wc_c
fi
# ============= sessreg.man ==============
echo "x - extracting sessreg.man (Text)"
sed 's/^X//' << 'SHAR_EOF' > sessreg.man &&
X.TH SESSREG 1 "Release 5" "X Version 11"
X.SH NAME
Xsessreg \- manage utmp/wtmp entries for non-init clients
X.SH SYNOPSIS
X.B sessreg
X[-w \fIwtmp-file\fP]
X[-u \fIutmp-file\fP]
X[-L \fIlastlog-file\fP]
X[-l \fIline-name\fP]
X[-h \fIhost-name\fP]
X[-s \fIslot-number\fP]
X[-x \fIXservers-file\fP]
X[-t \fIttys-file\fP]
X[-a]
X[-d]
X\fIuser-name\fP
X.SH DESCRIPTION
X.PP
X\fISessreg\fP is a simple program for managing utmp/wtmp and lastlog
Xentries for xdm sessions.
X.PP
XSystem V has a better interface to /etc/utmp than BSD; it
Xdynamically allocates entries in the file, instead of writing them at fixed
Xpositions indexed by position in /etc/ttys.
X.PP
XTo manage BSD-style utmp files, \fIsessreg\fP has two strategies.  In
Xconjunction with xdm, the -x option counts the number of lines in /etc/ttys
Xand then adds to that the number of the line in the Xservers file which
Xspecifies the display.  The display name must be specified as the
X"host-name" using the -h option, or if not present, as the
X"line-name" using the -l option.  This sum is used as the "slot-number" in
X/etc/utmp that this entry will be written at.  In the more general case, the
X-s option specifies the slot-number directly.  If for some strange reason
Xyour system uses a file other that /etc/ttys to manage init, the -t option
Xcan direct
X\fIsessreg\fP to look elsewhere for a count of terminal sessions.
X.PP
XAdditionally, on BSD systems, the lastlog file (used, e.g., by
X.IR finger (1)
Xto look up last login times) is updated.
X.PP
XConversely, System V managers will not ever need to use these options (-x,
X-s and -t).  To make the program easier to document and explain,
X\fIsessreg\fP accepts the BSD-specific flags in the System V
Xenvironment and ignores them.
X.PP
XBSD also has a host-name field in the utmp file which doesn't exist in
XSystem V.  This option is also ignored by the System V version of
X\fIsessreg\fP.
X.SH USAGE
X.PP
XIn Xstartup, place a call like:
X.nf
X
X       sessreg -a -l $DISPLAY -x /usr/lib/X11/xdm/Xservers $USER
X
X.fi
Xand in Xreset:
X.nf
X
X       sessreg -d -l $DISPLAY -x /usr/lib/X11/xdm/Xservers $USER
X
X.fi
XOn BSD systems it is probably more appropriate to place the $DISPLAY
Xvalue in the host name field (-h option).  The line name can
Xthen be assigned a mnemonic value, like "XDM".
XThis creates utmp entries that look similar to those created by
X.IR xterm (1).
X.SH OPTIONS
X.IP "\fB-w\fP \fIwtmp-file\fP"
XThis specifies an alternate wtmp file, instead of /usr/adm/wtmp for BSD or
X/etc/wtmp for sysV.  The special name "none" disables writing records to
X/usr/adm/wtmp.
X.IP "\fB-u\fP \fIutmp-file\fP"
XThis specifies an alternate utmp file, instead of "/etc/utmp".  The special
Xname "none" disables writing records to /etc/utmp.
X.IP "\fB-L\fP \fIlastlog-file\fP"
XThis specifies an alternate lastlog file, instead of "/usr/adm/lastlog".
XThe special name "none" disables writing records to /usr/adm/lastlog.
XLastlog is updated only if the
X.B -a
Xflag has been specified.
X.IP "\fB-l\fP \fIline-name\fP"
XThis describes the "line" name of the entry.  For terminal sessions,
Xthis is the final pathname segment of the terminal device filename
X(e.g. ttyd0).  For X sessions, it should probably be the local display name
Xgiven to the users session (e.g. :0).  If none is specified, the
Xterminal name will be determined with ttyname(3) and stripped of leading
Xcomponents.
X.IP "\fB-h\fP \fIhost-name\fP"
XThis is set for BSD hosts to indicate that the session was initiated from
Xa remote host.  For compatibility with
X.I xterm (1)
Xthis field may also be used to store the display name.
X.IP "\fB-s\fP \fIslot-number\fP"
XEach potential session has a unique slot number in BSD systems, most are
Xidentified by the position of the \fIhost-name\fP or \fIline-name\fP
Xin the /etc/ttys file.
XThis option overrides the default position determined with ttyslot(3).
XThis option is inappropriate for use with xdm, the -x option is more useful.
X.IP "\fB-x\fP \fIXservers-file\fP"
XAs X sessions are one-per-display, and each display is entered in this file,
Xthis options sets the \fIslot-number\fP to be the number of lines in
Xthe \fIttys-file\fP plus the index into this file that the \fIhost-name\fP
X(if given) or \fIline-name\fP is found.
X.br
XIf no matching server entry is found, an attempt is made to dynamically
Xallocate a free slot at the end of the utmp file.
XThis is useful where there is no fixed
Xlist of X servers (e.g., server request XDM management on demand).
XThe pair of strings \fIline-name\fP and \fIhost-name\fP is used
Xto identify an entry for purposes of deletion and reuse.
X.IP "\fB-t\fP \fIttys-file\fP"
XThis specifies an alternate file which the \fI-x\fP option will use to count
Xthe number of terminal sessions on a host.
X.IP "\fB-a\fP"
XThis session should be added to utmp/wtmp.
X.IP "\fB-d\fP"
XThis session should be deleted from utmp/wtmp.  One of -a/-d must
Xbe specified.
X.SH "SEE ALSO"
Xxdm(1), utmp(5)
X.SH COPYRIGHT
XCopyright 1988, Massachusetts Institute of Technology.
X.br
XSee \fIX(1)\fP for a full statement of rights and permissions.
X.SH AUTHOR
XKeith Packard, MIT X Consortium
X.br
XLastlog support and dynamic utmp entry allocation added by Andreas Stolcke, ICSI.
SHAR_EOF
$TOUCH -am 0530160992 sessreg.man &&
chmod 0444 sessreg.man ||
echo "restore of sessreg.man failed"
set `wc -c sessreg.man`;Wc_c=$1
if test "$Wc_c" != "5140"; then
	echo original size 5140, current size $Wc_c
fi
exit 0
