Here's my DirNoPass EXEC I quickly came up with for a customer.
/* This exec changes all passwords to XXXXXXX in a CP directory
+-----------------------------------------------------------+
! format: ! DIRNOPAS <fn <ft <fm>>> !
+-----------------------------------------------------------+
Default input file: USER DIRECT
Output file: fn NOPASS A
Written by: Kris Buelens */
parse upper source . . myname mytype . syn .
address command
parse upper arg fn ft fm rest . '(' options
if fn='' then fn='USER'
if ft='' then ft='DIRECT'
'PIPE (end ? sep !) <' fn ft fm '!CHOP 72!STRIP Trailing',
'!U: PICK W1 == /USER/', /* Keep USER cords here */
'!UN: PICK W3 == /NOLOG/', /* Keep NOLOG passwords */
'!OUT: FaninAny', /* Collect all output */
'!>' fn 'NOPASS A', /* Create output file */
'?UN:', /* Not NOLOG users */
'!UB: PICK W3 == /LBYONLY/!OUT:', /* "Logon By Only" passwords to OUT*/
'?UB:', /* Not LOGON BY users */
'!SPEC W1.2 1 /xxxxxxxx/ NW W4-* NW!OUT:', /* Chg pswd & send to OUT*/
'?U:', /* non USER cards here */
'!M: PICK W1 == /MDISK/',
'!LM: LOCATE W10!SPEC W1.7 1 /xxxxxxxx xxxxxxxxx xxxxxxxxx/ NW!OUT:',
'?LM:', /* No MULT password */
'!LW: LOCATE W9 !SPEC W1.7 1 /xxxxxxxx xxxxxxxxx/ NW!OUT:',
'?LW:', /* No Write password */
'!LR: LOCATE W8 !SPEC W1.7 1 /xxxxxxxx/ NW!OUT:',
'?LR:', /* No Read password */
'!OUT:',
'?M:', /* Not MDISK card */
'!OUT:'
if rc<>0 then exit rc
say fn 'NOPASS A created'
exit
ERREXIT: /* general errorexit routine */
parse upper source . . myname mytype . syn .
do i=2 to arg() /* give errormessages (if any) */
say myname':' arg(i)
end
exit arg(1)
2010/6/24 Frank M. Ramaekers <[email protected]>
> Is there a better way to do this (basically extracting DIRECTORY entries
> with passwords and replacing with 8 Xs):
>
>
>
> :
>
> :
>
> "|u:NFIND USER"||,
>
> "|i:FANINANY",
>
> "| >" !._OutFile,
>
> "?u:",
>
> "|l:ZONE W3 NFIND NOLOG"||,
>
> "|p:ZONE W3 NFIND NOPASS"||,
>
> "|a:ZONE W3 NFIND AUTOONLY"||,
>
> "|b:ZONE W3 NFIND LBYONLY"||,
>
> "| SPEC W1-2 1 /XXXXXXXX/ NW W4-* NW",
>
> "| i:",
>
> "?l:",
>
> "| i:",
>
> "?p:",
>
> "| i:",
>
> "?a:",
>
> "| i:",
>
> "?b:",
>
> "| i:"
>
>
>
> Frank M. Ramaekers Jr.
>
>
>
> Systems Programmer
>
> MCP, MCP+I, MCSE & RHCE
>
> American Income Life Insurance Co.
>
> Phone: (254)761-6649
>
> 1200 Wooded Acres Dr.
>
> Fax: (254)741-5777
>
> Waco, Texas 76701
>
>
>
>
>
>
> _____________________________________________________
> This message contains information which is privileged and confidential and
> is solely for the use of the
> intended recipient. If you are not the intended recipient, be aware that
> any review, disclosure,
> copying, distribution, or use of the contents of this message is strictly
> prohibited. If you have
> received this in error, please destroy it immediately and notify us at
> [email protected].
>
--
Kris Buelens,
IBM Belgium, VM customer support