From 72f0ae7b4f16cddbb2ee65db1a34f15b383ad421 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 29 Jun 2011 17:57:25 +0000 Subject: [PATCH] Forbid removing all /etc/hosts entries from DNS with makedns -d as it pretty well corrupts most configs git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9983 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/ddns.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 52fe03289..c4c811645 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -241,6 +241,11 @@ sub process_request { } elsif ($allnodes) { #read all nodelist specified nodes } else { + if ($deletemode) { + #when this was permitted, it really ruined peoples' days + xCAT::SvrUtils::sendmsg([1,"makedns -d without noderange or -a is not supported"],$callback); + return; + } #legacy behavior, read from /etc/hosts my $hostsfile; open($hostsfile,"<","/etc/hosts");