login-validator: Create a file to store username

This commit is contained in:
nemunaire 2022-03-01 21:30:07 +01:00
parent e65ef22000
commit 882ef1c3f8

View File

@ -47,6 +47,13 @@ func registerUser(tplPath, remoteAddr string, filename string, username string,
return err
}
fdlogin, err := os.Create(path.Join(tftpDir, "shadows", initrd, "whois"))
if err != nil {
return err
}
defer fdlogin.Close()
fdlogin.Write([]byte(username + "\n" + remoteAddr + "\n" + ip.String()))
fd, err := os.Create(path.Join(tftpDir, "shadows", initrd, "challenge-initrd.img"))
if err != nil {
return err