This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

The dropped file


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;



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]