From owner-freebsd-gnome@FreeBSD.ORG Tue Jun 10 10:01:12 2003 Return-Path: Delivered-To: freebsd-gnome@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 489E837B405 for ; Tue, 10 Jun 2003 10:01:12 -0700 (PDT) Received: from shumai.marcuscom.com (rdu57-17-158.nc.rr.com [66.57.17.158]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA82443FA3 for ; Tue, 10 Jun 2003 10:01:10 -0700 (PDT) (envelope-from marcus@freebsd.org) Received: from shumai.marcuscom.com (localhost.marcuscom.com [127.0.0.1]) by shumai.marcuscom.com (8.12.9/8.12.9) with ESMTP id h5AH130u039775; Tue, 10 Jun 2003 13:01:03 -0400 (EDT) (envelope-from marcus@freebsd.org) Received: from localhost (marcus@localhost)h5AH13Pq039772; Tue, 10 Jun 2003 13:01:03 -0400 (EDT) X-Authentication-Warning: shumai.marcuscom.com: marcus owned process doing -bs Date: Tue, 10 Jun 2003 13:01:03 -0400 (EDT) From: Joe Marcus Clarke X-X-Sender: marcus@shumai.marcuscom.com To: Glenn Johnson In-Reply-To: <20030610152735.GA71845@node1.cluster.srrc.usda.gov> Message-ID: <20030610130030.S39727@shumai.marcuscom.com> References: <20030610152735.GA71845@node1.cluster.srrc.usda.gov> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: gnome@freebsd.org Subject: Re: reading passwd file with gdm X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2003 17:01:13 -0000 On Tue, 10 Jun 2003, Glenn Johnson wrote: > I am trying to parse the master.passwd file during gdm logins to see if > the passwd has reached its expiration time. The following command works > on the command line and in a simple sh script that I tested: > > CHANGE=`perl -e "print join(':', getpwnam ('$USER'));" | awk -F: '{print $5}'` > > However, it does not work when put into gdm/PreSession/Default. > > Here is my PreSession/Default file. I put in an echo command to see the > values. Does anything get written to the aging file? Joe > > --begin gdm/PreSession/Default-- > > #!/bin/sh > # > # Note that any setup should come before the sessreg command as > # that must be 'exec'ed for the pid to be correct (sessreg uses the parent > # pid) > # > # Note that output goes into the .xsession-errors file for easy debugging > # > PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin > xrdb /etc/X11/Xresources > xmessage -nearmouse -file /etc/motd -default okay > > if /usr/bin/which -s xsetroot > /dev/null 2>&1; then > xsetroot -cursor_name left_ptr -solid "#363047" > fi > > TIME=`date +%s` > CHANGE=`perl -e "print join(':', getpwnam ('$USER'));" | awk -F: '{print $5}'` > echo TIME is $TIME CHANGE is $CHANGE EXPIRED is $EXPIRED > ~/aging > if [ "$EXPIRED" = "yes" ]; then > xterm -e passwd > fi > > if /usr/bin/which -s sessreg > /dev/null 2>&1; then > # some output for easy debugging > echo "$0: Registering your session with wtmp and utmp" > echo "$0: running: sessreg -a -w /var/log/wtmp -u /var/run/utmp -x \"$X_SERVERS\" -h \"$REMOTE_HOST\" -l $DISPLAY $USER" > > exec sessreg -a -w /var/log/wtmp -u /var/run/utmp -x "$X_SERVERS" -h "$REMOTE_HOST" -l $DISPLAY $USER > # this is not reached > fi > > # some output for easy debugging > echo "$0: could not find the sessreg utility, cannot update wtmp and utmp" > exit 0 > > --end gdm/PreSession/Default-- > > Here are the contents of the ~/aging file: > > TIME is 1055258058 CHANGE is EXPIRED is > > Does any one have any idea why that perl command is not working when run > in the gdm PreSession/Default script? > > Thanks. > > -- > Glenn Johnson > USDA, ARS, SRRC Phone: (504) 286-4252 > New Orleans, LA 70124 e-mail: gjohnson@srrc.ars.usda.gov > _______________________________________________ > freebsd-gnome@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-gnome > To unsubscribe, send any mail to "freebsd-gnome-unsubscribe@freebsd.org" > > PGP Key : http://www.marcuscom.com/pgp.asc