[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ossec-dev] [Bug 68] New: Wrong algorithm for getting nameservers from /etc/resolv.conf
http://www.ossec.net/bugs/show_bug.cgi?id=68
Summary: Wrong algorithm for getting nameservers from
/etc/resolv.conf
Product: OSSEC
Version: 1.3
Platform: PC
OS/Version: Linux
Status: NEW
Severity: minor
Priority: P1
Component: install
AssignedTo: ossec-dev@xxxxxxxxx
ReportedBy: php-coder@xxxxxxxxxxxx
Hello!
During installation install.sh tries to get nameservers from /etc/resolv.conf:
src/init/shared.sh:
28 NAMESERVERS=`cat /etc/resolv.conf | grep "^nameserver" | cut -d " " -sf 2`
29 NAMESERVERS2=`cat /etc/resolv.conf | grep "^nameserver" | cut -sf 2`
Except cat misusing (see also bug #64) this commands return not expected
results:
[c0der@rock ~]$ cat /etc/resolv.conf
nameserver 195.140.180.2
nameserver 195.140.181.2
[c0der@rock ~]$ grep "^nameserver" /etc/resolv.conf | cut -d " " -sf2
195.140.180.2
195.140.181.2
[c0der@rock ~]$ grep "^nameserver" /etc/resolv.conf | cut -sf2
[c0der@rock ~]$
After this all founded nameservers holds in variable NAMESERVERS and
NAMESERVERS2 always empty. I think it's not expected behavior.
But it's not break anything because used in for loop:
install.sh:
538 for ip in ${NAMESERVERS} ${NAMESERVERS2};
539 do
540 if [ ! "X${ip}" = "X" ]; then
541 echo " - ${ip}"
542 echo " <white_list>${ip}</white_list>" >>$NEWCONFIG
543 fi
544 done
--
Configure bugmail: http://www.ossec.net/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
OSSEC home |
Main Index |
Thread Index
OSSEC project: www.ossec.net.
Mailling list information: http://www.ossec.net/en/mailing_lists.html.