2019-10-11 13:06:33 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
2020-02-14 07:21:56 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # GetPWUID
|
|
|
|
|
* ## C
|
2020-02-17 16:55:02 +00:00
|
|
|
|
* `int getpwuid(short int uid, S.PW *passwd);`
|
2020-02-14 07:21:56 +00:00
|
|
|
|
* ## ASM
|
2020-02-17 16:55:02 +00:00
|
|
|
|
* `PUSHB uid`
|
2020-02-14 07:21:56 +00:00
|
|
|
|
* `>PUSHW passwd`
|
|
|
|
|
* `>SYSCALL getpwuid`
|
|
|
|
|
* ## RETURN VALUE
|
|
|
|
|
*\--------------------------------------
|
2020-02-17 16:55:02 +00:00
|
|
|
|
K.GetPWUID
|
2020-03-13 07:15:58 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # GetGRGID
|
|
|
|
|
* ## C
|
|
|
|
|
* `int getgrgid(short int gid, S.GRP *group);`
|
|
|
|
|
* ## ASM
|
|
|
|
|
* `>PUSHB gid`
|
|
|
|
|
* `>PUSHW group`
|
|
|
|
|
* `>SYSCALL getpwname`
|
|
|
|
|
* ## RETURN VALUE
|
|
|
|
|
*\--------------------------------------
|
2020-02-17 16:55:02 +00:00
|
|
|
|
K.GetGRGID >PULLW FORPNT
|
2020-03-13 07:15:58 +00:00
|
|
|
|
>PULLB ZPPtr1+1 UID/GID
|
2019-10-11 13:06:33 +00:00
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
jmp K.SYSCALL.JMPX
|
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # GetPWName
|
|
|
|
|
* ## C
|
2020-02-17 16:55:02 +00:00
|
|
|
|
* `int getpwname(const char* name, S.PW *passwd);`
|
2020-02-14 07:21:56 +00:00
|
|
|
|
* ## ASM
|
2020-02-17 16:55:02 +00:00
|
|
|
|
* `>PUSHW name`
|
2020-02-14 07:21:56 +00:00
|
|
|
|
* `>PUSHW passwd`
|
|
|
|
|
* `>SYSCALL getpwname`
|
|
|
|
|
* ## RETURN VALUE
|
|
|
|
|
*\--------------------------------------
|
2020-02-17 16:55:02 +00:00
|
|
|
|
K.GetPWName
|
2020-03-13 07:15:58 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # GetGRName
|
|
|
|
|
* ## C
|
|
|
|
|
* `int getgrgid(const char* name, S.GRP *group);`
|
|
|
|
|
* ## ASM
|
|
|
|
|
* `>PUSHW name`
|
|
|
|
|
* `>PUSHW group`
|
|
|
|
|
* `>SYSCALL getpwname`
|
|
|
|
|
* ## RETURN VALUE
|
|
|
|
|
*\--------------------------------------
|
2020-02-17 16:55:02 +00:00
|
|
|
|
K.GetGRName >PULLW FORPNT
|
|
|
|
|
>PULLW TXTPTR
|
|
|
|
|
|
2020-02-14 07:21:56 +00:00
|
|
|
|
jmp K.SYSCALL.JMPX
|
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # PutPW
|
|
|
|
|
* ## C
|
|
|
|
|
* `int putpw( S.PW* passwd );`
|
|
|
|
|
* ## ASM
|
2020-02-17 16:55:02 +00:00
|
|
|
|
* `>PUSHW passwd`
|
2020-02-14 07:21:56 +00:00
|
|
|
|
* `>SYSCALL putpw`
|
|
|
|
|
* ## RETURN VALUE
|
|
|
|
|
*\--------------------------------------
|
2020-02-17 16:55:02 +00:00
|
|
|
|
K.PutPW >PULLW TXTPTR
|
2020-02-14 07:21:56 +00:00
|
|
|
|
|
2020-02-17 16:55:02 +00:00
|
|
|
|
jsr K.SYSCALL.JMPX
|
|
|
|
|
bcc K.FlushEtcPasswd
|
|
|
|
|
rts
|
2020-02-14 07:21:56 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
K.FlushEtcPasswd
|
2020-03-12 16:44:11 +00:00
|
|
|
|
>LDYA PWD.UsrDBSize
|
|
|
|
|
ldx PWD.hUsrDB
|
2020-02-14 07:21:56 +00:00
|
|
|
|
jsr MEM.CopyToMain
|
2019-10-11 13:06:33 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
stx .8+1
|
|
|
|
|
|
2020-03-12 16:44:11 +00:00
|
|
|
|
>PUSHWI PWD.ETCPASSWD
|
2019-10-11 13:06:33 +00:00
|
|
|
|
>PUSHBI O.WRONLY+O.CREATE
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>PUSHBI S.FI.T.TXT
|
|
|
|
|
>PUSHWZ Aux type
|
|
|
|
|
>SYSCALL2 FOpen
|
2019-10-11 13:06:33 +00:00
|
|
|
|
bcc .1
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
jsr .8
|
|
|
|
|
pla
|
|
|
|
|
sec
|
|
|
|
|
.9 rts
|
|
|
|
|
|
|
|
|
|
.1 sta .7+1
|
|
|
|
|
|
2020-03-12 16:44:11 +00:00
|
|
|
|
>PUSHW PWD.UsrDBSize
|
2019-10-11 13:06:33 +00:00
|
|
|
|
lda .8+1
|
|
|
|
|
jsr K.getmemptr
|
|
|
|
|
>PUSHYA
|
|
|
|
|
lda .7+1
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>SYSCALL2 FWrite
|
2019-10-11 13:06:33 +00:00
|
|
|
|
bcc .7
|
|
|
|
|
|
|
|
|
|
pha
|
|
|
|
|
jsr .7
|
|
|
|
|
pla
|
|
|
|
|
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.7 lda #$ff SELF MODIFIED
|
2020-02-14 07:21:56 +00:00
|
|
|
|
>SYSCALL2 fclose
|
|
|
|
|
|
2019-10-11 13:06:33 +00:00
|
|
|
|
.8 lda #$ff
|
|
|
|
|
jmp K.freemem SELF MODIFIED
|
2020-02-17 16:55:02 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # PutGR
|
|
|
|
|
* ## C
|
|
|
|
|
* `int putgr(S.GRP *group);`
|
|
|
|
|
* ## ASM
|
|
|
|
|
* `>PUSHW group`
|
|
|
|
|
* `>SYSCALL putgr`
|
|
|
|
|
* ## RETURN VALUE
|
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.PutGR >PULLW TXTPTR
|
|
|
|
|
|
|
|
|
|
jsr K.SYSCALL.JMPX
|
|
|
|
|
bcc K.FlushEtcGroup
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
K.FlushEtcGroup rts
|
2020-03-12 16:44:11 +00:00
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # OpenSession
|
|
|
|
|
* ## C
|
|
|
|
|
* `short int hSID opensession(const char *name, const char *passwd);`
|
|
|
|
|
* ## ASM
|
|
|
|
|
* `>PUSHW name`
|
|
|
|
|
* `>PUSHW passwd`
|
|
|
|
|
* `>SYSCALL OpenSession`
|
|
|
|
|
* ## RETURN VALUE
|
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.OpenSession >PULLW FORPNT passwd
|
|
|
|
|
>PULLW TXTPTR name
|
|
|
|
|
|
|
|
|
|
jmp K.SYSCALL.JMPX
|
|
|
|
|
*/--------------------------------------
|
|
|
|
|
* # CloseSession
|
|
|
|
|
* ## C
|
|
|
|
|
* `int closesession(short int hSID);`
|
|
|
|
|
* ## ASM
|
|
|
|
|
* `>PUSHB hSID`
|
|
|
|
|
* `>SYSCALL CloseSession`
|
|
|
|
|
* ## RETURN VALUE
|
|
|
|
|
*\--------------------------------------
|
|
|
|
|
K.CloseSession >PULLA
|
|
|
|
|
jmp K.SYSCALL.JMPX
|
2019-10-11 13:06:33 +00:00
|
|
|
|
*--------------------------------------
|
2020-03-12 16:44:11 +00:00
|
|
|
|
PWD.ETCPASSWD .AZ "${ROOT}etc/passwd"
|
|
|
|
|
PWD.hUsrDB .BS 1
|
|
|
|
|
PWD.UsrDBPtr .BS 2
|
|
|
|
|
PWD.UsrDBSize .BS 2
|
|
|
|
|
PWD.ETCGROUP .AZ "${ROOT}etc/group"
|
|
|
|
|
PWD.hGrpDB .BS 1
|
|
|
|
|
PWD.GrpDBPtr .BS 2
|
|
|
|
|
PWD.GrpDBSize .BS 2
|
2019-10-11 13:06:33 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE USR/SRC/SYS/KERNEL.S.PWD
|
|
|
|
|
LOAD USR/SRC/SYS/KERNEL.S
|
|
|
|
|
ASM
|