Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!mips!daver!bungi.com!news From: culberts@hplwbc.hpl.hp.com (Bruce Culbertson) Newsgroups: comp.sys.nsc.32k Subject: Minix comments Message-ID: <9009041816.AA16986@hplwbc.hpl.hp.com> Date: 4 Sep 90 18:16:15 GMT Sender: news@daver.bungi.com Lines: 54 Approved: news@daver.bungi.com Hi gang, I am delighted to see so much recent pc532 activity. Several people are pounding on Minix in ways I haven't and are consequently seeing weird behavior I haven't experienced. Keep it up -- eventually this will result in a better OS. Several people have reported that the passwd command is broken. You're right. I set my password and then I updated the standard IO library. Since I didn't need to change my password, I didn't notice that the new library broke passwd. Passwd uses a light-weight printf called prints. Prints does not do a flush after each call, which is why you do not see the passwd prompts. Worse, the prompts can wind up in your /etc/passwd file, making login's impossible. Passwd uses the cute trick of close'ing (not fclose'ing) stdout and then opening /etc/passwd as stdout. When the flush finally occurs, the prompts go into /etc/passwd. Do not try to fix this by putting something like #define prints printf into passwd.c. Because the library routine getpass calls prints, passwd will still fail with this fix. Instead put this at the end of passwd.c and recompile: prints (f, a, b, c) char *f, *a, *b, *c; {printf (f, a, b, c);} That will probably get the portability police on my back -- use VARARGS if you prefer. Next, I will criticize other people's poor quality code. Several people have reported that code like this will not work: foo() { char bar[] = "Hello"; strcpy (bar, "Bye"); } This has never been legal C, although it worked on some computers. (Well, maybe K&R were vague on the subject, but it sure is illegal now.) GCC puts the string "Hello" into the text segment, which is write protected in my Minix implementation. Hence, the strcpy() gets a bus error when it tries to write it. Since there is some of this kind of code still around, GCC provides a "-fwritable-strings" option to put the "constant" strings into the data segment. Have fun, Bruce