public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Removed unneeded access().
@ 2012-06-13 12:01 Pasi Savanainen
  2012-06-13 17:13 ` Josh Stone
  0 siblings, 1 reply; 4+ messages in thread
From: Pasi Savanainen @ 2012-06-13 12:01 UTC (permalink / raw)
  To: systemtap

* ctl.c: access() is not needed because previous open() will fail
if user has no read write accees to a command channel file.
Actually existance of access() check generates a misleading error:
"Error, 'stap_26013' (stap_26013) is not a zombie systemtap module."
when stap is runned by regular user (stapusr group)
and /sys/kernel/debug is mounted as 0700.
---
 runtime/staprun/ctl.c |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/runtime/staprun/ctl.c b/runtime/staprun/ctl.c
index 1ffc8e3..96c140d 100644
--- a/runtime/staprun/ctl.c
+++ b/runtime/staprun/ctl.c
@@ -30,15 +30,6 @@ int init_ctl_channel(const char *name, int verb)
 	control_channel = open(buf, O_RDWR);
 	dbug(2, "Opened %s (%d)\n", buf, control_channel);
 
-/* It's actually safe to do this check before the open(),
- * as the file we're trying to access connot be modified
- * by a typical user.
- */
-	if (access(buf, R_OK|W_OK) != 0){
-		close(control_channel);
-		return -5;
-	}
-
 	if (control_channel < 0) {
 		if (verb) {
 			if (attach_mod && errno == ENOENT)
-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-14 21:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-13 12:01 [PATCH] Removed unneeded access() Pasi Savanainen
2012-06-13 17:13 ` Josh Stone
2012-06-14  6:39   ` Pasi Savanainen
2012-06-14 21:32     ` Josh Stone

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).