$! ************************************************* $! * UD011_PACKAGE.COM $! * This command procedure will extract all source modules required $! * to create the UD011 package. After extracting the files, $! * this procedure will optionally execute the BUILD.COM command $! * procedure included with this package to compile the source files and $! * link the executable image. $! * $! * Created 20-JAN-2000 by the PACKAGE utility $! ************************************************* $! $ Write SYS$OUTPUT "" $ Write SYS$OUTPUT "This procedure extracts and optionally builds the UD011 package." $ Write SYS$OUTPUT "All files will be extracted to ",F$Environment("Default") $ Write SYS$OUTPUT "" $ Call Extract_Files $ Write SYS$OUTPUT "" $ Get_Answer: $ Read/Error=Exit/Prompt="Do you wish to build the UD011 package? " - SYS$COMMAND Answer $ Answer = F$Extract(0,1,F$Edit(Answer,"Trim,UpCase")) $ If Answer .EQS. "N" Then Goto Exit $ If Answer .NES. "Y" Then Goto Get_Answer $ @BUILD.COM $ Exit: $ Exit $! $! $ Extract_Files: SubRoutine $ Call Extract_BUILD_COM $ Call Extract_CLI_C $ Call Extract_CLI_H $ Call Extract_MESSAGE_H $ Call Extract_MESSAGE_MSG $ Call Extract_UAIDEF_H $ Call Extract_UD_C $ Call Extract_UD_DOC $ Call Extract_UD_H $ Call Extract_UD_HLP $ Call Extract_UD_CLD_CLD $ EndSubRoutine ! Extract_Files $! $! $! $ Extract_BUILD_COM: SubRoutine $ Write SYS$OUTPUT "Extracting BUILD.COM..." $ WO := Write OutFile $ SQ = "'" $ SQ2 = SQ + SQ $ Close/NoLog OutFile $ Open/Write/Share OutFile BUILD.COM $ WO "$! **********************************************************************" $ WO "$! * BUILD.COM *" $ WO "$! * (Re)build necessary modules and relink program. *" $ WO "$! * *" $ WO "$! * This is a generic ""make"" command procedure. Modify the section *" $ WO "$! * below with the following symbols: *" $ WO "$! * *" $ WO "$! * Image_Name = ""xxx.EXE"" - the name of the output image name *" $ WO "$! * Version = ""Vn.n"" - the version number of the product *" $ WO "$! * Object_List == """" - this symbol must be defined as null *" $ WO "$! * *" $ WO "$! * Then add or modify the ""Call"" lines for each module in the *" $ WO "$! * program: *" $ WO "$! * *" $ WO "$! * Call Compile_C filename.C ''SQ'P1''SQ' - for each C source module *" $ WO "$! * Call Message filename.MSG ''SQ'P1''SQ' - for each message source mod *" $ WO "$! * Call CLD filename.CLD ''SQ'P1''SQ' - for each CLD source module *" $ WO "$! * *" $ WO "$! * BUILD will recompile only those modules which have changed *" $ WO "$! * since last compile and relink the image. *" $ WO "$! * *" $ WO "$! * If you specify ""ALL"" as parameter P1, all source modules are *" $ WO "$! * unconditionally recompiled. *" $ WO "$! * *" $ WO "$! * 18-DEC-1996 RDJ Command Procedure Creation. *" $ WO "$! **********************************************************************" $ WO "$!" $ WO "$ Object_List == """"" $ WO "$ Image_Name = ""UD.EXE""" $ WO "$ Image_Version = ""V11""" $ WO "$!" $ WO "$ Call Compile_C UD.C ''SQ'P1''SQ'" $ WO "$ Call Compile_C CLI.C ''SQ'P1''SQ'" $ WO "$ Call Message MESSAGE.MSG ''SQ'P1''SQ'" $ WO "$ Call CLD UD_CLD.CLD ''SQ'P1''SQ'" $ WO "$!" $ WO "$! **************************************************************************" $ WO "$ Write SYS$OUTPUT ""Linking ",SQ2,"Image_Name''SQ'...""" $ WO "$ PID = F$GetJPI("""",""PID"")" $ WO "$ On Error Then Goto Cleanup" $ WO "$ If F$Search(""SYS$SYSTEM:DECC$COMPILER.EXE"") .EQS. """"" $ WO "$ Then" $ WO "$ Close/NoLog OutFile" $ WO "$ Open/Write OutFile SYS$SCRATCH:BUILD_TMP.''SQ'PID''SQ'" $ WO "$ Write OutFile ""$ Link/Exec=",SQ2,"Image_Name''SQ'/NoTrace SYS$INPUT/Opt""" $ WO "$ Write OutFile """,SQ2,"Object_List''SQ',SYS$SHARE:VAXCRTL/Share""" $ WO "$ Write OutFile ""IDENTIFICATION=",SQ2,"Image_Version''SQ'""" $ WO "$ Close OutFile" $ WO "$ @SYS$SCRATCH:BUILD_TMP.''SQ'PID''SQ'" $ WO "$ Else" $ WO "$ Close/NoLog OutFile" $ WO "$ Open/Write OutFile SYS$SCRATCH:BUILD_TMP.''SQ'PID''SQ'" $ WO "$ Write OutFile ""$ Link/Exec=",SQ2,"Image_Name''SQ'/NoTrace SYS$INPUT/Opt""" $ WO "$ Write OutFile Object_List" $ WO "$ Write OutFile ""IDENTIFICATION=",SQ2,"Image_Version''SQ'""" $ WO "$ Close OutFile" $ WO "$ @SYS$SCRATCH:BUILD_TMP.''SQ'PID''SQ'" $ WO "$ EndIf" $ WO "$ Cleanup:" $ WO "$ Write SYS$OUTPUT ""Cleaning up..""" $ WO "$ If F$Search(""SYS$SCRATCH:BUILD_TMP.",SQ2,"PID''SQ'"") .NES. """" Then -" $ WO " Delete/NoLog/NoConfirm SYS$SCRATCH:BUILD_TMP.''SQ'PID''SQ';*" $ WO "$ Purge/NoLog/NoConfirm *.OBJ" $ WO "$ Purge/NoLog/NoConfirm *.EXE" $ WO "$ Exit" $ WO "$!" $ WO "$! **********************************************************************" $ WO "$! * Compile_C: Compile a ''SQ'C''SQ' source module. *" $ WO "$! **********************************************************************" $ WO "$ Compile_C: SubRoutine" $ WO "$ If Object_List .EQS. """"" $ WO "$ Then" $ WO "$ Object_List == F$Parse(P1,,,""Name"")" $ WO "$ Else" $ WO "$ Object_List == Object_List + "","" + F$Parse(P1,,,""Name"")" $ WO "$ EndIf" $ WO "$ If P2 .EQS. ""ALL"" Then Goto Compile_It" $ WO "$ O_File = F$Parse(P1,,,""Name"") + "".OBJ""" $ WO "$ If F$Search(""",SQ2,"O_File''SQ'"") .EQS. """" Then Goto Compile_It" $ WO "$ Object_Date = F$CvTime(F$File_Attributes(O_File,""RDT""),""Comparison"")" $ WO "$ Source_Date = F$CvTime(F$File_Attributes(P1,""RDT""),""Comparison"")" $ WO "$ If Source_Date .LTS. Object_Date" $ WO "$ Then" $ WO "$ Write SYS$OUTPUT """,SQ2,"P1''SQ' is up to date; skipping...""" $ WO "$ Exit" $ WO "$ EndIf" $ WO "$ Compile_It:" $ WO "$ Write SYS$OUTPUT ""Compiling ",SQ2,"P1''SQ'...""" $ WO "$ If F$Search(""SYS$SYSTEM:DECC$COMPILER.EXE"") .EQS. """"" $ WO "$ Then" $ WO "$ CC/NoDebug ''SQ'P1''SQ'" $ WO "$ Else" $ WO "$ CC/NoDebug/Standard=VAXC ''SQ'P1''SQ'" $ WO "$ EndIf" $ WO "$ Exit" $ WO "$ EndSubRoutine" $ WO "$!" $ WO "$! **********************************************************************" $ WO "$! * Message: Compile a message module. *" $ WO "$! **********************************************************************" $ WO "$ Message: SubRoutine" $ WO "$ If Object_List .EQS. """"" $ WO "$ Then" $ WO "$ Object_List == F$Parse(P1,,,""Name"")" $ WO "$ Else" $ WO "$ Object_List == Object_List + "","" + F$Parse(P1,,,""Name"")" $ WO "$ EndIf" $ WO "$ If P2 .EQS. ""ALL"" Then Goto Compile_It" $ WO "$ O_File = F$Parse(P1,,,""Name"") + "".OBJ""" $ WO "$ If F$Search(""",SQ2,"O_File''SQ'"") .EQS. """" Then Goto Compile_It" $ WO "$ Object_Date = F$CvTime(F$File_Attributes(O_File,""RDT""),""Comparison"")" $ WO "$ Source_Date = F$CvTime(F$File_Attributes(P1,""RDT""),""Comparison"")" $ WO "$ If Source_Date .LTS. Object_Date" $ WO "$ Then" $ WO "$ Write SYS$OUTPUT """,SQ2,"P1''SQ' is up to date; skipping...""" $ WO "$ Exit" $ WO "$ EndIf" $ WO "$ Compile_It:" $ WO "$ Write SYS$OUTPUT ""Compiling ",SQ2,"P1''SQ'...""" $ WO "$ Message/Object ''SQ'P1''SQ'" $ WO "$ Exit" $ WO "$ EndSubRoutine" $ WO "$!" $ WO "$! **********************************************************************" $ WO "$! * CLD: Compile a CLD module. *" $ WO "$! **********************************************************************" $ WO "$ CLD: SubRoutine" $ WO "$ If Object_List .EQS. """"" $ WO "$ Then" $ WO "$ Object_List == F$Parse(P1,,,""Name"")" $ WO "$ Else" $ WO "$ Object_List == Object_List + "","" + F$Parse(P1,,,""Name"")" $ WO "$ EndIf" $ WO "$ If P2 .EQS. ""ALL"" Then Goto Compile_It" $ WO "$ O_File = F$Parse(P1,,,""Name"") + "".OBJ""" $ WO "$ If F$Search(""",SQ2,"O_File''SQ'"") .EQS. """" Then Goto Compile_It" $ WO "$ Object_Date = F$CvTime(F$File_Attributes(O_File,""RDT""),""Comparison"")" $ WO "$ Source_Date = F$CvTime(F$File_Attributes(P1,""RDT""),""Comparison"")" $ WO "$ If Source_Date .LTS. Object_Date" $ WO "$ Then" $ WO "$ Write SYS$OUTPUT """,SQ2,"P1''SQ' is up to date; skipping...""" $ WO "$ Exit" $ WO "$ EndIf" $ WO "$ Compile_It:" $ WO "$ Write SYS$OUTPUT ""Compiling ",SQ2,"P1''SQ'...""" $ WO "$ Set Command/Object ''SQ'P1''SQ'" $ WO "$ Exit" $ WO "$ EndSubRoutine" $ WO " $ Close/NoLog OutFile $ Exit $ EndSubRoutine ! Extract_BUILD_COM $! $ Extract_CLI_C: SubRoutine $ Write SYS$OUTPUT "Extracting CLI.C..." $ WO := Write OutFile $ SQ = "'" $ SQ2 = SQ + SQ $ Close/NoLog OutFile $ Open/Write/Share OutFile CLI.C $ WO "/************************************************************************" $ WO " * *" $ WO " * UD *" $ WO " * version 1.0 *" $ WO " * Copyright © 1998 by Richard D. Johnson *" $ WO " * All Rights Reserved *" $ WO " * *" $ WO " * This software has been release to public domain, and may be freely *" $ WO " * copied, distributed, and modified. This software is provided as is, *" $ WO " * free of charge. The author assumes no responsibility for the use *" $ WO " * of this software. *" $ WO " * *" $ WO " * Richware: http://richj.home.mindspring.com/richware/index.html *" $ WO " * *" $ WO " ************************************************************************" $ WO " * CLI.C *" $ WO " * *" $ WO " * This module contains routines to parse the CLI command line. *" $ WO " * *" $ WO " ************************************************************************" $ WO " * Revision History *" $ WO " * *" $ WO " * 17-DEC-1996 RDJ Module completion. *" $ WO " * 9-DEC-1998 RDJ Copied and modified for UD *" $ WO " ************************************************************************/" $ WO "#include " $ WO "#include " $ WO "#include " $ WO "#include " $ WO "#include " $ WO "#ifdef __DECC" $ WO "#include " $ WO "#include " $ WO "#endif" $ WO "#include " $ WO "#ifdef __DECC" $ WO "#include " $ WO "#endif" $ WO "#include ""ud.h""" $ WO "" $ WO "" $ WO "/************************************************************************" $ WO " * cli_parse_command_line: parse the CLI command line for correct *" $ WO " * syntax and set up for other command line parsing calls. *" $ WO " ************************************************************************/" $ WO "unsigned long cli_parse_command_line (command_name, command_module)" $ WO "char *command_name;" $ WO "long *command_module;" $ WO "{" $ WO " char command_buffer[256];" $ WO "#ifdef __DECC" $ WO "#pragma __nostandard" $ WO "#endif" $ WO " $DESCRIPTOR (d_line, command_buffer);" $ WO " $DESCRIPTOR (d_cldline, command_buffer);" $ WO "#ifdef __DECC" $ WO "#pragma __standard" $ WO "#endif" $ WO " unsigned long status;" $ WO " short int length;" $ WO " int command_length;" $ WO "" $ WO " sprintf (command_buffer, ""%s "", command_name);" $ WO " command_length = strlen(command_buffer);" $ WO " d_line.dsc$w_length = d_line.dsc$w_length - command_length;" $ WO " d_line.dsc$a_pointer = d_line.dsc$a_pointer + command_length;" $ WO " lib$get_foreign(&d_line,0,&length,0);" $ WO " command_buffer[length + command_length] = ''SQ'\0''SQ';" $ WO " d_cldline.dsc$w_length = length + command_length;" $ WO " status = cli$dcl_parse (&d_cldline,command_module,0,0,0);" $ WO " if (status == 196609)" $ WO " return (SS$_NORMAL);" $ WO " if (status == CLI$_ENTNF)" $ WO " return (SS$_NORMAL);" $ WO " exit (SS$_NORMAL);" $ WO "}" $ WO "" $ WO "" $ WO "" $ WO "" $ WO "" $ WO "/************************************************************************" $ WO " * cli_check_qualifier: search the command line for a specific *" $ WO " * qualifier and set a boolean status variable. *" $ WO " ************************************************************************/" $ WO "cli_check_qualifier (qualifier_name, status)" $ WO "char *qualifier_name; /* name of qualifier to check for */" $ WO "boolean *status; /* status variable */" $ WO "{" $ WO "#ifdef __DECC" $ WO "#pragma __nostandard" $ WO "#endif" $ WO " $DESCRIPTOR (entity_desc,qualifier_name);" $ WO "#ifdef __DECC" $ WO "#pragma __standard" $ WO "#endif" $ WO "" $ WO " entity_desc.dsc$w_length = strlen(qualifier_name);" $ WO " switch (cli$present (&entity_desc)) {" $ WO " case CLI$_PRESENT:" $ WO " case CLI$_DEFAULTED:" $ WO " *status = true;" $ WO " break;" $ WO " default:" $ WO " *status = false;" $ WO " }" $ WO "}" $ WO "" $ WO "" $ WO "" $ WO "" $ WO "" $ WO "/************************************************************************" $ WO " * cli_get_value: get the value of a command line entity. *" $ WO " ************************************************************************/" $ WO "unsigned long cli_get_value (entity, value)" $ WO "char *entity; /* entity to get value of */" $ WO "char *value; /* returned value */" $ WO "{" $ WO "#ifdef __DECC" $ WO "#pragma __nostandard" $ WO "#endif" $ WO " $DESCRIPTOR (entity_desc,entity); /* descriptor for entity string */" $ WO " $DESCRIPTOR (value_desc,value); /* descriptor for value string */" $ WO "#ifdef __DECC" $ WO "#pragma __standard" $ WO "#endif" $ WO " unsigned short value_length; /* length of returned value */" $ WO " unsigned long status; /* return status of cli$ call */" $ WO "" $ WO " entity_desc.dsc$w_length = strlen(entity);" $ WO " value_desc.dsc$w_length = 256;" $ WO " status = cli$get_value (&entity_desc,&value_desc,&value_length);" $ WO " value[value_length] = ''SQ'\0''SQ';" $ WO " return (status);" $ WO "}" $ WO "" $ WO " $ Close/NoLog OutFile $ Exit $ EndSubRoutine ! Extract_CLI_C $! $ Extract_CLI_H: SubRoutine $ Write SYS$OUTPUT "Extracting CLI.H..." $ WO := Write OutFile $ SQ = "'" $ SQ2 = SQ + SQ $ Close/NoLog OutFile $ Open/Write/Share OutFile CLI.H $ WO "/************************************************************************" $ WO " * User Directory (UD) *" $ WO " * version 1.0 *" $ WO " * Copyright © 1998 by Richard D. Johnson *" $ WO " * All Rights Reserved *" $ WO " * *" $ WO " * This software has been release to public domain, and may be freely *" $ WO " * copied, distributed, and modified. This software is provided as is, *" $ WO " * free of charge. The author assumes no responsibility for the use *" $ WO " * of this software. *" $ WO " * *" $ WO " * Richware: http://richj.home.mindspring.com/richware/index.html *" $ WO " * *" $ WO " ************************************************************************" $ WO " * Revision History *" $ WO " * *" $ WO " * 10-DEC-1998 RDJ Module Completion. *" $ WO " ************************************************************************/" $ WO "" $ WO "extern unsigned long cli_parse_command_line();" $ WO "extern int cli_check_qualifier();" $ WO "extern unsigned long cli_get_value();" $ WO " $ Close/NoLog OutFile $ Exit $ EndSubRoutine ! Extract_CLI_H $! $ Extract_MESSAGE_H: SubRoutine $ Write SYS$OUTPUT "Extracting MESSAGE.H..." $ WO := Write OutFile $ SQ = "'" $ SQ2 = SQ + SQ $ Close/NoLog OutFile $ Open/Write/Share OutFile MESSAGE.H $ WO "" $ WO "#ifdef __DECC" $ WO "#pragma __nostandard" $ WO "#endif" $ WO "globalvalue" $ WO " UD$NOBACK, /* no previous directory */" $ WO " UD$VERSION; /* current version is ... */" $ WO "#ifdef __DECC" $ WO "#pragma __standard" $ WO "#endif" $ WO " $ Close/NoLog OutFile $ Exit $ EndSubRoutine ! Extract_MESSAGE_H $! $ Extract_MESSAGE_MSG: SubRoutine $ Write SYS$OUTPUT "Extracting MESSAGE.MSG..." $ WO := Write OutFile $ SQ = "'" $ SQ2 = SQ + SQ $ Close/NoLog OutFile $ Open/Write/Share OutFile MESSAGE.MSG $ WO ".TITLE UD Messages" $ WO ".IDENT ''SQ'Version 1.0''SQ'" $ WO ".FACILITY UD,90/PREFIX=UD$" $ WO ".BASE 100" $ WO "" $ WO ".SEVERITY FATAL" $ WO "" $ WO ".SEVERITY ERROR" $ WO "NOBACK " $ WO "" $ WO ".SEVERITY WARNING" $ WO "" $ WO ".SEVERITY INFORMATIONAL" $ WO "VERSION /FAO_COUNT=1" $ WO "" $ WO ".SEVERITY SUCCESS" $ WO ".END" $ WO " $ Close/NoLog OutFile $ Exit $ EndSubRoutine ! Extract_MESSAGE_MSG $! $ Extract_UAIDEF_H: SubRoutine $ Write SYS$OUTPUT "Extracting UAIDEF.H..." $ WO := Write OutFile $ SQ = "'" $ SQ2 = SQ + SQ $ Close/NoLog OutFile $ Open/Write/Share OutFile UAIDEF.H $ WO "/********************************************************************************************************************************/" $ WO "/* Created: 4-MAY-1995 19:01:50 by OpenVMS SDL EV1-36 */" $ WO "/* Source: 4-MAY-1995 18:59:10 $64$DUA3210:[STARLET_H.SRC]STARDEFQZ.SDI;1 */" $ WO "/********************************************************************************************************************************/" $ WO "/*** MODULE $UAIDEF ***/" $ WO "#ifndef __UAIDEF_LOADED" $ WO "#define __UAIDEF_LOADED 1" $ WO " " $ WO "#pragma __nostandard /* This file uses non-ANSI-Standard features */" $ WO "#pragma __member_alignment __save" $ WO "#pragma __nomember_alignment" $ WO " " $ WO "#ifdef __cplusplus" $ WO " extern ""C"" {" $ WO "#define __unknown_params ..." $ WO "#else" $ WO "#define __unknown_params" $ WO "#endif" $ WO " " $ WO "#if !defined(__VAXC)" $ WO "#define __struct struct" $ WO "#define __union union" $ WO "#else" $ WO "#define __struct variant_struct" $ WO "#define __union variant_union" $ WO "#endif" $ WO " " $ WO "/*+ */" $ WO "/* */" $ WO "/* Get User Authorization Information Data Identifier Definitions */" $ WO "/* */" $ WO "/* **** NOTE **** */" $ WO "/* */" $ WO "/* New items must always be added to the END of each item list */" $ WO "/* so that users will not have to relink. */" $ WO "/* */" $ WO "/*- */" $ WO "#define UAI$_RTYPE 1 /* UAF record type */" $ WO "#define UAI$_VERSION 2 /* UAF format version */" $ WO "#define UAI$_USRDATOFF 3 /* offset of counted string of user data */" $ WO "#define UAI$_USERNAME 4 /* username */" $ WO "#define UAI$_USERNAME_TAG 5 /* tag to differentiate records */" $ WO "#define UAI$_UIC 6 /* user ID code */" $ WO "#define UAI$_MEM 7 /* member subfield */" $ WO "#define UAI$_GRP 8 /* group subfield */" $ WO "#define UAI$_SUB_ID 9 /* user sub-identifier */" $ WO "#define UAI$_PARENT_ID 10 /* identifier of owner of this account */" $ WO "#define UAI$_ACCOUNT 11 /* account name */" $ WO "#define UAI$_OWNER 12 /* owner''SQ's name */" $ WO "#define UAI$_DEFDEV 13 /* default device */" $ WO "#define UAI$_DEFDIR 14 /* default directory */" $ WO "#define UAI$_LGICMD 15 /* login command file */" $ WO "#define UAI$_DEFCLI 16 /* default command interpreter */" $ WO "#define UAI$_CLITABLES 17 /* user CLI tables */" $ WO "#define UAI$_PWD 18 /* hashed password */" $ WO "#define UAI$_PWD2 19 /* second password */" $ WO "#define UAI$_LOGFAILS 20 /* count of login failures */" $ WO "#define UAI$_SALT 21 /* random password salt */" $ WO "#define UAI$_ENCRYPT 22 /* primary password hash algorithm */" $ WO "#define UAI$_ENCRYPT2 23 /* secondary password hash algorithm */" $ WO "#define UAI$_PWD_LENGTH 24 /* minimum password length */" $ WO "#define UAI$_EXPIRATION 25 /* expiration date for account */" $ WO "#define UAI$_PWD_LIFETIME 26 /* password lifetime */" $ WO "#define UAI$_PWD_DATE 27 /* date of password change */" $ WO "#define UAI$_PWD2_DATE 28 /* date of 2nd password change */" $ WO "#define UAI$_LASTLOGIN_I 29 /* date of last interactive login */" $ WO "#define UAI$_LASTLOGIN_N 30 /* date of last non-interactive login */" $ WO "#define UAI$_PRIV 31 /* process privilege vector */" $ WO "#define UAI$_DEF_PRIV 32 /* default process privileges */" $ WO "#define UAI$_MIN_CLASS 33 /* minimum security class */" $ WO "#define UAI$_MAX_CLASS 34 /* maximum security class */" $ WO "#define UAI$_FLAGS 35 /* user flags longword */" $ WO "#define UAI$_NETWORK_ACCESS_P 36 /* hourly network access, primary */" $ WO "#define UAI$_NETWORK_ACCESS_S 37 /* hourly network access, secondary */" $ WO "#define UAI$_BATCH_ACCESS_P 38 /* hourly batch access, primary */" $ WO "#define UAI$_BATCH_ACCESS_S 39 /* hourly batch access, secondary */" $ WO "#define UAI$_LOCAL_ACCESS_P 40 /* hourly local access, primary */" $ WO "#define UAI$_LOCAL_ACCESS_S 41 /* hourly local access, secondary */" $ WO "#define UAI$_DIALUP_ACCESS_P 42 /* hourly dialup access, primary */" $ WO "#define UAI$_DIALUP_ACCESS_S 43 /* hourly dialup access, secondary */" $ WO "#define UAI$_REMOTE_ACCESS_P 44 /* hourly remote access, primary */" $ WO "#define UAI$_REMOTE_ACCESS_S 45 /* hourly remote access, secondary */" $ WO "#define UAI$_PRIMEDAYS 46 /* bits representing primary days */" $ WO "#define UAI$_PRI 47 /* base process priority */" $ WO "#define UAI$_QUEPRI 48 /* maximum job queuing priority */" $ WO "#define UAI$_MAXJOBS 49 /* maximum jobs for UIC allowed */" $ WO "#define UAI$_MAXACCTJOBS 50 /* maximum jobs for account allowed */" $ WO "#define UAI$_MAXDETACH 51 /* maximum detached processes for UIC */" $ WO "#define UAI$_PRCCNT 52 /* subprocess creation limit */" $ WO "#define UAI$_BIOLM 53 /* buffered I/O limit */" $ WO "#define UAI$_DIOLM 54 /* direct I/O limit */" $ WO "#define UAI$_TQCNT 55 /* timer queue entry limit */" $ WO "#define UAI$_ASTLM 56 /* AST queue limit */" $ WO "#define UAI$_ENQLM 57 /* enqueue limit */" $ WO "#define UAI$_FILLM 58 /* open file limit */" $ WO "#define UAI$_SHRFILLM 59 /* shared file limit */" $ WO "#define UAI$_WSQUOTA 60 /* working set size quota */" $ WO "#define UAI$_DFWSCNT 61 /* default working set size */" $ WO "#define UAI$_WSEXTENT 62 /* working set size limit */" $ WO "#define UAI$_PGFLQUOTA 63 /* page file quota */" $ WO "#define UAI$_CPUTIM 64 /* CPU time quota */" $ WO "#define UAI$_BYTLM 65 /* buffered I/O byte count limit */" $ WO "#define UAI$_PBYTLM 66 /* paged buffer I/O byte count limit */" $ WO "#define UAI$_JTQUOTA 67 /* job-wide logical name table creation quota */" $ WO "#define UAI$_PROXY_LIM 68 /* number of proxies user can grant */" $ WO "#define UAI$_PROXIES 69 /* number of proxies granted */" $ WO "#define UAI$_ACCOUNT_LIM 70 /* number of sub-accounts allowed */" $ WO "#define UAI$_ACCOUNTS 71 /* number of sub-accounts in use */" $ WO "#define UAI$_USER_DATA 72 /* user data area */" $ WO "#define UAI$_PASSWORD 73 /* plaintext primary password */" $ WO "#define UAI$_PASSWORD2 74 /* plaintext secondary password */" $ WO "#define UAI$_DEF_CLASS 75 /* default security classification */" $ WO "/* ADD ITEM-CODES BEFORE THIS COMMENT */" $ WO "#define UAI$_MAX_ITEM_CODE 76 /* maximum legal item code + 1 */" $ WO "/* Add UAI$_DEFCHARGE_CODE as an alias for UAI$_ACCOUNT. */" $ WO "#define UAI$_DEFCHARGE_CODE 11 /* default charge code (=account) */" $ WO "/* Define the various password hash algorithms. */" $ WO "#define UAI$C_AD_II 0 /* AUTODIN-II 32 bit crc code */" $ WO "#define UAI$C_PURDY 1 /* Purdy polynomial over salted input */" $ WO "#define UAI$C_PURDY_V 2 /* Purdy polynomial + variable length username */" $ WO "#define UAI$C_PURDY_S 3 /* PURDY_V folded into password length */" $ WO "#define UAI$C_PREFERED_ALGORITHM 127" $ WO "#define UAI$C_PREFERRED_ALGORITHM 127 /* preferred hash algorithm - use current */" $ WO "#define UAI$C_CUST_ALGORITHM 128 /* customer algorithm division */" $ WO "#define UAI$C_MAX_PWD_LENGTH 32 /* maximum plaintext password */" $ WO "/* Define the flags for the user flags longword. */" $ WO "#define UAI$M_DISCTLY 0x1" $ WO "#define UAI$M_DEFCLI 0x2" $ WO "#define UAI$M_LOCKPWD 0x4" $ WO "#define UAI$M_RESTRICTED 0x8" $ WO "#define UAI$M_DISACNT 0x10" $ WO "#define UAI$M_DISWELCOM 0x20" $ WO "#define UAI$M_DISMAIL 0x40" $ WO "#define UAI$M_NOMAIL 0x80" $ WO "#define UAI$M_GENPWD 0x100" $ WO "#define UAI$M_PWD_EXPIRED 0x200" $ WO "#define UAI$M_PWD2_EXPIRED 0x400" $ WO "#define UAI$M_AUDIT 0x800" $ WO "#define UAI$M_DISREPORT 0x1000" $ WO "#define UAI$M_DISRECONNECT 0x2000" $ WO "#define UAI$M_AUTOLOGIN 0x4000" $ WO "#define UAI$M_DISFORCE_PWD_CHANGE 0x8000" $ WO "#define UAI$M_CAPTIVE 0x10000" $ WO "#define UAI$M_DISIMAGE 0x20000" $ WO "#define UAI$M_DISPWDDIC 0x40000" $ WO "#define UAI$M_DISPWDHIS 0x80000" $ WO "#define UAI$M_DEFCLSVAL 0x100000" $ WO "struct flags { /* user flags longword */" $ WO " unsigned uai$v_disctly : 1; /* no user control-y */" $ WO " unsigned uai$v_defcli : 1; /* only allow user default CLI */" $ WO " unsigned uai$v_lockpwd : 1; /* disable SET PASSWORD command */" $ WO " unsigned uai$v_restricted : 1; /* restricted account (pre-V5.2 CAPTIVE) */" $ WO " unsigned uai$v_disacnt : 1; /* no interactive login */" $ WO " unsigned uai$v_diswelcom : 1; /* skip welcome message */" $ WO " unsigned uai$v_dismail : 1; /* skip new mail message */" $ WO " unsigned uai$v_nomail : 1; /* disable mail delivery */" $ WO " unsigned uai$v_genpwd : 1; /* passwords must be generated */" $ WO " unsigned uai$v_pwd_expired : 1; /* password has expired */" $ WO " unsigned uai$v_pwd2_expired : 1; /* 2nd password has expired */" $ WO " unsigned uai$v_audit : 1; /* audit all actions */" $ WO " unsigned uai$v_disreport : 1; /* skip last login messages */" $ WO " unsigned uai$v_disreconnect : 1; /* inhibit reconnections */" $ WO " unsigned uai$v_autologin : 1; /* auto-login only */" $ WO " unsigned uai$v_disforce_pwd_change : 1; /* disable forced password change */" $ WO " unsigned uai$v_captive : 1; /* captive account (no overrides) */" $ WO " unsigned uai$v_disimage : 1; /* disable arbitrary image activation */" $ WO " unsigned uai$v_dispwddic : 1; /* disable password dictionary filter */" $ WO " unsigned uai$v_dispwdhis : 1; /* disable password history search */" $ WO " unsigned uai$v_defclsval : 1; /* default classification is valid */" $ WO " unsigned uai$v_fill_28 : 3;" $ WO " } ;" $ WO "/* Define the flags representing primary days. */" $ WO "struct primedays { /* bits representing primary days */" $ WO " unsigned uai$v_monday : 1; /* bit clear means this is a primary day */" $ WO " unsigned uai$v_tuesday : 1; /* bit set means this is an off day */" $ WO " unsigned uai$v_wednesday : 1;" $ WO " unsigned uai$v_thursday : 1;" $ WO " unsigned uai$v_friday : 1;" $ WO " unsigned uai$v_saturday : 1;" $ WO " unsigned uai$v_sunday : 1;" $ WO " unsigned uai$v_fill_29 : 1;" $ WO " } ;" $ WO "#define UAI$V_DISCTLY 0" $ WO "#define UAI$V_DEFCLI 1" $ WO "#define UAI$V_LOCKPWD 2" $ WO "#define UAI$V_RESTRICTED 3" $ WO "#define UAI$V_DISACNT 4" $ WO "#define UAI$V_DISWELCOM 5" $ WO "#define UAI$V_DISMAIL 6" $ WO "#define UAI$V_NOMAIL 7" $ WO "#define UAI$V_GENPWD 8" $ WO "#define UAI$V_PWD_EXPIRED 9" $ WO "#define UAI$V_PWD2_EXPIRED 10" $ WO "#define UAI$V_AUDIT 11" $ WO "#define UAI$V_DISREPORT 12" $ WO "#define UAI$V_DISRECONNECT 13" $ WO "#define UAI$V_AUTOLOGIN 14" $ WO "#define UAI$V_DISFORCE_PWD_CHANGE 15" $ WO "#define UAI$V_CAPTIVE 16" $ WO "#define UAI$V_DISIMAGE 17" $ WO "#define UAI$V_DISPWDDIC 18" $ WO "#define UAI$V_DISPWDHIS 19" $ WO "#define UAI$V_MONDAY 0" $ WO "#define UAI$V_TUESDAY 1" $ WO "#define UAI$V_WEDNESDAY 2" $ WO "#define UAI$V_THURSDAY 3" $ WO "#define UAI$V_FRIDAY 4" $ WO "#define UAI$V_SATURDAY 5" $ WO "#define UAI$V_SUNDAY 6" $ WO " " $ WO "#pragma __member_alignment __restore" $ WO "#ifdef __cplusplus" $ WO " }" $ WO "#endif" $ WO "#pragma __standard" $ WO " " $ WO "#endif /* __UAIDEF_LOADED */" $ WO " " $ WO " $ Close/NoLog OutFile $ Exit $ EndSubRoutine ! Extract_UAIDEF_H $! $ Extract_UD_C: SubRoutine $ Write SYS$OUTPUT "Extracting UD.C..." $ WO := Write OutFile $ SQ = "'" $ SQ2 = SQ + SQ $ Close/NoLog OutFile $ Open/Write/Share OutFile UD.C $ WO "/************************************************************************" $ WO " * User Directory (UD) *" $ WO " * version 1.1 *" $ WO " * Copyright © 2000 by Richard D. Johnson *" $ WO " * All Rights Reserved *" $ WO " * *" $ WO " * This software has been release to public domain, and may be freely *" $ WO " * copied, distributed, and modified. This software is provided as is, *" $ WO " * free of charge. The author assumes no responsibility for the use *" $ WO " * of this software. *" $ WO " * *" $ WO " * Richware: http://richj.home.mindspring.com/richware/index.html *" $ WO " * *" $ WO " ************************************************************************" $ WO " * Revision History *" $ WO " * *" $ WO " * 10-DEC-1998 RDJ Module Completion. *" $ WO " * *" $ WO " * 20-JAN-2000 RDJ Added support for /DEFINE qualifier to *" $ WO " * define a logical name instead of *" $ WO " * actually setting default. *" $ WO " ************************************************************************/" $ WO "" $ WO "#include " $ WO "#include " $ WO "#include " $ WO "#ifdef __DECC" $ WO "#include " $ WO "#endif" $ WO "#include " $ WO "#ifdef __DECC" $ WO "#include " $ WO "#endif" $ WO "#include " $ WO "#include " $ WO "#include " $ WO "#include " $ WO "#ifdef __DECC" $ WO "#include " $ WO "#else" $ WO "#include ""uaidef.h""" $ WO "#endif" $ WO "#include ""ud.h""" $ WO "#include ""message.h""" $ WO "#include ""cli.h""" $ WO "" $ WO "" $ WO "struct option_struct option;" $ WO "" $ WO "" $ WO "" $ WO "main () {" $ WO " struct dsc$descriptor new_dir_desc; /* desc for new dir */" $ WO " char new_dir[MAX_DESC_LENGTH+1]; /* buffer for new dir */" $ WO " struct dsc$descriptor old_dir_desc; /* desc for old dir */" $ WO " char old_dir[MAX_DESC_LENGTH+1]; /* buffer for old dir */" $ WO " struct dsc$descriptor new_dev_desc; /* desc for new dev */" $ WO " char new_dev[MAX_DESC_LENGTH+1]; /* buffer for new dev */" $ WO " struct dsc$descriptor old_dev_desc; /* desc for old dev */" $ WO " char old_dev[MAX_DESC_LENGTH+1]; /* buffer for old dev */" $ WO " char symbol_equiv[MAX_SYMBOL_LENGTH+1]; /* build symbol def */" $ WO " char logical_equiv[MAX_SYMBOL_LENGTH+1]; /* build logical def */" $ WO "" $ WO " parse(); /* get command line arg */" $ WO " new_dir_desc.dsc$w_length = MAX_DESC_LENGTH; /* set up descriptors */" $ WO " new_dir_desc.dsc$b_dtype = DSC$K_DTYPE_T;" $ WO " new_dir_desc.dsc$b_class = DSC$K_CLASS_S;" $ WO " new_dir_desc.dsc$a_pointer = new_dir;" $ WO " old_dir_desc.dsc$w_length = MAX_DESC_LENGTH;" $ WO " old_dir_desc.dsc$b_dtype = DSC$K_DTYPE_T;" $ WO " old_dir_desc.dsc$b_class = DSC$K_CLASS_S;" $ WO " old_dir_desc.dsc$a_pointer = old_dir;" $ WO " new_dev_desc.dsc$w_length = MAX_DESC_LENGTH;" $ WO " new_dev_desc.dsc$b_dtype = DSC$K_DTYPE_T;" $ WO " new_dev_desc.dsc$b_class = DSC$K_CLASS_S;" $ WO " new_dev_desc.dsc$a_pointer = new_dev;" $ WO " old_dev_desc.dsc$w_length = MAX_DESC_LENGTH;" $ WO " old_dev_desc.dsc$b_dtype = DSC$K_DTYPE_T;" $ WO " old_dev_desc.dsc$b_class = DSC$K_CLASS_S;" $ WO " old_dev_desc.dsc$a_pointer = old_dev;" $ WO "" $ WO " if (option.back == false) { /* use P1 for new directory */" $ WO " get_user_directory(option.username,&new_dir_desc,&new_dev_desc);" $ WO " } else { /* use /BACK for new directory */" $ WO " get_logical(BACK_DEV_LOGICAL,new_dev_desc.dsc$a_pointer);" $ WO " get_logical(BACK_DIR_LOGICAL,new_dir_desc.dsc$a_pointer);" $ WO " if (strlen(new_dev_desc.dsc$a_pointer) == 0) fatal(UD$NOBACK);" $ WO " if (strlen(new_dir_desc.dsc$a_pointer) == 0) fatal(UD$NOBACK);" $ WO " new_dev_desc.dsc$w_length = strlen(new_dev_desc.dsc$a_pointer);" $ WO " new_dir_desc.dsc$w_length = strlen(new_dir_desc.dsc$a_pointer);" $ WO " }" $ WO " if ((option.symbol == false) && (option.logical == false)) { /* really set default */" $ WO " set_new_directory(&new_dir_desc,&new_dev_desc,&old_dir_desc,&old_dev_desc);" $ WO " } else {" $ WO " if (option.symbol == true) { /* just assign to symbol */" $ WO " strcpy(symbol_equiv,new_dev_desc.dsc$a_pointer);" $ WO " strcat(symbol_equiv,new_dir_desc.dsc$a_pointer);" $ WO " set_symbol(option.symbol_name,symbol_equiv);" $ WO " } " $ WO " if (option.logical == true) { /* assign to logical name */" $ WO " strcpy(logical_equiv,new_dev_desc.dsc$a_pointer);" $ WO " strcat(logical_equiv,new_dir_desc.dsc$a_pointer);" $ WO " set_logical(option.logical_name,logical_equiv);" $ WO " }" $ WO " }" $ WO " if (option.quiet == false) /* print message? */" $ WO " printf (""%s%s --> %s%s\n"", old_dev_desc.dsc$a_pointer, " $ WO " old_dir_desc.dsc$a_pointer,new_dev_desc.dsc$a_pointer," $ WO " new_dir_desc.dsc$a_pointer);" $ WO "}" $ WO "" $ WO "/****************************************************************" $ WO " * set_new_directory: set default to the new directory *" $ WO " ****************************************************************/" $ WO "void set_new_directory(new_dir,new_dev,old_dir,old_dev)" $ WO "struct dsc$descriptor *new_dir,*new_dev,*old_dir, *old_dev;" $ WO "{" $ WO " unsigned short length; /* length of old directory */" $ WO " unsigned long status; /* status of service calls */" $ WO "" $ WO " get_logical(""SYS$DISK"",old_dev->dsc$a_pointer);" $ WO " old_dev->dsc$w_length = strlen(old_dev->dsc$a_pointer);" $ WO " if ((status = sys$setddir(new_dir,&length,old_dir)) != RMS$_NORMAL)" $ WO " exit(status);" $ WO " set_logical (""SYS$DISK"",new_dev->dsc$a_pointer);" $ WO " set_logical (BACK_DEV_LOGICAL,old_dev->dsc$a_pointer);" $ WO " set_logical (BACK_DIR_LOGICAL,old_dir->dsc$a_pointer);" $ WO "}" $ WO "" $ WO "" $ WO "/************************************************************************" $ WO " * get_user_directory: get the specified user''SQ's default dev/dir *" $ WO " ************************************************************************/" $ WO "void get_user_directory(username,new_dir_desc,new_dev_desc)" $ WO "char *username; /* username to get dir for */" $ WO "struct dsc$descriptor *new_dir_desc; /* put info here */" $ WO "struct dsc$descriptor *new_dev_desc; /* device name only */" $ WO "{" $ WO " char devname[DEVICE_LENGTH]; /* device name */" $ WO " unsigned short devlength; /* length of device name */" $ WO " char dirname[DIR_LENGTH]; /* directory name */" $ WO " unsigned short dirlength; /* length of directory name */" $ WO " struct dsc$descriptor username_desc; /* username */" $ WO " unsigned long status; /* status of service calls */" $ WO " int j; /* lcv */" $ WO "#ifdef __DECC" $ WO "#pragma __nostandard" $ WO "#endif" $ WO " item_list_3 item_list[] = {" $ WO " {32, UAI$_DEFDEV, &devname, &devlength}," $ WO " {64, UAI$_DEFDIR, &dirname, &dirlength}," $ WO " {0,0,0,0}};" $ WO "#ifdef __DECC" $ WO "#pragma __standard" $ WO "#endif" $ WO "" $ WO " username_desc.dsc$w_length = strlen(username);" $ WO " username_desc.dsc$b_dtype = DSC$K_DTYPE_T;" $ WO " username_desc.dsc$b_class = DSC$K_CLASS_S;" $ WO " username_desc.dsc$a_pointer = username;" $ WO "" $ WO " if ((status = sys$getuai(0,0,&username_desc,item_list,0,0,0)) != SS$_NORMAL)" $ WO " exit(status);" $ WO " new_dir_desc->dsc$a_pointer[0] = ''SQ'\0''SQ';" $ WO " for (j=1; j<=(int) devname[0]; j++) {" $ WO " new_dev_desc->dsc$a_pointer[j-1] = devname[j];" $ WO " }" $ WO " new_dev_desc->dsc$w_length = (unsigned short) devname[0];" $ WO " new_dev_desc->dsc$a_pointer[new_dev_desc->dsc$w_length] = ''SQ'\0''SQ';" $ WO " for (j=1; j<=(int) dirname[0]; j++) " $ WO " new_dir_desc->dsc$a_pointer[j-1] = dirname[j];" $ WO " new_dir_desc->dsc$w_length = (unsigned short) dirname[0];" $ WO " new_dir_desc->dsc$a_pointer[new_dir_desc->dsc$w_length] = ''SQ'\0''SQ';" $ WO "}" $ WO "" $ WO "" $ WO "/************************************************************************" $ WO " * parse: parse command line for arguments. *" $ WO " ************************************************************************/" $ WO "void parse () {" $ WO " boolean version; /* just looking for version #? */" $ WO " char symbol_value[MAX_SYMBOL_LENGTH+1]; /* get symbol name */" $ WO " short symbol_length; /* length of symbol name */" $ WO " char logical_value[MAX_SYMBOL_LENGTH+1]; /* get logical name */" $ WO " short logical_length; /* length of logical name */" $ WO " char username[MAX_DESC_LENGTH+1]; /* get username */" $ WO " short username_length; /* length of username */" $ WO "" $ WO " option.username[0] = ''SQ'\0''SQ';" $ WO " option.symbol_name[0] = ''SQ'\0''SQ';" $ WO " option.logical_name[0] = ''SQ'\0''SQ';" $ WO " cli_parse_command_line(""UD"",&UD_CLD_TABLE);" $ WO " cli_check_qualifier(""VERSION"",&version);" $ WO " if (version == true)" $ WO " fatal(UD$VERSION,VERSION);" $ WO " cli_check_qualifier(""BACK"",&option.back);" $ WO " cli_check_qualifier(""SYMBOL"",&option.symbol);" $ WO " if (option.symbol == true) {" $ WO " cli_get_value(""SYMBOL"",&symbol_value);" $ WO " symbol_value[MAX_SYMBOL_LENGTH] = ''SQ'\0''SQ';" $ WO " symbol_length = MAX_SYMBOL_LENGTH;" $ WO " while (symbol_value[--symbol_length] == ''SQ' ''SQ');" $ WO " symbol_value[symbol_length] = ''SQ'\0''SQ';" $ WO " strcpy (option.symbol_name,symbol_value);" $ WO " }" $ WO " cli_check_qualifier(""DEFINE"",&option.logical);" $ WO " if (option.logical == true) {" $ WO " cli_get_value(""DEFINE"",&logical_value);" $ WO " logical_value[MAX_SYMBOL_LENGTH] = ''SQ'\0''SQ';" $ WO " logical_length = MAX_SYMBOL_LENGTH;" $ WO " while (logical_value[--logical_length] == ''SQ' ''SQ');" $ WO " logical_value[logical_length] = ''SQ'\0''SQ';" $ WO " strcpy (option.logical_name,logical_value);" $ WO " }" $ WO " cli_check_qualifier(""QUIET"",&option.quiet);" $ WO " if (option.symbol) option.quiet = true;" $ WO " if (option.logical) option.quiet = true;" $ WO " if (option.back == false) {" $ WO " cli_get_value(""P1"",&username);" $ WO " username[USERNAME_LENGTH] = ''SQ'\0''SQ';" $ WO " username_length = USERNAME_LENGTH;" $ WO " while (username[--username_length] == ''SQ' ''SQ');" $ WO " username[username_length] = ''SQ'\0''SQ';" $ WO " strcpy (option.username,username);" $ WO " }" $ WO "}" $ WO "" $ WO "" $ WO "" $ WO "/************************************************************************" $ WO " * fatal: signal an error condition. *" $ WO " ************************************************************************/" $ WO "void fatal (error_type, string)" $ WO "unsigned long error_type;" $ WO "char *string;" $ WO "{" $ WO " struct dsc$descriptor string_desc;" $ WO "" $ WO " string_desc.dsc$w_length = strlen(string);" $ WO " string_desc.dsc$b_dtype = DSC$K_DTYPE_T;" $ WO " string_desc.dsc$b_class = DSC$K_CLASS_S;" $ WO " string_desc.dsc$a_pointer = string;" $ WO " if (strlen (string) > 0)" $ WO " lib$signal (error_type,1,&string_desc);" $ WO " else" $ WO " lib$signal (error_type);" $ WO " exit (1);" $ WO "}" $ WO "" $ WO "/************************************************************************" $ WO " * get_logical: get a process-level logical name translation *" $ WO " ************************************************************************/" $ WO "void get_logical (logical_name, equiv)" $ WO "char *logical_name;" $ WO "char *equiv;" $ WO "{" $ WO " struct dsc$descriptor logical_name_desc;" $ WO " $DESCRIPTOR(table_name,""LNM$PROCESS"");" $ WO " char equiv_name[EQUIV_LENGTH+1];" $ WO " unsigned short equiv_length;" $ WO " unsigned long status;" $ WO "#ifdef __DECC" $ WO "#pragma __nostandard" $ WO "#endif" $ WO " item_list_3 item_list[] = {" $ WO " {255,LNM$_STRING,&equiv_name,&equiv_length}," $ WO " {0,0,0,0}};" $ WO "#ifdef __DECC" $ WO "#pragma __standard" $ WO "#endif" $ WO "" $ WO " logical_name_desc.dsc$w_length = strlen(logical_name);" $ WO " logical_name_desc.dsc$b_dtype = DSC$K_DTYPE_T;" $ WO " logical_name_desc.dsc$b_class = DSC$K_CLASS_S;" $ WO " logical_name_desc.dsc$a_pointer = logical_name;" $ WO " if ((status = sys$trnlnm(0,&table_name,&logical_name_desc,0,item_list)) != SS$_NORMAL)" $ WO " exit(status);" $ WO " equiv_name[equiv_length] = ''SQ'\0''SQ';" $ WO " strcpy(equiv, equiv_name);" $ WO "}" $ WO "" $ WO "/************************************************************************" $ WO " * set_logical: set a process-level logical name. *" $ WO " ************************************************************************/" $ WO "void set_logical (logical_name, equiv)" $ WO "char *logical_name;" $ WO "char *equiv;" $ WO "{" $ WO " struct dsc$descriptor logical_name_desc;" $ WO " struct dsc$descriptor equiv_desc;" $ WO " unsigned long status;" $ WO "" $ WO " logical_name_desc.dsc$w_length = strlen(logical_name);" $ WO " logical_name_desc.dsc$b_dtype = DSC$K_DTYPE_T;" $ WO " logical_name_desc.dsc$b_class = DSC$K_CLASS_S;" $ WO " logical_name_desc.dsc$a_pointer = logical_name;" $ WO " equiv_desc.dsc$w_length = strlen(equiv);" $ WO " equiv_desc.dsc$b_dtype = DSC$K_DTYPE_T;" $ WO " equiv_desc.dsc$b_class = DSC$K_CLASS_S;" $ WO " equiv_desc.dsc$a_pointer = equiv;" $ WO " switch (status = lib$set_logical(&logical_name_desc,&equiv_desc)) {" $ WO " case SS$_NORMAL:" $ WO " case SS$_SUPERSEDE:" $ WO " break;" $ WO " default:" $ WO " exit(status);" $ WO " }" $ WO "}" $ WO "" $ WO "/************************************************************************" $ WO " * set_symbol: set a CLI symbol name *" $ WO " ************************************************************************/" $ WO "void set_symbol (symbol_name,equiv)" $ WO "char *symbol_name; /* name of symbol to set */" $ WO "char *equiv; /* value of symbol */" $ WO "{" $ WO " struct dsc$descriptor symbol_desc;" $ WO " struct dsc$descriptor equiv_desc;" $ WO " unsigned long status;" $ WO "" $ WO " symbol_desc.dsc$w_length = strlen(symbol_name); /* set up descriptors */" $ WO " symbol_desc.dsc$b_dtype = DSC$K_DTYPE_T;" $ WO " symbol_desc.dsc$b_class = DSC$K_CLASS_S;" $ WO " symbol_desc.dsc$a_pointer = symbol_name;" $ WO " equiv_desc.dsc$w_length = strlen(equiv); /* set up descriptors */" $ WO " equiv_desc.dsc$b_dtype = DSC$K_DTYPE_T;" $ WO " equiv_desc.dsc$b_class = DSC$K_CLASS_S;" $ WO " equiv_desc.dsc$a_pointer = equiv;" $ WO " if ((status = lib$set_symbol(&symbol_desc,&equiv_desc)) != SS$_NORMAL)" $ WO " exit(status);" $ WO "" $ WO "}" $ WO "" $ WO " $ Close/NoLog OutFile $ Exit $ EndSubRoutine ! Extract_UD_C $! $ Extract_UD_DOC: SubRoutine $ Write SYS$OUTPUT "Extracting UD.DOC..." $ WO := Write OutFile $ SQ = "'" $ SQ2 = SQ + SQ $ Close/NoLog OutFile $ Open/Write/Share OutFile UD.DOC $ WO "" $ WO "" $ WO " User Directory (UD)" $ WO " version 1.1" $ WO "" $ WO " Copyright © 2000 by Richard D. Johnson" $ WO " All Rights Reserved" $ WO "" $ WO "" $ WO "Disclaimer: This software has been released to public domain, and may be" $ WO "freely copied, distributed, and modified. This software is provided as is," $ WO "free of charge. The author assumes no responsibility for the use of this" $ WO "software." $ WO "" $ WO "" $ WO "UD is a utility that automatically sets your default directory to the login" $ WO "directory of a specified user, as defined in the system user authorization" $ WO "file. UD can optionally place this information into a DCL symbol." $ WO "" $ WO "Requirements: OpenVMS (VAX or Alpha) 6.1 or above; DECC or VAXC compiler." $ WO "GRPPRV or SYSPRV privileges are required, or image must be installed (see" $ WO "below)." $ WO "" $ WO "" $ WO "Building the Image: This software is distributed via a build command procedure." $ WO "Simply download the build procedure (BUILD_UD.COM) and execute it. The" $ WO "procedure will extract and compile the source code, and link the program" $ WO "image, UD.EXE:" $ WO "" $ WO " $ @BUILD_UD" $ WO " Extracting CLI.C" $ WO " Extracting CLI.H" $ WO " Extracting MESSAGE.H" $ WO " Extracting MESSAGE.MSG" $ WO " Extracting UD.C" $ WO " Extracting UD_CLD.CLD" $ WO " Extracting UD.H" $ WO " Extracting UD.HLP" $ WO " Compiling with DECC Compiler..." $ WO "" $ WO "Once the image has been compiled and linked by the build procedure, define" $ WO "a foreign command to allow your process to execute it:" $ WO "" $ WO " $ UD :== $MYDISK:[MYDIR]UD.EXE" $ WO "" $ WO "Your process will require GRPPRV to change your default directory to the" $ WO "login directory of someone else in your UIC group. SYSPRV is required to" $ WO "change your default directory to anyone else. The image may be installed with" $ WO "privileges to allow all users to use the utility. Note: This will not allow" $ WO "users to access the destination directory unless they already have the ability" $ WO "to do so." $ WO "" $ WO " $ INSTALL" $ WO " INSTALL> ADD/OPEN/HEADER/SHARE/PRIV=SYSPRV MYDISK:[MYDIR]UD.EXE" $ WO "" $ WO "" $ WO "Usage" $ WO "" $ WO "In its simplest form, simply execute UD, passing as a parameter the username" $ WO "you wish to change your default directory to. For example:" $ WO "" $ WO " $ UD JSMITH" $ WO " SYS$COMMON:[SYSMGR] --> DISK$USERA:[USERS.JSMITH]" $ WO "" $ WO "In this example, your default directory was changed from SYS$COMMON:[SYSMGR]" $ WO "to DISK$USERA:[USERS.JSMITH], which is the default device and directory" $ WO "for the account JSMITH. To easily get back to the previous directory," $ WO "use the /BACK qualifier:" $ WO "" $ WO " $ UD JSMITH" $ WO " SYS$COMMON:[SYSMGR] --> DISK$USERA:[USERS.JSMITH]" $ WO " $ SHOW DEFAULT" $ WO " DISK$USERA:[USERS.JSMITH]" $ WO " $ UD /BACK" $ WO " DISK$USERA:[USERS.JSMITH] --> SYS$COMMON:[SYSMGR]" $ WO "" $ WO "To eliminate the status message, use the /QUIET qualifier:" $ WO "" $ WO " $ SHOW DEFAULT" $ WO " SYS$COMMON:[SYSMGR]" $ WO " $ UD /QUIET JSMITH" $ WO " $ SHOW DEFAULT" $ WO " DISK$USERA:[USERS.JSMITH]" $ WO " $ UD /QUIET /BACK" $ WO " $ SHOW DEFAULT" $ WO " SYS$COMMON:[SYSMGR]" $ WO "" $ WO "The /SYMBOL and /DEFINE qualifiers cause UD to NOT change your default " $ WO "directory; Instead, the user''SQ's default device and directory are placed in the " $ WO "specified DCL symbol or logical name:" $ WO "" $ WO " $ SHOW DEFAULT" $ WO " SYS$COMMON:[SYSMGR]" $ WO " $ UD /SYMBOL=JDEF JSMITH" $ WO " $ SHOW DEFAULT" $ WO " SYS$COMMON:[SYSMGR]" $ WO " $ SHOW SYMBOL JDEF" $ WO " JDEF = ""DISK$USERA:[USERS.JSMITH]" $ WO " $ UD /DEFINE=THERE BSMITH" $ WO " $ SHOW DEFAULT" $ WO " SYS$COMMON:[SYSMGR]" $ WO " $ DIR THERE:LOGIN.COM" $ WO "" $ WO " Directory USER04:[USERS.BSMITH]" $ WO "" $ WO " LOGIN.COM;17" $ WO "" $ WO " Total of 1 file." $ WO "" $ WO "" $ WO "" $ WO "Command Syntax" $ WO "" $ WO " UD username" $ WO " UD /BACK" $ WO " UD /VERSION" $ WO "" $ WO "Command Qualifiers" $ WO "" $ WO " /BACK" $ WO "" $ WO " When the /BACK qualifier is given, UD sets default to the directory" $ WO " that was the default prior to the last UD command. You must have" $ WO " already used the UD utility to change your default directory prior" $ WO " to using the /BACK qualifier. Do not specify a username parameter" $ WO " with the /BACK qualifier." $ WO "" $ WO "" $ WO " /SYMBOL=symbol-name" $ WO " /NOSYMBOL (default)" $ WO "" $ WO " The /SYMBOL qualifier causes UD to set the specified local CLI" $ WO " symbol with the specified user''SQ's login directory. When /SYMBOL is" $ WO " specified, UD does not change your current default directory." $ WO "" $ WO "" $ WO " /DEFINE=logical-name" $ WO " /NODEFINE (default)" $ WO "" $ WO " The /DEFINE qualifier causes UD to define the specified process-level" $ WO " logical name with the specified user''SQ's login directory. When" $ WO " /DEFINE is specified, UD does not change your current default" $ WO " directory." $ WO "" $ WO " /QUIET" $ WO " /NOQUIET (default)" $ WO "" $ WO " Normally, UD displays a status line indicating the old default" $ WO " directory, and the new default directory after it has been set." $ WO " The /QUIET qualifier suppresses this output." $ WO "" $ WO "" $ WO " /VERSION" $ WO "" $ WO " Displays the current version of UD. Do not specify the username" $ WO " parameter or any other qualifiers with /VERSION." $ WO "" $ WO " $ Close/NoLog OutFile $ Exit $ EndSubRoutine ! Extract_UD_DOC $! $ Extract_UD_H: SubRoutine $ Write SYS$OUTPUT "Extracting UD.H..." $ WO := Write OutFile $ SQ = "'" $ SQ2 = SQ + SQ $ Close/NoLog OutFile $ Open/Write/Share OutFile UD.H $ WO "/************************************************************************" $ WO " * User Directory (UD) *" $ WO " * version 1.1 *" $ WO " * Copyright © 2000 by Richard D. Johnson *" $ WO " * All Rights Reserved *" $ WO " * *" $ WO " * This software has been release to public domain, and may be freely *" $ WO " * copied, distributed, and modified. This software is provided as is, *" $ WO " * free of charge. The author assumes no responsibility for the use *" $ WO " * of this software. *" $ WO " * *" $ WO " * Richware: http://richj.home.mindspring.com/richware/index.html *" $ WO " * *" $ WO " ************************************************************************" $ WO " * Revision History *" $ WO " * *" $ WO " * 10-DEC-1998 RDJ Module Completion. *" $ WO " * *" $ WO " * 20-JAN-2000 RDJ Added support for /DEFINE qualifier to *" $ WO " * define a logical name instead of *" $ WO " * actually setting default. *" $ WO " ************************************************************************/" $ WO "" $ WO "" $ WO "#define VERSION ""1.1"" /* current version number */" $ WO "#define MAX_DESC_LENGTH 255 /* max length of descriptors */" $ WO "#define USERNAME_LENGTH 12 /* max length of username */" $ WO "#define DEVICE_LENGTH 32 /* max length of device name */" $ WO "#define DIR_LENGTH 64 /* max length of dir name */" $ WO "#define MAX_SYMBOL_LENGTH 255 /* max length of symbol name */" $ WO "#define EQUIV_LENGTH 255 /* length of logical equiv */" $ WO "" $ WO "#define BACK_DEV_LOGICAL ""UD$BACK_DEV"" /* process logical names */" $ WO "#define BACK_DIR_LOGICAL ""UD$BACK_DIR"" /* for saving /BACK info */" $ WO "" $ WO "typedef enum {false, true} boolean; /* define boolean type */" $ WO "" $ WO "struct option_struct { /* current options */" $ WO " char username[USERNAME_LENGTH+1]; /* username parameter */" $ WO " boolean symbol; /* define symbol? */" $ WO " boolean logical; /* define logical? */" $ WO " char symbol_name[MAX_SYMBOL_LENGTH+1];/* name of symbol */" $ WO " char logical_name[MAX_SYMBOL_LENGTH+1]; /* name of logical name */" $ WO " boolean quiet; /* display information msgs? */" $ WO " boolean version; /* display version number? */" $ WO " boolean back; /* go back to prev directory */" $ WO "};" $ WO "" $ WO "typedef struct { /* item list 2 */" $ WO " short buffer_length; /* length of input buffer */" $ WO " short item_code; /* input/output item code */" $ WO " void *buffer_address; /* address of buffer */" $ WO "} item_list_2;" $ WO "" $ WO "typedef struct { /* item list 3 */" $ WO " short buffer_length; /* length of input buffer */" $ WO " short item_code; /* input/output item code */" $ WO " void *buffer_address; /* address of buffer */" $ WO " void *return_length_address; /* length of output buffer */" $ WO "} item_list_3;" $ WO "" $ WO "extern UD_CLD_TABLE();" $ WO "void parse();" $ WO "void fatal();" $ WO "void get_user_directory();" $ WO "void set_new_directory();" $ WO "void get_logical();" $ WO "void set_logical();" $ WO "void set_symbol();" $ WO " $ Close/NoLog OutFile $ Exit $ EndSubRoutine ! Extract_UD_H $! $ Extract_UD_HLP: SubRoutine $ Write SYS$OUTPUT "Extracting UD.HLP..." $ WO := Write OutFile $ SQ = "'" $ SQ2 = SQ + SQ $ Close/NoLog OutFile $ Open/Write/Share OutFile UD.HLP $ WO "1 UD" $ WO "" $ WO " Sets default to the login directory of the specified user, as defined" $ WO " by the user''SQ's default device and directory fields in the system" $ WO " user authorization file (SYSUAF)." $ WO "" $ WO " Optionally defines a DCL symbol containing this information, instead" $ WO " if actually setting a new default directory." $ WO "" $ WO " Format" $ WO "" $ WO " UD username" $ WO " UD /BACK" $ WO " UD /VERSION" $ WO "" $ WO "" $ WO "2 Command_Qualifiers" $ WO "" $ WO "/BACK" $ WO " /BACK" $ WO "" $ WO " When the /BACK qualifier is given, UD sets default to the directory" $ WO " that was the default prior to the last UD command. You must have" $ WO " already used the UD utility to change your default directory prior" $ WO " to using the /BACK qualifier. Do not specify a username parameter" $ WO " with the /BACK qualifier." $ WO "" $ WO "/SYMBOL" $ WO "" $ WO " /SYMBOL=symbol-name" $ WO " /NOSYMBOL (default)" $ WO "" $ WO " The /SYMBOL qualifier causes UD to set the specified local CLI" $ WO " symbol with the specified user''SQ's login directory. When /SYMBOL is" $ WO " specified, UD does not change the current default directory." $ WO "" $ WO "/DEFINE" $ WO "" $ WO " /DEFINE=logical-name" $ WO " /NODEFINE (default)" $ WO "" $ WO " The /DEFINE qualifier causes UD to set the specified process-level" $ WO " logical name with the specified user''SQ's login directory. When " $ WO " /DEFINE is specified, UD does not change the current default" $ WO " directory." $ WO "" $ WO "/QUIET" $ WO "" $ WO " /QUIET" $ WO " /NOQUIET (default)" $ WO "" $ WO " Normally, UD displays a status line indicating the old default" $ WO " directory, and the new default directory after it has been set." $ WO " The /QUIET qualifier suppresses this output." $ WO "" $ WO "/VERSION" $ WO "" $ WO " /VERSION" $ WO "" $ WO " Displays the current version of UD. Do not specify the username" $ WO " parameter or any other qualifiers with /VERSION." $ WO "" $ WO " $ Close/NoLog OutFile $ Exit $ EndSubRoutine ! Extract_UD_HLP $! $ Extract_UD_CLD_CLD: SubRoutine $ Write SYS$OUTPUT "Extracting UD_CLD.CLD..." $ WO := Write OutFile $ SQ = "'" $ SQ2 = SQ + SQ $ Close/NoLog OutFile $ Open/Write/Share OutFile UD_CLD.CLD $ WO "" $ WO "" $ WO "Module UD_CLD_TABLE" $ WO "" $ WO "Define Verb UD" $ WO " Qualifier BACK, NonNegatable,Syntax=BACK_SYNTAX" $ WO " Parameter P1, Value(Required,Type=$Quoted_String),Prompt=""Username""" $ WO " Qualifier SYMBOL, Negatable,Value(Required)" $ WO " Qualifier DEFINE, Negatable,Value(Required)" $ WO " Qualifier QUIET, Negatable" $ WO " Qualifier VERSION, NonNegatable," $ WO " Syntax=VERSION_SYNTAX" $ WO " " $ WO " Disallow VERSION and (SYMBOL or DEFINE or QUIET or BACK)" $ WO "" $ WO "" $ WO "Define Syntax BACK_SYNTAX" $ WO " NoParameters" $ WO " Qualifier BACK, NonNegatable,Default" $ WO " Qualifier SYMBOL, Negatable,Value(Required)" $ WO " Qualifier DEFINE, Negatable,Value(Required)" $ WO " Qualifier QUIET, Negatable" $ WO " Qualifier VERSION, NonNegatable" $ WO "" $ WO "Define Syntax VERSION_SYNTAX" $ WO " NoParameters" $ WO " Qualifier VERSION NonNegatable,Default" $ WO " $ Close/NoLog OutFile $ Exit $ EndSubRoutine ! Extract_UD_CLD_CLD