mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Fix #77: Remove deprecated startx and user .conf settings
It is strongly recommended to instead use the service stanza to start XDM/GDM, or use startx after a regular login. Note: the `user NAME` setting was always reserved for use with startx Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
@@ -110,10 +110,6 @@ AC_ARG_WITH(console,
|
|||||||
AS_HELP_STRING([--with-console=DEV], [Console to use, default: /dev/console]),
|
AS_HELP_STRING([--with-console=DEV], [Console to use, default: /dev/console]),
|
||||||
[console=$withval], [console=/dev/console])
|
[console=$withval], [console=/dev/console])
|
||||||
|
|
||||||
AC_ARG_WITH(username,
|
|
||||||
AS_HELP_STRING([--with-username=USER], [User for 'startx' .conf option, default: root]),
|
|
||||||
[username=$withval], [username=root])
|
|
||||||
|
|
||||||
AC_ARG_WITH(hostname,
|
AC_ARG_WITH(hostname,
|
||||||
AS_HELP_STRING([--with-hostname=NAME], [If /etc/hostname is missing, default: noname]),
|
AS_HELP_STRING([--with-hostname=NAME], [If /etc/hostname is missing, default: noname]),
|
||||||
[hostname=$withval], [hostname=noname])
|
[hostname=$withval], [hostname=noname])
|
||||||
@@ -190,11 +186,6 @@ AS_IF([test "x$with_console" != "xno"], [
|
|||||||
console=/dev/console])])
|
console=/dev/console])])
|
||||||
AC_DEFINE_UNQUOTED(CONSOLE, "$console", [Default console to use])
|
AC_DEFINE_UNQUOTED(CONSOLE, "$console", [Default console to use])
|
||||||
|
|
||||||
AS_IF([test "x$with_username" != "xno"], [
|
|
||||||
AS_IF([test "x$username" = "xyes"], [
|
|
||||||
username=root])])
|
|
||||||
AC_DEFINE_UNQUOTED(DEFUSER, "$username", [Used for startx .conf option])
|
|
||||||
|
|
||||||
AS_IF([test "x$with_hostname" != "xno"], [
|
AS_IF([test "x$with_hostname" != "xno"], [
|
||||||
AS_IF([test "x$hostname" = "xyes"], [
|
AS_IF([test "x$hostname" = "xyes"], [
|
||||||
hostname=noname])])
|
hostname=noname])])
|
||||||
@@ -247,7 +238,6 @@ Optional features:
|
|||||||
Remount / RW at boot..: $enable_rw_rootfs
|
Remount / RW at boot..: $enable_rw_rootfs
|
||||||
Traditional progress..: $enable_progress
|
Traditional progress..: $enable_progress
|
||||||
Default console dev...: $console
|
Default console dev...: $console
|
||||||
Default user..........: $username
|
|
||||||
Default hostname......: $hostname
|
Default hostname......: $hostname
|
||||||
Default runlevel......: $runlevel
|
Default runlevel......: $runlevel
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ static void setup(void *arg)
|
|||||||
int fd;
|
int fd;
|
||||||
#endif
|
#endif
|
||||||
char line[LINE_SIZE];
|
char line[LINE_SIZE];
|
||||||
|
const char *username = "nobody";
|
||||||
|
|
||||||
umask(0);
|
umask(0);
|
||||||
|
|
||||||
|
|||||||
-12
@@ -226,12 +226,6 @@ static void parse_static(char *line)
|
|||||||
char *x;
|
char *x;
|
||||||
char cmd[CMD_SIZE];
|
char cmd[CMD_SIZE];
|
||||||
|
|
||||||
if (MATCH_CMD(line, "user ", x)) {
|
|
||||||
if (username) free(username);
|
|
||||||
username = strdup(strip_line(x));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (MATCH_CMD(line, "host ", x)) {
|
if (MATCH_CMD(line, "host ", x)) {
|
||||||
if (hostname) free(hostname);
|
if (hostname) free(hostname);
|
||||||
hostname = strdup(strip_line(x));
|
hostname = strdup(strip_line(x));
|
||||||
@@ -283,11 +277,6 @@ static void parse_static(char *line)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MATCH_CMD(line, "startx ", x)) {
|
|
||||||
service_register(SVC_TYPE_SERVICE, strip_line(x), NULL, username);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (MATCH_CMD(line, "shutdown ", x)) {
|
if (MATCH_CMD(line, "shutdown ", x)) {
|
||||||
if (sdown) free(sdown);
|
if (sdown) free(sdown);
|
||||||
sdown = strdup(strip_line(x));
|
sdown = strdup(strip_line(x));
|
||||||
@@ -529,7 +518,6 @@ void conf_reload_dynamic(void)
|
|||||||
|
|
||||||
int conf_parse_config(void)
|
int conf_parse_config(void)
|
||||||
{
|
{
|
||||||
username = strdup(DEFUSER);
|
|
||||||
hostname = strdup(DEFHOST);
|
hostname = strdup(DEFHOST);
|
||||||
|
|
||||||
return parse_conf(FINIT_CONF);
|
return parse_conf(FINIT_CONF);
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ int cfglevel = RUNLEVEL; /* Fallback if no configured runlevel */
|
|||||||
int prevlevel = -1;
|
int prevlevel = -1;
|
||||||
char *sdown = NULL;
|
char *sdown = NULL;
|
||||||
char *network = NULL;
|
char *network = NULL;
|
||||||
char *username = NULL;
|
|
||||||
char *hostname = NULL;
|
char *hostname = NULL;
|
||||||
char *rcsd = FINIT_RCSD;
|
char *rcsd = FINIT_RCSD;
|
||||||
char *runparts = NULL;
|
char *runparts = NULL;
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ extern char *rcsd;
|
|||||||
extern char *sdown;
|
extern char *sdown;
|
||||||
extern char *network;
|
extern char *network;
|
||||||
extern char *hostname;
|
extern char *hostname;
|
||||||
extern char *username;
|
|
||||||
extern char *runparts;
|
extern char *runparts;
|
||||||
extern char *console;
|
extern char *console;
|
||||||
extern uev_ctx_t *ctx;
|
extern uev_ctx_t *ctx;
|
||||||
|
|||||||
Reference in New Issue
Block a user