public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mjw@redhat.com>
To: systemtap@sourceware.org
Subject: The dropped file
Date: Fri, 15 Jul 2011 11:47:00 -0000	[thread overview]
Message-ID: <1310730454.7351.7.camel@springer.wildebeest.org> (raw)

Hi,

The relay_v2 transport creates a "dropped" file in the debugfs dir of
the module. This file is created with mode 0444 and so is readable for
everybody. That can at times lead to weird behavior since if somebody
has that file open the module can no longer unload, leading to a
successful script erroring out. Now this might not happen often, it was
a weird script I was running that caused it, but it seems just creating
the file with mode 0400 seems to work fine, and guards me from stupid
scripts. So I am testing that, but don't fully understand what reads the
dropped file on the other end. Anybody?

Thanks,

Mark

diff --git a/runtime/transport/relay_v2.c b/runtime/transport/relay_v2.c
index 562bcdc..ff621a4 100644
--- a/runtime/transport/relay_v2.c
+++ b/runtime/transport/relay_v2.c
@@ -287,7 +287,7 @@ static int _stp_transport_data_fs_init(void)
 
        /* Create "dropped" file. */
        _stp_relay_data.dropped_file
-               = debugfs_create_file("dropped", 0444, _stp_get_module_dir(),
+               = debugfs_create_file("dropped", 0400, _stp_get_module_dir(),
                                      NULL, &__stp_relay_dropped_fops);
        if (!_stp_relay_data.dropped_file) {
                rc = -EIO;


             reply	other threads:[~2011-07-15 11:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15 11:47 Mark Wielaard [this message]
2011-07-15 14:50 ` David Smith
2011-07-15 15:06   ` Mark Wielaard
2011-07-15 15:11     ` David Smith
2011-07-15 15:24       ` Dave Brolley

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=1310730454.7351.7.camel@springer.wildebeest.org \
    --to=mjw@redhat.com \
    --cc=systemtap@sourceware.org \
    /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).