Find a line, and comment out the next 5 lines

From: joe shaboo (jshaboo_at_hotmail.com)
Date: 04/13/04


Date: 13 Apr 2004 05:25:00 -0700

HI,

I'm new to Perl. I'm trying to write a simple script which will
comment out a domain in my named.conf file for Bind.

What I would like to do, is write a script which will comment out a
domain from my named.conf if I no longer want to host that domain.

So, what I'd like to do is create a means to search for a domain
(mydomain.com) and comment out that file and all lines associated with
the file, and put a date when it was commented out. I'd also like to
take the UID of who commented it out, so if needed, we can ask that
person why it was commented out. As a hint we use sudo, so this should
be plausible, but again, not sure of the system command. If I use id,
it says I'm root, but how can I get the name of the user before I
became root?

named.conf example

 zone "mydomain.com" {
    type master;
    file "/path/to/zone/mydomain.com";
    notify yes;
}

What I'd like to do

// Domain taken out of named.conf at request of Customer by UID, date
// zone "mydomain.com" {
// type master;
// file "/path/to/zone/mydomain.com
// notify yes;
// }

Sounds simple enough, but I am not sure how to do it.

many thanks,

joe (jshaboo@hotmail.com)



Relevant Pages

  • IBM Informix Web DataBlade: Local root by design
    ... IBM Informix Web DataBlade: Local root by design ... Impact: Any user who can: 1) Save a Perl script anywhere on the server's ... admin right on any database can do it by loading the WDB module into ...
    (Bugtraq)
  • RE: Linux hacked
    ... I would also suggest using a simple script in the future that alerts ... Subject: Linux hacked ... To get back into your account you want to use, at the boot manager ... boot normally and you should be able to login as root with your new ...
    (Security-Basics)
  • Re: BSDstats v3.0 - The Security Rewrite
    ... The bsdstats script could easily pick up that entry and set ... a management machine, and that management machine only has ... Email is sent to root containing IDTOKEN= as generated by host, root forwards that to rpt@xxxxxxxxxxxx, rpt@xxxxxxxxxxxx sends back KEY= value ... second time, submits report values to root, root forwards that to rpt@xxxxxxxxxxxx ... ...
    (freebsd-questions)
  • Re: Great SWT Program
    ... from a terminal emulator and log in as root there. ... terminal-emulator windows open, ... The script, suid-root utility, or whatever would ... the command interpreter with root privileges ...
    (comp.lang.java.programmer)
  • Re: Rexx problem? - advice sought, Please
    ... Examples (Start with Drive S: current is root): ... In REXX function Directory() gets the same result as CD. ... There have been several public betas of this application using the install script. ...
    (comp.os.os2.programmer.misc)