! ----- COPY_PASSWORD_INFO.FUN ----- ! ! ----- FUNCTION TO COPY THE PASSWORD INFO TO ALL OTHER CLUSTER ----- ! ----- NODES ----- ! ! ---------- PASSED: ---------- ! ! ----- USER_NAME = Username whose password data is to be copied ! ! ---------- RETURNED: ---------- ! ! COPY_PASSWORD_INFO returns FALSE if successful, or TRUE ! if any error occurred ! ! ----- Last Change 03/02/94 by Brian Lomasky ----- ! FUNCTION WORD COPY_PASSWORD_INFO %INCLUDE "NUSER.INC" DECLARE WORD FOUND_LOCAL_NODE ! TRUE IF LOCAL NODE NAME FOUND DECLARE WORD I_O_CHNL_SYSUAF ! SYSUAF I/O CHANNEL TO ACCESS DIM LONG SAVED_DATE_OF_PASSWORD_CHANGE(1%) DECLARE WORD SYSUAF_CHNL ! SYSUAF.DAT I/O CHANNEL TO USE DECLARE WORD SYSUAF_RECORD_FOUND! TRUE IF SYSUAF RECORD FOUND COPY_PASSWORD_INFO = TRUE ! ASSUME ERROR STATUS FOUND_LOCAL_NODE = FALSE ! ASSUME LOCAL NODE NOT FOUND ! ----- FOR EACH OPEN SYSUAF FILE: ----- I_O_CHNL_SYSUAF = 0% WHILE I_O_CHNL_SYSUAF < SYSUAF_COUNTER I_O_CHNL_SYSUAF = I_O_CHNL_SYSUAF + 1% ! ----- SKIP IF SYSUAF UNAVAILABLE ----- IF TRM$(SYSUAF_SPECS(I_O_CHNL_SYSUAF)) = "" THEN PRINT PRINT "Warning - Skipping node " + & TRM$(SYSUAF_NODES( & I_O_CHNL_SYSUAF)) + & " since it's unavailable..." + BEL ITERATE END IF IF DEBUG_MODE THEN PRINT "DEBUG>Reading password for " + & TRM$(SYSUAF_NODES(I_O_CHNL_SYSUAF)) END IF ! ----- CALCULATE THE REAL I/O CHANNEL ----- SYSUAF_CHNL = I_O_CHNL_SYSUAF + 49% SYSUAF_RECORD_FOUND = TRUE WHEN ERROR IN GET #SYSUAF_CHNL, KEY #0% EQ USER_NAME USE IF ERR = BUCKET_LOCKED THEN SLEEP 1% RETRY END IF IF ERR = REC_NOT_FOUND THEN SYSUAF_RECORD_FOUND = FALSE CONTINUE END IF EXIT HANDLER END WHEN IF NOT SYSUAF_RECORD_FOUND THEN ! ----- NO MESSAGE IF ONLY ALLOWED TO ----- ! ----- CHANGE CLUSTER-WIDE PASSWORD ----- IF HELD_DIVS_CTR <> 0% OR HELD_DBS_CTR & <> 0% OR PRIVILEGED THEN PRINT PRINT "Warning - Skipping" + & " node " + & TRM$(SYSUAF_NODES( & I_O_CHNL_SYSUAF)) + & " since you do not" + & " have an account on" + & " that node..." + BEL END IF ITERATE END IF ! ----- IF LOCAL NODE, EXTRACT ITEMS TO TRANSFER ----- IF I_O_CHNL_SYSUAF = 1% THEN IF DEBUG_MODE THEN PRINT "DEBUG> Storing" + & " password from local node" END IF FOUND_LOCAL_NODE = TRUE SAVED_PASSWORD = PASSWORD SAVED_RANDOM_PASSWORD_SEED = & RANDOM_PASSWORD_SEED SAVED_ENCRYPTION_ALGORITHM = & ENCRYPTION_ALGORITHM SAVED_DATE_OF_PASSWORD_CHANGE(0%) = & DATE_OF_PASSWORD_CHANGE(0%) SAVED_DATE_OF_PASSWORD_CHANGE(1%) = & DATE_OF_PASSWORD_CHANGE(1%) UNLOCK #SYSUAF_CHNL ! ----- IF REMOTE NODE, UPDATE TRANSFERRED ITEMS ----- ELSE IF NOT FOUND_LOCAL_NODE THEN PRINT PRINT "Error - Skipping node " & + TRM$(SYSUAF_NODES( & I_O_CHNL_SYSUAF)) + & " since the local node" & + " was not found" + BEL ITERATE END IF ! ----- TRANSFER PASSWORD INFO ----- IF DEBUG_MODE THEN PRINT "DEBUG> Storing saved" + & " password on node " + & TRM$(SYSUAF_NODES( & I_O_CHNL_SYSUAF)) END IF PASSWORD = SAVED_PASSWORD RANDOM_PASSWORD_SEED = & SAVED_RANDOM_PASSWORD_SEED ENCRYPTION_ALGORITHM = & SAVED_ENCRYPTION_ALGORITHM DATE_OF_PASSWORD_CHANGE(0%) = & SAVED_DATE_OF_PASSWORD_CHANGE(0%) DATE_OF_PASSWORD_CHANGE(1%) = & SAVED_DATE_OF_PASSWORD_CHANGE(1%) ! ----- TURN OFF ANY PWD_EXPIRED BIT ----- FLAGS(1%) = FLAGS(1%) AND NOT 2% UPDATE #SYSUAF_CHNL UNLOCK #SYSUAF_CHNL END IF NEXT COPY_PASSWORD_INFO = FALSE ! RETURN SUCCESS STATUS END FUNCTION