Acorn File Server Password File Format ====================================== Level 2 and Level 3 =================== Level 2 FS 00 ..... 09 0A 0B 0C 0D 0E 0F 10 11 +-----------+-----------------+--+---- | User name | Password |Op| Next entry +-----------+-----------------+--+---- Level 3 FS 00 ..... 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F +-----------+-----------------+-----------+--+---- | User name | Password |Free space |Op| Next entry +-----------+-----------------+-----------+--+---- The user name and password are terminated by if they are shorter than the allocated space. If the user name is longer than ten characters and does not have a '.' in it, the first ten characters are followed by a '.', followed by the remaining characters, in this manner: IF LEN(u$)>10 AND INSTR(u$,".")=0 THEN u$=LEFT$(u$,10)+"."+MID$(u$,11) The free space is the amount of allocated space the user has in bytes. Option: b7=0 entry unused b7=1 entry used b6=0 normal user b6=1 system user b5=0 unlocked b5=1 locked b4-b2 reserved b1-b0 logon option An entry is occupied if the Option has bit 7 set and byte 0 is non-zero and less than 128: occupied%=(?ptr%>32 AND ?ptr%<127 AND ptr%?opt%>127) Usernames added to the password file must be a valid pathname, so must match valid pathname syntax and have no special characters, eg " # $ % & * : @ and must not start with a digit. The password file must always be a whole multiple of 256 bytes. If the file is shorter the file server will be confused by the unused data in the disk sector after the end of the file. Level 4 FS ========== Of course, Level4 has to go and use a completely different format. Everything is stored backwards in PRINT# format. 00 01 02 03 ..... 15 16 17 18 19 1A 1B 1C 1D ........ 30 31 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |00|15| User name |40 00 00|00|16| Encoded password | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | +---String length=21 +----+ | +---String length=22 +------String marker | +------String marker Possibly left-over data 32 33 34 35 ........ 64 65 66 67 68 69 6A 6B 6C 6D 6E +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---- |00|32|User Root Directory |40|40|00|00|FF|FF|02|FF| Next entry +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+---- | +---String length=50 | | |b31 b0| | +---b0=Logon Enabled/Disable +------String marker | | +Free space+ +------b0-b1=Option | +---Integer marker +--- User type User type: %00xxxxxx Fixed %01xxxxxx Locked %10xxxxxx Normal %11xxxxxx System Each record can be read with in 6502 PRINT# format with: INPUT#in%,user$:b1%=BGET#in%:b2%=BGET#in%:b3%=BGET#in% INPUT#in%,pass$,URD$:type%=BGET#in% INPUT#in%,free%:option%=BGET#in%:logon%=BGET#in% The user names, passwords, and URDs are spaces padded with spaces and stored backwards in 6502 PRINT# format. It is not known what will happen if the strings are stored truncated. The password is encoded, probably based on using the user name as a seed. A blank password will be a continuous string of the same character, for instance "uuuuuuuuuuuuuuuuuuuuuu". An entry is occupied if the user name is not a space-padded null string, so: occupied%=ptr%?&16>32 Advanced Level 4 FS =================== And, of course, AL4FS goes back to using a normal binary file. 00 01 02 03 04 05 06 ...... 1B 1A 1B 1C 1D 1E 1F +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | User name | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ 20 21 22 23 24 25 26 27 +--+--+--+--+--+--+--+--+ |00|00|08|00|8F|00|00|00| User space? Priviledge? etc? +--+--+--+--+--+--+--+--+ 28 29 2A 2B 2C 2D 2E ...... A1 A2 A3 A4 A5 A6 A7 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | User Root Directory | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ A8 A9 AA AB AC AD AE ...... A9 BA BB BC BD BE BF +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Password | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ C0 C1 C2 C3 C4 C5 C6 ...... D1 D2 D3 D4 D5 D6 D7 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Another string - some sort of group name? | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ D8 D9 DA DB DC DD DE ...... ED EE EF F0 F1 F2 F3 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Time/Date last logged on or "Never logged on" | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ F4 F5 F6 F7 F8 F9 FA ....... 112 113 114 115 116 117 +--+--+--+--+--+--+--+--+--+---+---+---+---+---+---+---+ | Another string | +--+--+--+--+--+--+--+--+--+---+---+---+---+---+---+---+ 118 119 11A 11B 11C 11D 11E 11F 120 +---+---+---+---+---+---+---+---+----- | 00| 00| 00| 00|Opt| 00| 00| 00| Next entry +---+---+---+---+---+---+---+---+----- Determining password file format ================================ Assuming 7-bit printable characters and at least one entry in a password file: Level 2 FS 00 01....08 09 0A .... 0F 10 11 12 13 14 15....19 1A 1B 1C 1D 1E 1F 20 21 +--------------+----------+--+-----------------------+-----------------+--+ | User name | Password |Op| User name | Password |Op| +--------------+----------+--+-----------------------+-----------------+--+ | | Level 3 FS v v 00 01....08 09 0A .... 0F 10 11 12 13 14 15....19 1A 1B 1C 1D 1E 1F 20 21 +-------------------------------------+-----------+-----------+--+---------- | User name | Password |User space |Op| User name +-------------------------------------+-----------+-----------+--+---------- | | v v if b7=1 must be L2FS if b7=1 must be L3FS Level 4 FS 00 01....08 09 0A .... 0F 10 11 12 13 ..... 16 17 +--+--+----------------------------------------+---- |00|15| User name | +--+--+----------------------------------------+---- | | +--+----> must be L4FS This can be determined by reading the first 64 bytes of the password file and using the following sequence of instructions: level%=0 IF ptr%?16>127 THEN level%=2 IF ptr%?30>127 THEN level%=3 IF ptr%?0=0 AND ptr%?1=21 THEN level%=4 You can tell if an entry is occupied in all four password files by checking if the user name is a null string, taking account of space padding, with: occupied%=NOT(user$<"!") Notes ----- 20 21 22 23 24 25 26 27 +--+--+--+--+--+--+--+--+ |00|00|08|00|8F|00|00|00| Admin +--+--+--+--+--+--+--+--+ 00 00 10 00 0F 00 00 00 Guest 00 00 F0 7F 1F 00 00 00 Syst 00 00 00 00 03 00 00 00 Boot 00 00 00 01 03 00 00 00 BootUser 00 00 10 00 0F 00 00 00 deleted user