|
From: | Javier Fernandez-Sanguino |
Subject: | Re: [Tiger-devel] [PATCH] Define MESG for HP-UX and fix /etc/ftpusers check |
Date: | Thu, 26 Jun 2003 10:25:42 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 |
Ryan Bradetich wrote:
Hello all, This patch does the following: * Define MESG for HP-UX * Fix the /etc/ftpusers check The /etc/ftpusers check did this: if [ ! "`$GREP '^root' /etc/ftpusers`" ]; then The problem was with the ""'s, the statement ended up looking like: if [ ! "root" ]; then which did not produce the desired results. I believe the origional author intended to check the return code from the grep, which would also work.
In which system? It does produce the desired results on Linux. From the test manpage:
" [-n] STRING the length of STRING is nonzero"So, the check there tries to determine if the scring is nonzero and reverses it. So it ends up saying "if the GREP returns anything then don't give a warning" (because if it does then root is in the ftpusers)
¿Isn't this the same for HPUX? From reading the HP-UX test manpage (for HP-UX 10.x [1] it seems this is also the case for Solaris [2]
I believe this problem also exists with the /etc/default/login check, but since I do not have a system to verify this, I left it alone.
Your patch really does not change the behavior in Linux but probably works ok in HP-UX and Solaris better, I will make changes in all the file to change the -n implicit behavior and add either -n or -z (if ! was being used).
Thanks Javi [1] http://docs.hp.com/hpux/onlinedocs/B2355-90128/00/03/341-con.html [2] http://docs.sun.com/db/doc/802-5747-01/6i9g1asuh?a=view
[Prev in Thread] | Current Thread | [Next in Thread] |