Login new debug UNC
This commit is contained in:
83
login.c
83
login.c
@@ -23,20 +23,6 @@
|
||||
static uint8 script_login_name[64];
|
||||
static uint8 script_file_server[52];
|
||||
|
||||
static int login_script_trace = 1;
|
||||
|
||||
static int try_script_trace(char *name)
|
||||
{
|
||||
int rc;
|
||||
|
||||
fprintf(stdout, "LOGIN script: trying %s\n", name);
|
||||
rc = read_command_file(name);
|
||||
fprintf(stdout, "LOGIN script: %s rc=%d\n", name, rc);
|
||||
|
||||
return(rc);
|
||||
}
|
||||
|
||||
|
||||
static char **build_argv(char *buf, int bufsize, char *str);
|
||||
extern int read_command_file(char *fstr);
|
||||
extern int get_fs_name(int connid, char *name);
|
||||
@@ -392,7 +378,12 @@ static int script_execute_line(char *line)
|
||||
|
||||
static int try_login_script_file(char *name)
|
||||
{
|
||||
return(try_script_trace(name));
|
||||
return(read_command_file(name));
|
||||
}
|
||||
|
||||
static int try_login_script_file(char *name)
|
||||
{
|
||||
return(read_command_file(name));
|
||||
}
|
||||
|
||||
static int run_login_script(void)
|
||||
@@ -401,45 +392,59 @@ static int run_login_script(void)
|
||||
char drive;
|
||||
|
||||
/*
|
||||
* 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
|
||||
* Novell LOGIN looks for the system login script using server based paths,
|
||||
* for example \\SERVER\SYS\PUBLIC\NET$LOG.DAT. Try that first.
|
||||
*/
|
||||
|
||||
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 (*script_file_server) {
|
||||
sprintf(profile, "\\\\%s\\SYS\\PUBLIC\\NET$LOG.DAT", script_file_server);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
|
||||
sprintf(profile, "\\\\%s\\SYS\\PUBLIC\\net$log.dat", script_file_server);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
|
||||
sprintf(profile, "\\\\%s\\SYS\\LOGIN\\LOGIN", script_file_server);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
|
||||
sprintf(profile, "\\\\%s\\SYS\\LOGIN\\NET$LOG.DAT", script_file_server);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Then try current directory and the executable path. LOGIN.EXE is often
|
||||
* executed from PUBLIC, so this covers SYS:PUBLIC\NET$LOG.DAT without
|
||||
* relying on an absolute drive path.
|
||||
*/
|
||||
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 (try_login_script_file(profile) != -2) return(0);
|
||||
|
||||
sprintf(profile, "%slogin", prgpath);
|
||||
sprintf(profile, "%snet$log.dat", prgpath);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
|
||||
sprintf(profile, "%sLOGIN", prgpath);
|
||||
if (try_login_script_file(profile) != -2) return(0);
|
||||
|
||||
sprintf(profile, "%slogin", prgpath);
|
||||
if (try_login_script_file(profile) != -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("\\public\\net$log.dat") != -2) return(0);
|
||||
/*
|
||||
* Fallbacks for requesters/runtimes that cannot open UNC from C fopen().
|
||||
*/
|
||||
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\\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 (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\\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);
|
||||
|
||||
for (drive = 'C'; drive <= 'Z'; drive++) {
|
||||
sprintf(profile, "%c:\\PUBLIC\\NET$LOG.DAT", drive);
|
||||
@@ -667,10 +672,8 @@ int func_login(int argc, char *argv[], int mode)
|
||||
|
||||
remove_nwpathes();
|
||||
|
||||
if (!no_script) {
|
||||
fprintf(stdout, "LOGIN script: starting search, prgpath='%s'\n", prgpath);
|
||||
if (!no_script)
|
||||
run_login_script();
|
||||
}
|
||||
} else {
|
||||
(void)set_search_drive_vektor(save_drives);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user