Eradicate the VTInit code.
"This option should rarely be used." Never sounds like a better idea.
This commit is contained in:
parent
24089b0624
commit
0bdd20a045
|
@ -733,7 +733,6 @@ typedef enum {
|
||||||
FLAG_DISABLEMODINDEV,
|
FLAG_DISABLEMODINDEV,
|
||||||
FLAG_MODINDEVALLOWNONLOCAL,
|
FLAG_MODINDEVALLOWNONLOCAL,
|
||||||
FLAG_ALLOWMOUSEOPENFAIL,
|
FLAG_ALLOWMOUSEOPENFAIL,
|
||||||
FLAG_VTINIT,
|
|
||||||
FLAG_VTSYSREQ,
|
FLAG_VTSYSREQ,
|
||||||
FLAG_XKBDISABLE,
|
FLAG_XKBDISABLE,
|
||||||
FLAG_PCIPROBE1,
|
FLAG_PCIPROBE1,
|
||||||
|
@ -785,8 +784,6 @@ static OptionInfoRec FlagOptions[] = {
|
||||||
{0}, FALSE },
|
{0}, FALSE },
|
||||||
{ FLAG_ALLOWMOUSEOPENFAIL, "AllowMouseOpenFail", OPTV_BOOLEAN,
|
{ FLAG_ALLOWMOUSEOPENFAIL, "AllowMouseOpenFail", OPTV_BOOLEAN,
|
||||||
{0}, FALSE },
|
{0}, FALSE },
|
||||||
{ FLAG_VTINIT, "VTInit", OPTV_STRING,
|
|
||||||
{0}, FALSE },
|
|
||||||
{ FLAG_VTSYSREQ, "VTSysReq", OPTV_BOOLEAN,
|
{ FLAG_VTSYSREQ, "VTSysReq", OPTV_BOOLEAN,
|
||||||
{0}, FALSE },
|
{0}, FALSE },
|
||||||
{ FLAG_XKBDISABLE, "XkbDisable", OPTV_BOOLEAN,
|
{ FLAG_XKBDISABLE, "XkbDisable", OPTV_BOOLEAN,
|
||||||
|
@ -977,8 +974,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
xf86Info.vtinit = xf86GetOptValString(FlagOptions, FLAG_VTINIT);
|
|
||||||
|
|
||||||
if (xf86IsOptionSet(FlagOptions, FLAG_PCIPROBE1))
|
if (xf86IsOptionSet(FlagOptions, FLAG_PCIPROBE1))
|
||||||
xf86Info.pciFlags = PCIProbe1;
|
xf86Info.pciFlags = PCIProbe1;
|
||||||
if (xf86IsOptionSet(FlagOptions, FLAG_PCIPROBE2))
|
if (xf86IsOptionSet(FlagOptions, FLAG_PCIPROBE2))
|
||||||
|
|
|
@ -97,7 +97,6 @@ InputInfoPtr xf86InputDevs = NULL;
|
||||||
xf86InfoRec xf86Info = {
|
xf86InfoRec xf86Info = {
|
||||||
-1, /* consoleFd */
|
-1, /* consoleFd */
|
||||||
-1, /* vtno */
|
-1, /* vtno */
|
||||||
NULL, /* vtinit */
|
|
||||||
FALSE, /* vtSysreq */
|
FALSE, /* vtSysreq */
|
||||||
SKWhenNeeded, /* ddxSpecialKeys */
|
SKWhenNeeded, /* ddxSpecialKeys */
|
||||||
NULL, /* pMouse */
|
NULL, /* pMouse */
|
||||||
|
|
|
@ -102,7 +102,6 @@ static void xf86PrintBanner(void);
|
||||||
static void xf86PrintMarkers(void);
|
static void xf86PrintMarkers(void);
|
||||||
static void xf86PrintDefaultModulePath(void);
|
static void xf86PrintDefaultModulePath(void);
|
||||||
static void xf86PrintDefaultLibraryPath(void);
|
static void xf86PrintDefaultLibraryPath(void);
|
||||||
static void xf86RunVtInit(void);
|
|
||||||
|
|
||||||
static Bool probe_devices_from_device_sections(DriverPtr drvp);
|
static Bool probe_devices_from_device_sections(DriverPtr drvp);
|
||||||
static Bool add_matching_devices_to_configure_list(DriverPtr drvp);
|
static Bool add_matching_devices_to_configure_list(DriverPtr drvp);
|
||||||
|
@ -238,9 +237,6 @@ PostConfigInit(void)
|
||||||
xf86OSPMClose = xf86OSPMOpen();
|
xf86OSPMClose = xf86OSPMOpen();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Run an external VT Init program if specified in the config file */
|
|
||||||
xf86RunVtInit();
|
|
||||||
|
|
||||||
/* Do this after XF86Config is read (it's normally in OsInit()) */
|
/* Do this after XF86Config is read (it's normally in OsInit()) */
|
||||||
OsInitColors();
|
OsInitColors();
|
||||||
}
|
}
|
||||||
|
@ -1915,44 +1911,6 @@ xf86PrintDefaultLibraryPath(void)
|
||||||
ErrorF("%s\n", DEFAULT_LIBRARY_PATH);
|
ErrorF("%s\n", DEFAULT_LIBRARY_PATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
xf86RunVtInit(void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If VTInit was set, run that program with consoleFd as stdin and stdout
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (xf86Info.vtinit) {
|
|
||||||
switch(fork()) {
|
|
||||||
case -1:
|
|
||||||
FatalError("xf86RunVtInit: fork failed (%s)\n", strerror(errno));
|
|
||||||
break;
|
|
||||||
case 0: /* child */
|
|
||||||
if (setuid(getuid()) == -1) {
|
|
||||||
xf86Msg(X_ERROR, "xf86RunVtInit: setuid failed (%s)\n",
|
|
||||||
strerror(errno));
|
|
||||||
exit(255);
|
|
||||||
}
|
|
||||||
/* set stdin, stdout to the consoleFd */
|
|
||||||
for (i = 0; i < 2; i++) {
|
|
||||||
if (xf86Info.consoleFd != i) {
|
|
||||||
close(i);
|
|
||||||
dup(xf86Info.consoleFd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
execl("/bin/sh", "sh", "-c", xf86Info.vtinit, (void *)NULL);
|
|
||||||
xf86Msg(X_WARNING, "exec of /bin/sh failed for VTInit (%s)\n",
|
|
||||||
strerror(errno));
|
|
||||||
exit(255);
|
|
||||||
break;
|
|
||||||
default: /* parent */
|
|
||||||
wait(NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* xf86LoadModules iterates over a list that is being passed in.
|
* xf86LoadModules iterates over a list that is being passed in.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -75,7 +75,6 @@ typedef enum {
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int consoleFd;
|
int consoleFd;
|
||||||
int vtno;
|
int vtno;
|
||||||
char * vtinit;
|
|
||||||
Bool vtSysreq;
|
Bool vtSysreq;
|
||||||
SpecialKeysInDDX ddxSpecialKeys;
|
SpecialKeysInDDX ddxSpecialKeys;
|
||||||
|
|
||||||
|
|
|
@ -507,17 +507,6 @@ This allows the server to start up even if the mouse device can't be
|
||||||
opened/initialised.
|
opened/initialised.
|
||||||
Default: false.
|
Default: false.
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "Option \*qVTInit\*q \*q" command \*q
|
|
||||||
Runs
|
|
||||||
.I command
|
|
||||||
after the VT used by the server has been opened.
|
|
||||||
The command string is passed to \*q/bin/sh \-c\*q, and is run with the real
|
|
||||||
user's id with stdin and stdout set to the VT.
|
|
||||||
The purpose of this option is to allow system dependent VT initialisation
|
|
||||||
commands to be run.
|
|
||||||
This option should rarely be needed.
|
|
||||||
Default: not set.
|
|
||||||
.TP 7
|
|
||||||
.BI "Option \*qVTSysReq\*q \*q" boolean \*q
|
.BI "Option \*qVTSysReq\*q \*q" boolean \*q
|
||||||
enables the SYSV\-style VT switch sequence for non\-SYSV systems
|
enables the SYSV\-style VT switch sequence for non\-SYSV systems
|
||||||
which support VT switching.
|
which support VT switching.
|
||||||
|
|
|
@ -208,7 +208,6 @@ typedef enum {
|
||||||
XKBVARIANT,
|
XKBVARIANT,
|
||||||
XKBOPTIONS,
|
XKBOPTIONS,
|
||||||
/* The next two have become ServerFlags options */
|
/* The next two have become ServerFlags options */
|
||||||
VTINIT,
|
|
||||||
VTSYSREQ,
|
VTSYSREQ,
|
||||||
/* Obsolete keyboard tokens */
|
/* Obsolete keyboard tokens */
|
||||||
SERVERNUM,
|
SERVERNUM,
|
||||||
|
|
Loading…
Reference in New Issue