home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
nubye
/
nuby-sup.lbr
/
ZCPR3.FQX
/
ZCPR3.FIX
Wrap
Text File
|
1986-06-29
|
3KB
|
122 lines
ZCPR3 FIX
for
3DH and 3FH bytes
=====
03/86 Corrected for proper named directoy use (from John Smith's
Z3&EMX-2.LBR). - Murray Simsolo (516) 825-8465
1986 Original fix - Joubert Berger
=====
The code below is modified from ZCPR3, so you are able to utilize
the CHEKDU savings incorporated in NUBYE, as well as the max
drive/user checking used by many other utilities (i.e. NUKMD, SD,
SFILE, etc). The new code is that which is in lower case - be
sure to comment out the four lines: CPI MAXDISK+1, CPI MAXUSR+1,
JRNC DUSE1 (twice) as shown.
=======================================================================
IF ACCPTDU ;ALLOW DU: FORM
DUSCAN:
XCHG ;PTR IN HL
INX H ;PT TO FIRST BYTE OF FN
MOV A,M ;GET FIRST CHAR
CPI 'A' ;CONVERT POSSIBLE DRIVE SPEC TO NUMBER
JRC DUS1 ;IF LESS THAN 'A', MUST BE DIGIT
;
; SET DISK NUMBER (A=1)
;
SUI 'A'-1 ;CONVERT DRIVE NUMBER TO 1-16
mov b,a ; PUT IN B
lda 003dh ; GET MAX DRIVE
adi 1 ; OFFSET BY ONE TO AGREE
cmp b ; WITHIN RANGE?
mov a,b ; RESTORE DRIVE NUMBER TO A
jrc duse1 ;INVALID DISK NUMBER
;** CPI MAXDISK+1 ;WITHIN RANGE? <==comment out
;** JRNC DUSE1 ;INVALID DISK NUMBER <==comment out
STA TEMPDR ;SET TEMPORARY DRIVE NUMBER
INX H ;PT TO NEXT CHAR
MOV A,M ;SEE IF IT IS A SPACE
CPI ' '
RZ
CALL DIGCK ;CHECK FOR DIGIT
RC
;
; SET USER NUMBER
;
DUS1:
PUSH H ;SAVE PTR TO DIGITS
MVI B,2 ;UP TO 2 DIGITS
DUS1A:
MOV A,M ;CHECK FOR DIGIT OR SPACE
CPI ' ' ;IF SPACE, THEN NO DIGIT
JRZ DUS2
CALL DIGCK ;CHECK FOR DIGIT
JRC DUSE
INX H
DJNZ DUS1A ;COUNT DOWN
MOV A,M ;3RD CHAR
CPI ' ' ;MUST BE SPACE
JRNZ DUSE
DUS2:
POP H
CALL NUM0A ;GET NUMBER
mov b,a ; PUT IT IN B
lda 003fh ; GET MAX NUMBER OF USERS
sui 1 ; CORRECT OFFSET
cmp b ; IS IT WITHIN RANGE?
mov a,b ; RESTORE USER NUMBER IN A
jrc duse1 ; UNALLOWED USER NUMBER
;** CPI MAXUSR+1 ;WITHIN LIMIT? <==comment out
;** JRNC DUSE1 <==comment out
STA TEMPUSR ;SAVE USER NUMBER
XRA A ;SET OK
RET
DUSE: POP H ;CLEAR STACK
;
DUSE1: XRA A
DCR A
RET
;
ENDIF ;ACCPTDU
This is the additional fix which prevents access to a named directory
which references a drive/user combination which exceeds the maximum.
Again, the code to be added is in lower case.
;
; DIR match
;
DIRS4: IF PWCHECK
PUSH D ;SAVE PTR TO DE
LXI B,8 ;PT TO PW
XCHG ;HL PTS TO ENTRY
DAD B
CALL PASSCK ;CHECK FOR PW
POP D ;GET PTR
JNZ DIRSERR
ENDIF ;PWCHECK
;
DCX D ;PT TO USER
LDAX D ;GET USER
mov b,a ; PUT IT IN B
lda 003fh ; GET MAX NUMBER OF USERS
sui 1 ; CORRECT OFFSET
cmp b ; WITHIN RANGE?
mov a,b ; RESTORE USER NUMBER IN A
jrc dirserr ; UNALLOWED USER NUMBER
STA TEMPUSR
DCX D ;PT TO DISK
LDAX D ;GET IT
mov b,a ; PUT IT IN B
lda 003dh ; GET MAX DRIVE
adi 1 ; OFFSET BY ONE TO AGREE
cmp b ; WITHIN RANGE?
mov a,b ; RESTORE DRIVE NUMBER TO A
jrc dirserr ; UNALLOWED DRIVE
STA TEMPDR ;A=1
XRA A ;SET Z
RET