mirror of https://github.com/fairyglade/ly.git
Fix login issue
Signed-off-by: AnErrupTion <anerruption@disroot.org>
This commit is contained in:
parent
52d29bbd47
commit
3faf3dec42
|
|
@ -183,7 +183,7 @@ To disable TTY 2, go to `/etc/inittab` and comment out the line containing `tty2
|
||||||
# sysrc ly_enable="YES"
|
# sysrc ly_enable="YES"
|
||||||
```
|
```
|
||||||
|
|
||||||
To disable TTY 2, go to `/etc/ttys` and comment out the line starting with `ttyv2`.
|
To disable TTY 2, go to `/etc/ttys` and comment out the line starting with `ttyv1` (TTYs start at 0 in FreeBSD).
|
||||||
|
|
||||||
### Updating
|
### Updating
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -511,12 +511,12 @@ fn addUtmpEntry(entry: *Utmp, username: []const u8, pid: c_int) !void {
|
||||||
|
|
||||||
// Get the TTY name (i.e. without the /dev/ prefix)
|
// Get the TTY name (i.e. without the /dev/ prefix)
|
||||||
var ttyname_buf: [@sizeOf(@TypeOf(entry.ut_line))]u8 = undefined;
|
var ttyname_buf: [@sizeOf(@TypeOf(entry.ut_line))]u8 = undefined;
|
||||||
const ttyname = try std.fmt.bufPrintZ(&ttyname_buf, "{s}", .{tty_path["/dev/".len..]});
|
_ = try std.fmt.bufPrintZ(&ttyname_buf, "{s}", .{tty_path["/dev/".len..]});
|
||||||
|
|
||||||
entry.ut_line = ttyname_buf;
|
entry.ut_line = ttyname_buf;
|
||||||
// Get the TTY ID (i.e. without the tty prefix) and truncate it to the size
|
// Get the TTY ID (i.e. without the tty prefix) and truncate it to the size
|
||||||
// of ut_id if necessary
|
// of ut_id if necessary
|
||||||
entry.ut_id = ttyname["tty".len..(@sizeOf(@TypeOf(entry.ut_id)) + "tty".len)].*;
|
entry.ut_id = ttyname_buf["tty".len..(@sizeOf(@TypeOf(entry.ut_id)) + "tty".len)].*;
|
||||||
|
|
||||||
var username_buf: [@sizeOf(@TypeOf(entry.ut_user))]u8 = undefined;
|
var username_buf: [@sizeOf(@TypeOf(entry.ut_user))]u8 = undefined;
|
||||||
_ = try std.fmt.bufPrintZ(&username_buf, "{s}", .{username});
|
_ = try std.fmt.bufPrintZ(&username_buf, "{s}", .{username});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue