diff --git a/.Floppies/A2OSX.BUILD.po b/.Floppies/A2OSX.BUILD.po index cf3bd9c4..2b2a38bd 100644 Binary files a/.Floppies/A2OSX.BUILD.po and b/.Floppies/A2OSX.BUILD.po differ diff --git a/BIN/USERADD.S.txt b/BIN/USERADD.S.txt index 5c91171d..f68a81cf 100644 --- a/BIN/USERADD.S.txt +++ b/BIN/USERADD.S.txt @@ -23,7 +23,7 @@ ZPhStr .BS 1 ZPbStrSecret .BS 1 ZPStrLen .BS 1 ZPStrMax .BS 1 -ArgCount .BS 1 +ArgIndex .BS 1 ArgUsername .BS 1 ZPStrPtr .BS 2 ZS.END .ED @@ -53,6 +53,7 @@ L.MSG.USAGE .DA MSG.USAGE L.MSG.ROOTPWD1 .DA MSG.ROOTPWD1 L.MSG.ROOTPWD2 .DA MSG.ROOTPWD2 L.MSG.MISMATCH .DA MSG.MISMATCH +L.MSG.DUP .DA MSG.DUP L.MSG.BS .DA MSG.BS L.MSG.CRLF .DA MSG.CRLF J.CS.RUN.CheckArg @@ -106,7 +107,7 @@ CS.RUN >LDYAI S.PW jsr CS.RUN.CheckArg bcs .9 - jsr CS.RUN.CheckDir + jsr CS.RUN.MkDir bcs .99 >LDYA pData @@ -233,8 +234,8 @@ CS.RUN.GetStr stz ZPStrLen .9 rts *-------------------------------------- -CS.RUN.CheckArg inc ArgCount - lda ArgCount +CS.RUN.CheckArg inc ArgIndex + lda ArgIndex >SYSCALL ArgV bcs .8 >STYA ZPStrPtr @@ -262,7 +263,7 @@ CS.RUN.CheckArg inc ArgCount jmp (J.CS.RUN.CheckArg,x) .4 lda ArgUsername - bne .9 + bne CS.RUN.CheckArg.9 lda pData clc @@ -281,30 +282,100 @@ CS.RUN.CheckArg inc ArgCount iny cpy #16 bne .5 - bra .9 + bra CS.RUN.CheckArg.9 -.6 lda ArgCount +.6 lda #'/' + sta (ZPPWPtr),y + + >PUSHW ZPPWPtr + lda ArgIndex sta ArgUsername + >SYSCALL ArgV + + >SYSCALL GetPWName + bcc .9 + bra CS.RUN.CheckArg .8 lda ArgUsername - beq .9 + beq CS.RUN.CheckArg.9 clc rts -.9 lda #E.SYN +.9 >PUSHBI 0 + >LDYA L.MSG.DUP + >SYSCALL printf + +CS.RUN.CheckArg.9 + lda #E.SYN sec rts - -CS.RUN.CheckArg.C -CS.RUN.CheckArg.D +*-------------------------------------- CS.RUN.CheckArg.P -CS.RUN.CheckArg.S + inc ArgIndex + lda ArgIndex + >SYSCALL ArgV + bcs CS.RUN.CheckArg.9 + phy + pha + >PUSHEA.G S.PW.PASSWD + pla + ply + >PUSHYA + >LIBCALL hLIBCRYPT,LIBCRYPT.MD5 jmp CS.RUN.CheckArg *-------------------------------------- -CS.RUN.CheckDir - clc +CS.RUN.CheckArg.C + inc ArgIndex + lda ArgIndex + >SYSCALL ArgV + bcs CS.RUN.CheckArg.9 + ldx #S.PW.GECOS + bra CS.RUN.CheckArg.Next +*-------------------------------------- +CS.RUN.CheckArg.D + inc ArgIndex + lda ArgIndex + >SYSCALL ArgV + bcs CS.RUN.CheckArg.9 + ldx #S.PW.DIR + bra CS.RUN.CheckArg.Next +*-------------------------------------- +CS.RUN.CheckArg.S + inc ArgIndex + lda ArgIndex + >SYSCALL ArgV + bcs CS.RUN.CheckArg.9 + ldx #S.PW.SHELL + +CS.RUN.CheckArg.Next + >STYA ZPStrPtr +* clc + txa + adc pData + sta ZPPWPtr + lda pData+1 + adc #0 + sta ZPPWPtr+1 + + ldy #$ff + +.1 iny + lda (ZPStrPtr),y + sta (ZPPWPtr),y + beq .8 + cpy #64 + bne .1 + + lda #0 + sta (ZPPWPtr),y + +.8 jmp CS.RUN.CheckArg +*-------------------------------------- +CS.RUN.MkDir >LEA.G S.PW.DIR + >SYSCALL MKDir + rts *-------------------------------------- * Called if option S.PS.F.EVENT enabled in Header @@ -352,11 +423,12 @@ MSG.CRLF .AZ "\r\n" MSG.ROOTPWD1 .AZ "\r\nPlease enter ROOT password : " MSG.ROOTPWD2 .AZ "\r\nPlease retype ROOT password : " MSG.MISMATCH .AZ "\r\nPasswords mismatch...\r\n" +MSG.DUP .AZ "\r\nDuplicate username...\r\n" MSG.BS .DA #C.BS,#C.SPACE,#C.BS,#0 *-------------------------------------- PW.ROOT .AS "ROOT" .BS 17-4 - .HS D41D8CD98F00B204E9800998ECF8427E00 + .AZ "D41D8CD98F00B204E9800998ECF8427E" .DA #0 UID .DA #0 GID .AS "Root User" @@ -367,7 +439,7 @@ PW.ROOT .AS "ROOT" .BS 65-13 *-------------------------------------- PW.DEFAULT .BS 17 NAME - .HS D41D8CD98F00B204E9800998ECF8427E00 + .AZ "D41D8CD98F00B204E9800998ECF8427E" .DA #0 UID .DA #1 GID .BS 65 GECOS diff --git a/SYS/KERNEL.S.PWDX.txt b/SYS/KERNEL.S.PWDX.txt index 2a8eb73b..7afe1dc9 100644 --- a/SYS/KERNEL.S.PWDX.txt +++ b/SYS/KERNEL.S.PWDX.txt @@ -168,7 +168,12 @@ PWD.PutPW >LDYA ZPPtr2 bcc .5 inc ZPPtr3+1 -.5 jsr PWD.StoreRecord +.5 lda PWD.hDB + stx PWD.hDB + jsr K.Freemem + + + jsr PWD.StoreRecord inc PWD.bDirty clc