From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Binkley Robert - rbinkl Newsgroups: gmane.os.tru64.managers Subject: Password expire time script "tru64" Date: Tue, 27 May 2003 10:30:45 -0500 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: main.gmane.org 1054049365 27885 80.91.224.249 (27 May 2003 15:29:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 27 May 2003 15:29:25 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Tue May 27 17:29:22 2003 Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.22.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 19KgO0-0007Ey-00 for ; Tue, 27 May 2003 17:29:12 +0200 Original-Received: (qmail 20503 invoked by uid 5); 27 May 2003 15:31:10 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 20494 invoked by uid 49493); 27 May 2003 15:31:09 -0000 Original-Received: from Robert.Binkley@acxiom.com by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.54. spamassassin: 2.50-cvs. Clear:SA:0(-1.7/5.0):. Processed in 0.545038 secs); 27 May 2003 15:31:09 -0000 Original-Received: from unknown (HELO emroute2.cind.ornl.gov) (160.91.86.17) by 0 with SMTP; 27 May 2003 15:31:09 -0000 Original-Received: from emroute2.cind.ornl.gov (LOCALHOST [127.0.0.1]) by emroute2.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HFJ00IIQXRQEP@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Tue, 27 May 2003 11:31:08 -0400 (EDT) Original-Received: from aerynsun.acxiom.com (aerynsun.acxiom.com [198.160.100.121]) by emroute2.cind.ornl.gov (PMDF V6.2 #30669) with ESMTP id <0HFJ006KTXRM6I@emroute2.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Tue, 27 May 2003 11:31:00 -0400 (EDT) Original-Received: from conmsc01.conway.acxiom.com (unverified) by aerynsun.acxiom.com (Content Technologies SMTPRS 4.3.6) with ESMTP id ; Tue, 27 May 2003 10:30:45 -0500 Original-Received: by conmsc01.corp.acxiom.net with Internet Mail Service (5.5.2656.59) id ; Tue, 27 May 2003 10:30:44 -0500 Content-return: allowed Original-To: "Tru64 UNIX Admins \(E-mail\) \(E-mail\)" , "Tru64-Unix-Managers \(E-mail\)" X-Mailer: Internet Mail Service (5.5.2656.59) Xref: main.gmane.org gmane.os.tru64.managers:4343 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:4343 #!/usr/bin/perl $host=`hostname`; chomp($host); $cnt=0; $from="root\@$host.com"; $sendmailpath="/usr/sbin/sendmail"; $pwfile="/etc/passwd"; open (PASS,"<$pwfile") or die "File doesn't Exist"; while () { @userline = split (":",$_); chomp(@userline); $user = $userline[0]; chomp($user); open(GETAUTH,"/usr/tcb/bin/edauth -g $user|") || die "Error $!"; my $myString=""; while() { $myString .= $_; } close(GETAUTH); ($_ = $myString) =~ tr/:\\\n\t/:/sd; if(/u_succhg#\d*/) { $_ =~ m/u_succhg#(\d*)/; $last_change=$1; chomp($last_change); $def_exp = 7776000; # 90 Days $myexpiry = $last_change+$def_exp; $info_date = $myexpiry-172800; $exp_date=scalar localtime($myexpiry); $today=time; $reportdate=scalar localtime($today); $dtexp=$myexpiry-$today; #In Seconds print "$user => dtexp => $dtexp , myexpiry => $myexpiry\n"; if ($myexpiry != 7776000 and $dtexp < 172800) { $cnt++; if ($dtexp < 0) { $myverb = "Expires On"; } else { $myverb = "Will Expire On "; } $exp_list .= "==>> $user\'s Password $myverb on $exp_date\n"; } } } if ($cnt > 0) { # $to="root\@domain.com,root\@domain.com"; # Need to edit this line $subject=uc($host)." Password Expiry Report of $reportdate"; open (SENDMAIL, "| $sendmailpath -t"); print SENDMAIL "Subject: $subject\n"; print SENDMAIL "From: $from\n"; print SENDMAIL "To: $to\n\n"; print SENDMAIL "Password Expiration List, Check & Take action\n\n"; print SENDMAIL "$exp_list\n\n"; print SENDMAIL "Bye!\n\n"; print SENDMAIL "root"; close (SENDMAIL); } #####################################output################################# ### root => dtexp => 7078199 , myexpiry => 1061127491 wnn => dtexp => 7078193 , myexpiry => 1061127486 pop => dtexp => 7078193 , myexpiry => 1061127486 imap => dtexp => 7078193 , myexpiry => 1061127486 opensys => dtexp => 7078193 , myexpiry => 1061127486 oracle => dtexp => 7078193 , myexpiry => 1061127486 iass => dtexp => 7078193 , myexpiry => 1061127486 httpd => dtexp => 7078193 , myexpiry => 1061127486 jlemle => dtexp => 7078193 , myexpiry => 1061127486 cvs => dtexp => 7078192 , myexpiry => 1061127486 ********************************************************************** The information contained in this communication is confidential, is intended only for the use of the recipient named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please re-send this communication to the sender and delete the original message or any copy of it from your computer system. Thank You.