Login new
This commit is contained in:
83
login.c
83
login.c
@@ -118,12 +118,15 @@ static void login_banner(void)
|
||||
login_cls_attr(0x07); /* normal black background */
|
||||
|
||||
/*
|
||||
* Official LOGIN shows a colored separator, title line, colored separator,
|
||||
* then returns to the normal black screen for the prompt. Use blue instead
|
||||
* of Novell red and show "Mars NWE".
|
||||
* NetWare-like header, but blue for Mars NWE:
|
||||
* blue separator
|
||||
* blue title line
|
||||
* blue separator
|
||||
* then normal black prompt area.
|
||||
*/
|
||||
login_fill_line(1, 0x1f); /* white on blue */
|
||||
login_write_attr(36, 2, "Mars NWE", 0x0f); /* white on black */
|
||||
login_fill_line(2, 0x1f); /* white on blue */
|
||||
login_write_attr(36, 2, "Mars NWE", 0x1f);
|
||||
login_fill_line(3, 0x1f); /* white on blue */
|
||||
|
||||
login_screen_normal();
|
||||
@@ -373,51 +376,73 @@ static int script_execute_line(char *line)
|
||||
return(0);
|
||||
}
|
||||
|
||||
static int try_login_script_file(char *name)
|
||||
{
|
||||
return(read_command_file(name));
|
||||
}
|
||||
|
||||
static int run_login_script(void)
|
||||
{
|
||||
char profile[200];
|
||||
char drive;
|
||||
|
||||
/*
|
||||
* NetWare LOGIN normally executes the system login script from SYS:PUBLIC.
|
||||
* Try current directory first because LOGIN.EXE is often run from PUBLIC,
|
||||
* then the program path, then common SYS:PUBLIC and SYS:LOGIN paths.
|
||||
* NetWare LOGIN normally executes NET$LOG.DAT from SYS:PUBLIC.
|
||||
* We do not know which DOS drive SYS: is mapped to, so try:
|
||||
* current directory
|
||||
* prgpath
|
||||
* root/public/login paths
|
||||
* every DOS drive C:..Z: under \PUBLIC and \LOGIN
|
||||
*/
|
||||
if (read_command_file("net$log.dat") != -2) return(0);
|
||||
if (read_command_file("NET$LOG.DAT") != -2) return(0);
|
||||
if (read_command_file("login") != -2) return(0);
|
||||
if (read_command_file("LOGIN") != -2) return(0);
|
||||
|
||||
if (try_login_script_file("net$log.dat") != -2) return(0);
|
||||
if (try_login_script_file("NET$LOG.DAT") != -2) return(0);
|
||||
if (try_login_script_file("login") != -2) return(0);
|
||||
if (try_login_script_file("LOGIN") != -2) return(0);
|
||||
|
||||
if (*prgpath) {
|
||||
sprintf(profile, "%snet$log.dat", prgpath);
|
||||
if (read_command_file(profile) != -2) return(0);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
|
||||
sprintf(profile, "%sNET$LOG.DAT", prgpath);
|
||||
if (read_command_file(profile) != -2) return(0);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
|
||||
sprintf(profile, "%slogin", prgpath);
|
||||
if (read_command_file(profile) != -2) return(0);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
|
||||
sprintf(profile, "%sLOGIN", prgpath);
|
||||
if (read_command_file(profile) != -2) return(0);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
}
|
||||
|
||||
if (read_command_file("\\net$log.dat") != -2) return(0);
|
||||
if (read_command_file("\\NET$LOG.DAT") != -2) return(0);
|
||||
if (try_login_script_file("\\net$log.dat") != -2) return(0);
|
||||
if (try_login_script_file("\\NET$LOG.DAT") != -2) return(0);
|
||||
|
||||
if (read_command_file("\\public\\net$log.dat") != -2) return(0);
|
||||
if (read_command_file("\\PUBLIC\\NET$LOG.DAT") != -2) return(0);
|
||||
if (read_command_file("\\public\\login") != -2) return(0);
|
||||
if (read_command_file("\\PUBLIC\\LOGIN") != -2) return(0);
|
||||
if (try_login_script_file("\\public\\net$log.dat") != -2) return(0);
|
||||
if (try_login_script_file("\\PUBLIC\\NET$LOG.DAT") != -2) return(0);
|
||||
if (try_login_script_file("\\public\\login") != -2) return(0);
|
||||
if (try_login_script_file("\\PUBLIC\\LOGIN") != -2) return(0);
|
||||
|
||||
if (read_command_file("f:\\public\\net$log.dat") != -2) return(0);
|
||||
if (read_command_file("f:\\PUBLIC\\NET$LOG.DAT") != -2) return(0);
|
||||
if (read_command_file("f:\\public\\login") != -2) return(0);
|
||||
if (read_command_file("f:\\PUBLIC\\LOGIN") != -2) return(0);
|
||||
if (try_login_script_file("\\login\\login") != -2) return(0);
|
||||
if (try_login_script_file("\\LOGIN\\LOGIN") != -2) return(0);
|
||||
if (try_login_script_file("\\login\\net$log.dat") != -2) return(0);
|
||||
if (try_login_script_file("\\LOGIN\\NET$LOG.DAT") != -2) return(0);
|
||||
|
||||
if (read_command_file("\\login\\login") != -2) return(0);
|
||||
if (read_command_file("\\LOGIN\\LOGIN") != -2) return(0);
|
||||
if (read_command_file("\\login\\net$log.dat") != -2) return(0);
|
||||
if (read_command_file("\\LOGIN\\NET$LOG.DAT") != -2) return(0);
|
||||
for (drive = 'C'; drive <= 'Z'; drive++) {
|
||||
sprintf(profile, "%c:\\PUBLIC\\NET$LOG.DAT", drive);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
|
||||
sprintf(profile, "%c:\\public\\net$log.dat", drive);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
|
||||
sprintf(profile, "%c:\\PUBLIC\\LOGIN", drive);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
|
||||
sprintf(profile, "%c:\\LOGIN\\LOGIN", drive);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
|
||||
sprintf(profile, "%c:\\LOGIN\\NET$LOG.DAT", drive);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
}
|
||||
|
||||
return(-2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user