public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "Stone, Joshua I" <joshua.i.stone@intel.com>
To: "Frank Ch. Eigler" <fche@redhat.com>,
		"Anthony Green" <green@redhat.com>
Cc: <systemtap@sources.redhat.com>
Subject: RE: systemtap question
Date: Wed, 06 Sep 2006 18:41:00 -0000	[thread overview]
Message-ID: <C56DB814FAA30B418C75310AC4BB279D8FE48D@scsmsx413.amr.corp.intel.com> (raw)

On Wednesday, September 06, 2006 6:36 AM, Frank Ch. Eigler wrote:
> Hi -
> 
> green@redhat.com wrote:
> 
>> I have a customer who wants certain system files to have
>> non-standard file permissions, but some cron job keeps changing them
>> back every night.  He'd like to figure out who is doing this.
> 
> OK.
> 
>> Is this the kind of thing systemtap could help with?  Do you have
>> any examples that are similar to this?

Here's a tiny script that probes the chmod syscall, and prints the
calling process and walks the process "stack".  You might also have to
probe fchmod, but it's more difficult to account that since you only get
the file descriptor.

Josh


probe syscall.chmod {
  printf("%5d %-16s %s -> %#o\n", tid(), execname(), path, mode)
  printf(" ^\n")
  for (t = task_parent(task_current()); task_tid(t) != 0; t =
task_parent(t)) {
    printf(" | %5d %s\n", task_tid(t), task_execname(t))
  }
  printf(" ------------------------\n")
}

             reply	other threads:[~2006-09-06 18:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-06 18:41 Stone, Joshua I [this message]
     [not found] <48ACFC02.3080002@gmail.com>
2008-08-23  4:28 ` Peter Teoh
2008-08-23 12:51   ` Mark Wielaard
2008-08-23 14:09   ` Frank Ch. Eigler
     [not found] <1157546598.2847.28.camel@localhost.localdomain>
2006-09-06 13:36 ` Frank Ch. Eigler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C56DB814FAA30B418C75310AC4BB279D8FE48D@scsmsx413.amr.corp.intel.com \
    --to=joshua.i.stone@intel.com \
    --cc=fche@redhat.com \
    --cc=green@redhat.com \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).