Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!sdsu!crash!pnet01!cwr From: cwr@pnet01.cts.com (Will Rose) Newsgroups: comp.os.minix Subject: 1.5.3 init.c Message-ID: <1660@crash.cts.com> Date: 25 Feb 90 09:16:05 GMT Sender: root@crash.cts.com Organization: People-Net [pnet01], El Cajon CA Lines: 49 I've found only one problem with 1.5.3 so far, and that is the (new) use of execle rather than execn in init. Execle works ok if login is found in the first place it looks (/bin) but if login isn't there execle won't find it in the second place it tries, /usr/bin, or anywhere else. It just doesn't give up gracefully. I assume this is a stack problem, but none of the obvious stack tinkering works. Curiously, if you boot 1.5.0 you can log in, but the terminal is in raw mode. These are deep waters, Watson... Anyhow, I didn't want to keep login in /bin, so my cure was to replace the calls to execle with calls to a modified version of the 1.5.0 execn: /* execn.c: passes only filename on the stack - Jan 90 */ #include #define PTRSIZE sizeof(char *) int execn(name) char *name; /* pointer to file to be exec'd */ { /* Special version used when there is one arg and no environment. This call * is used only by INIT, to avoid having to allocate ARG_MAX. */ PRIVATE char stack[PTRSIZE * 16] ; /* ACK won't auto init */ PRIVATE char **cpp = (char **) stack; *cpp++ = (char *) 1; /* argc */ *cpp++ = (char *) (PTRSIZE * 5); /* *argv[0] */ *cpp++ = 0; *cpp++ = 0; *cpp = 0; strcpy(stack + (PTRSIZE * 5), name); /* nb. known source, no overwrite check */ return(callm1(MM_PROC_NR, EXEC, len(name), sizeof(stack), 0, name, stack, NIL_PTR)); } ----------------------------------------------------------------------- "If heaven too had passions | Will Rose even heaven would | UUCP: {nosc ucsd hplabs!hp-sdd}!crash!pnet01!cw grow old." - Li Ho. | ARPA: crash!pnet01!cwr@nosc.mil | INET: cwr@pnet01.cts.com UUCP: {nosc ucsd hplabs!hp-sdd}!crash!pnet01!cwr ARPA: crash!pnet01!cwr@nosc.mil INET: cwr@pnet01.cts.com