diff --git a/build/jam/images/definitions/minimum b/build/jam/images/definitions/minimum index 9ce865a152..d9b3abcded 100644 --- a/build/jam/images/definitions/minimum +++ b/build/jam/images/definitions/minimum @@ -1,7 +1,7 @@ # This file defines the content of the minimum Haiku image. SYSTEM_BIN = [ FFilterByBuildFeatures - addattr alert arp + addattr alert arp autologin bc beep bfsinfo catattr checkfs checkitout chop clear cmp collectcatkeys compress copyattr dc desklink df diff diff3 diskimage draggers @@ -41,7 +41,6 @@ SYSTEM_APPS = [ FFilterByBuildFeatures CharacterMap Debugger DeskCalc Devices DiskProbe DiskUsage DriveSetup Expander - Login NetworkStatus ProcessController ShowImage StyledEdit diff --git a/data/launch/system b/data/launch/system index 9bf13f8413..53e8ae0b49 100644 --- a/data/launch/system +++ b/data/launch/system @@ -72,8 +72,7 @@ service x-vnd.Haiku-power_daemon { } target login { - job x-vnd.Haiku-Login { - launch /system/apps/Login - legacy + job x-vnd.Haiku-autologin { + launch /system/bin/autologin } } diff --git a/src/bin/Jamfile b/src/bin/Jamfile index f8cb28c287..e81be6e476 100644 --- a/src/bin/Jamfile +++ b/src/bin/Jamfile @@ -77,6 +77,7 @@ StdBinCommands # standard commands that need libbe.so StdBinCommands + autologin.cpp beep.cpp catattr.cpp checkfs.cpp diff --git a/src/bin/autologin.cpp b/src/bin/autologin.cpp new file mode 100644 index 0000000000..76c69c1f5f --- /dev/null +++ b/src/bin/autologin.cpp @@ -0,0 +1,32 @@ +/* + * Copyright 2015, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ + + +#include +#include +#include + +#include + + +int +main() +{ + if (getuid() != 0) + return EXIT_FAILURE; + + // TODO: This will obviously be done differently in a multi-user + // environment; we'll probably want to merge this with the standard + // login application then. + struct passwd* passwd = getpwuid(0); + if (passwd == NULL) + return EXIT_FAILURE; + + status_t status = BLaunchRoster().StartSession(passwd->pw_name); + if (status != B_OK) + return EXIT_FAILURE; + + return EXIT_SUCCESS; +}