<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PKI authentication script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131465#M688445</link>
    <description>James that one right there did it! James I bow to the Gods, Sir! You are the man. Thanks a million times over.</description>
    <pubDate>Thu, 25 Sep 2008 17:03:43 GMT</pubDate>
    <dc:creator>Adam W.</dc:creator>
    <dc:date>2008-09-25T17:03:43Z</dc:date>
    <item>
      <title>PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131445#M688425</link>
      <description>ANYONE!!!!,&lt;BR /&gt;    I need some major help. I use HP-UX 11.11 and I somehow need to come up with a script that can search and destroy authentication certs per user, in several directories, to be used when a user leaves. My issue is basically I walked into a mess here at my new job. We use PKI and when someone leaves, I need something that will search the entire server for their PKI certification file and remove it. PLEASE HELP!!!!!!!!!</description>
      <pubDate>Tue, 23 Sep 2008 19:00:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131445#M688425</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2008-09-23T19:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131446#M688426</link>
      <description>Hi Adam:&lt;BR /&gt;&lt;BR /&gt;In general:&lt;BR /&gt;&lt;BR /&gt;# find /path -xdev -type f -name "cert*" -exec rm -i {} +&lt;BR /&gt;&lt;BR /&gt;...would search "/path" [and you could specify multiple directories here]; looking for files ('-f') whose basename matches the string "cert" followed by anything; and then removes the matching file.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 23 Sep 2008 19:13:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131446#M688426</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-23T19:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131447#M688427</link>
      <description>James thanks for the reply. The issue is that when a user moves their certs to say, a generic account, they often change the name of the cert. So how would I go about using the above mentioned command but searching for a particular sting inside of the file? Does that make sense?</description>
      <pubDate>Wed, 24 Sep 2008 11:07:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131447#M688427</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2008-09-24T11:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131448#M688428</link>
      <description>You can search for all cert files: *.key, *.pem ... and after that do a strings on this files to find the proper cert file.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;ivan</description>
      <pubDate>Wed, 24 Sep 2008 11:17:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131448#M688428</guid>
      <dc:creator>Ivan Krastev</dc:creator>
      <dc:date>2008-09-24T11:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131449#M688429</link>
      <description>&lt;!--!*#--&gt;Hi (again) Adam:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; So how would I go about using the above mentioned command but searching for a particular sting inside of the file?&lt;BR /&gt;&lt;BR /&gt;If you want to use a pure shell script, something like this will work:&lt;BR /&gt;&lt;BR /&gt;# cat .findit&lt;BR /&gt;#/usr/bin/sh&lt;BR /&gt;typeset DIR=$1&lt;BR /&gt;typeset PAT=$2&lt;BR /&gt;find ${DIR} -xdev -type f | while read FILE&lt;BR /&gt;do&lt;BR /&gt;    [ $(file ${FILE} | grep -c ascii) -eq 0 ] &amp;amp;&amp;amp; continue&lt;BR /&gt;    grep "${PAT}" ${FILE} /dev/null&lt;BR /&gt;done&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./findit /path string_to_match&lt;BR /&gt;&lt;BR /&gt;This will report the names of files with the lines where the pattern matches.  You can easily admend this to remove files.&lt;BR /&gt;&lt;BR /&gt;The same thing can be done using Perl:&lt;BR /&gt;&lt;BR /&gt;# perl -MFile::Find -e 'find(sub{push @f,$File::Find::name if -f $_ &amp;amp;&amp;amp; -T _},".");@a=`grep -i $ARGV[0] @f`;print for sort @a' string_to_match&lt;BR /&gt;&lt;BR /&gt;Either script confines itself to "test" (not binary) files.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 24 Sep 2008 11:50:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131449#M688429</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-24T11:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131450#M688430</link>
      <description>James,&lt;BR /&gt;   Let me apologize for bothering you (again) I have never learned about scripting in any way. But I am a bit confused by you shell script entry. Would I simply paste what you wrote into a file? Also, on how to run it where you wrote "path" would I put like /home?</description>
      <pubDate>Wed, 24 Sep 2008 12:25:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131450#M688430</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2008-09-24T12:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131451#M688431</link>
      <description>Hi (again) Adam:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Let me apologize for bothering you (again) I have never learned about scripting in any way. But I am a bit confused by you shell script entry. Would I simply paste what you wrote into a file? Also, on how to run it where you wrote "path" would I put like /home?&lt;BR /&gt;&lt;BR /&gt;No apology necessary.  Copy and paste the shell script.  All good scripts begin with an interpreter line.  For the standard HP-UX shell that's:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;...which tells the shell what interpreter to load to interpret (understand) the commands in the file.&lt;BR /&gt;&lt;BR /&gt;Yes, in lieu of '/path' you would use '/home' or whatever directory you want to seach.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 24 Sep 2008 12:42:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131451#M688431</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-24T12:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131452#M688432</link>
      <description>Thanks James!!! I will give this a shot real quick and let you know how it turns out. I need to do some studying BIG TIME. When it comes to scripting of any kind I am way behind.</description>
      <pubDate>Wed, 24 Sep 2008 12:49:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131452#M688432</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2008-09-24T12:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131453#M688433</link>
      <description>James when I run&lt;BR /&gt;&lt;BR /&gt;perl -MFile::Find -e 'find(sub{push @f,$File::Find::name if -f $_ &amp;amp;&amp;amp; -T _},".");@a=`grep -i $ARGV[0] @f`;print for sort @a' cac_ellertc  I get the error "Syntax error at line 1 : `(' is not expected." Thoughts?</description>
      <pubDate>Wed, 24 Sep 2008 13:28:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131453#M688433</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2008-09-24T13:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131454#M688434</link>
      <description>Hi Adam:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I get the error "Syntax error at line 1 : `(' is not expected." Thoughts?&lt;BR /&gt;&lt;BR /&gt;The perl script when pasted at the shell's command line should work just fine as posted.  Did you do that or did you put it into a file of its own?  If the later, please post the encapsulation.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 24 Sep 2008 13:39:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131454#M688434</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-24T13:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131455#M688435</link>
      <description>I pasted it as is, with the exception of "String_..... there I listed the string I wanted to search for.</description>
      <pubDate>Wed, 24 Sep 2008 16:48:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131455#M688435</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2008-09-24T16:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131456#M688436</link>
      <description>&lt;!--!*#--&gt;Hi (again) Adam:&lt;BR /&gt;&lt;BR /&gt;You will see:&lt;BR /&gt;&lt;BR /&gt;"Syntax error at line 1 : `(' is not expected."&lt;BR /&gt;&lt;BR /&gt;...if the directory you are searching has a file named with the "(" character.  &lt;BR /&gt;&lt;BR /&gt;Use this variation, instead:&lt;BR /&gt;&lt;BR /&gt;# cat findit.pl &lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use File::Find;&lt;BR /&gt;my ( @a, @f );&lt;BR /&gt;find( sub { push @f, $File::Find::name if -f $_ &amp;amp;&amp;amp; -T _ }, "." );&lt;BR /&gt;for my $file (@f) {&lt;BR /&gt;    open( my $fh, "&amp;lt;", $file ) or die;&lt;BR /&gt;    my $lines = do { local $/; &amp;lt;$fh&amp;gt; };&lt;BR /&gt;    push( @a, $file ) if $lines =~ m/$ARGV[0]/i;&lt;BR /&gt;    close $fh;&lt;BR /&gt;}&lt;BR /&gt;print "$_\n" for sort @a;&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# cd /path &amp;amp;&amp;amp; ./findit.pl string&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 24 Sep 2008 18:12:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131456#M688436</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-24T18:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131457#M688437</link>
      <description>James,&lt;BR /&gt;    I get this error when I try to run the script.&lt;BR /&gt;&lt;BR /&gt; # cd /home &amp;amp;&amp;amp; findit.pl *.pub&lt;BR /&gt;ksh: findit.pl: cannot execute&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Sep 2008 11:52:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131457#M688437</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2008-09-25T11:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131458#M688438</link>
      <description>Hi Adam:&lt;BR /&gt;&lt;BR /&gt;Use a full path to whereever you put the script.  Then:&lt;BR /&gt;&lt;BR /&gt;# chmod 555 /path/findit&lt;BR /&gt;# cd /home  /path/findit pub&lt;BR /&gt;&lt;BR /&gt;...Don't pass "*.pub".  My script will match anything containing the string "pub".&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 25 Sep 2008 12:10:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131458#M688438</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-25T12:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131459#M688439</link>
      <description>Hi :&lt;BR /&gt;&lt;BR /&gt;Ooops: that should have been:&lt;BR /&gt;&lt;BR /&gt;# chmod 555 /path/findit&lt;BR /&gt;# cd /home &amp;amp;&amp;amp; /path/findit pub&lt;BR /&gt;&lt;BR /&gt;NO POINTS for this correction.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Sep 2008 12:11:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131459#M688439</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-25T12:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131460#M688440</link>
      <description>James, one last thing and I will leave you alone I promise. How would I make this script "bounce" off of the /etc/passwd file to search through ONLY users home directories, as some of the "home" directories might not only be /home/abcd? Does what I am asking make sense?</description>
      <pubDate>Thu, 25 Sep 2008 14:43:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131460#M688440</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2008-09-25T14:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131461#M688441</link>
      <description>&lt;!--!*#--&gt;Hi (again) Adam:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; How would I make this script "bounce" off of the /etc/passwd file to search through ONLY users home directories, as some of the "home" directories might not only be /home/abcd?&lt;BR /&gt;&lt;BR /&gt;Well, we could do this:&lt;BR /&gt;&lt;BR /&gt;# cat ./matchit&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use File::Find;&lt;BR /&gt;my ( @a, @home, $home );&lt;BR /&gt;my $pattern = shift or die "Usage: $0 pattern\n";&lt;BR /&gt;open( FH, "&amp;lt;", "/etc/passwd" ) or die "Can't open /etc/passwd: ", $!, "\n";&lt;BR /&gt;while (&lt;FH&gt;) {&lt;BR /&gt;    ($home) = ( ( split /:/, $_ )[5] );&lt;BR /&gt;    next unless -d $home;&lt;BR /&gt;    push( @home, $home ) unless $home =~ '^(/$|/var|/usr|/opt)'; #...adjust...&lt;BR /&gt;}&lt;BR /&gt;close FH;&lt;BR /&gt;find(&lt;BR /&gt;    sub {&lt;BR /&gt;        if ( -f $_ &amp;amp;&amp;amp; -T _ ) {&lt;BR /&gt;            my $file = $File::Find::name;&lt;BR /&gt;            open( my $fh, "&amp;lt;", $file ) or die;&lt;BR /&gt;            my $lines = do { local $/; &amp;lt;$fh&amp;gt; };&lt;BR /&gt;            push( @a, $file ) if $lines =~ m/$pattern/i;&lt;BR /&gt;            close $fh;&lt;BR /&gt;        }&lt;BR /&gt;    },&lt;BR /&gt;    @home&lt;BR /&gt;);&lt;BR /&gt;print "$_\n" for sort @a;&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./matchit somestring&lt;BR /&gt;&lt;BR /&gt;Notice that the '/' directory and the '/var', /usr' and '/opt' filesystems are excluded from the search.  They shouldn't be home directories for our purposes.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/FH&gt;</description>
      <pubDate>Thu, 25 Sep 2008 16:08:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131461#M688441</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-25T16:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131462#M688442</link>
      <description>James, &lt;BR /&gt;   Thanks for the reply. The issue is that several of our "generic" accounts have home directories all over the place. How would I NOT exclude those file systems?</description>
      <pubDate>Thu, 25 Sep 2008 16:22:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131462#M688442</guid>
      <dc:creator>Adam W.</dc:creator>
      <dc:date>2008-09-25T16:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131463#M688443</link>
      <description>Hi (again) Adam:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The issue is that several of our "generic" accounts have home directories all over the place. How would I NOT exclude those file systems?&lt;BR /&gt;&lt;BR /&gt;This is an easy adjustment.  Let's eliminate accounts whose 'uid' isn't greater than 100  --- the HP standard point at which non-system accounts are added.&lt;BR /&gt;&lt;BR /&gt;# cat ./matchit2.pl&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use File::Find;&lt;BR /&gt;my ( @a, @home, $home, $uid );&lt;BR /&gt;my $pattern = shift or die "Usage: $0 pattern\n";&lt;BR /&gt;open( FH, "&amp;lt;", "/etc/passwd" ) or die "Can't open /etc/passwd: ", $!, "\n";&lt;BR /&gt;while (&lt;FH&gt;) {&lt;BR /&gt;    ( $uid, $home ) = ( ( split /:/, $_ )[2,5] );&lt;BR /&gt;    next unless $uid &amp;gt; 100; #...adjust as needed...&lt;BR /&gt;    next unless -d $home;&lt;BR /&gt;    push( @home, $home );&lt;BR /&gt;}&lt;BR /&gt;close FH;&lt;BR /&gt;find(&lt;BR /&gt;    sub {&lt;BR /&gt;        if ( -f $_ &amp;amp;&amp;amp; -T _ ) {&lt;BR /&gt;            my $file = $File::Find::name;&lt;BR /&gt;            open( my $fh, "&amp;lt;", $file ) or die;&lt;BR /&gt;            my $lines = do { local $/; &amp;lt;$fh&amp;gt; };&lt;BR /&gt;            push( @a, $file ) if $lines =~ m/$pattern/i;&lt;BR /&gt;            close $fh;&lt;BR /&gt;        }&lt;BR /&gt;    },&lt;BR /&gt;    @home&lt;BR /&gt;);&lt;BR /&gt;print "$_\n" for sort @a;&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./matchit2.pl somestring&lt;BR /&gt;&lt;BR /&gt;By the way, good code is best written when good definitions of a problem are first developed :-)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;/FH&gt;</description>
      <pubDate>Thu, 25 Sep 2008 16:53:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131463#M688443</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-25T16:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: PKI authentication script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131464#M688444</link>
      <description>&lt;!--!*#--&gt;Hi (again) Adam:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The issue is that several of our "generic" accounts have home directories all over the place. How would I NOT exclude those file systems?&lt;BR /&gt;&lt;BR /&gt;This is an easy adjustment.  Let's eliminate accounts whose 'uid' isn't greater than 100  --- the HP standard point at which non-system accounts are added.&lt;BR /&gt;&lt;BR /&gt;# cat ./matchit2.pl&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;use File::Find;&lt;BR /&gt;my ( @a, @home, $home, $uid );&lt;BR /&gt;my $pattern = shift or die "Usage: $0 pattern\n";&lt;BR /&gt;open( FH, "&amp;lt;", "/etc/passwd" ) or die "Can't open /etc/passwd: ", $!, "\n";&lt;BR /&gt;while (&lt;FH&gt;) {&lt;BR /&gt;    ( $uid, $home ) = ( ( split /:/, $_ )[2,5] );&lt;BR /&gt;    next unless $uid &amp;gt; 100; #...adjust as needed...&lt;BR /&gt;    next unless -d $home;&lt;BR /&gt;    push( @home, $home );&lt;BR /&gt;}&lt;BR /&gt;close FH;&lt;BR /&gt;find(&lt;BR /&gt;    sub {&lt;BR /&gt;        if ( -f $_ &amp;amp;&amp;amp; -T _ ) {&lt;BR /&gt;            my $file = $File::Find::name;&lt;BR /&gt;            open( my $fh, "&amp;lt;", $file ) or die;&lt;BR /&gt;            my $lines = do { local $/; &amp;lt;$fh&amp;gt; };&lt;BR /&gt;            push( @a, $file ) if $lines =~ m/$pattern/i;&lt;BR /&gt;            close $fh;&lt;BR /&gt;        }&lt;BR /&gt;    },&lt;BR /&gt;    @home&lt;BR /&gt;);&lt;BR /&gt;print "$_\n" for sort @a;&lt;BR /&gt;1;&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./matchit2.pl somestring&lt;BR /&gt;&lt;BR /&gt;By the way, good code is best written when good definitions of a problem are first developed :-)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;/FH&gt;</description>
      <pubDate>Thu, 25 Sep 2008 16:53:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pki-authentication-script/m-p/5131464#M688444</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-25T16:53:33Z</dc:date>
    </item>
  </channel>
</rss>

