From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7920 invoked by alias); 18 Sep 2008 21:27:28 -0000 Received: (qmail 7622 invoked by uid 48); 18 Sep 2008 21:26:15 -0000 Date: Thu, 18 Sep 2008 21:27:00 -0000 Message-ID: <20080918212615.7621.qmail@sourceware.org> From: "dsmith at redhat dot com" To: systemtap@sources.redhat.com In-Reply-To: <20080918151227.6903.scox@redhat.com> References: <20080918151227.6903.scox@redhat.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug runtime/6903] scripts can be run by non-sudo and non-stapdev users X-Bugzilla-Reason: AssignedTo Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2008-q3/txt/msg00710.txt.bz2 ------- Additional Comments From dsmith at redhat dot com 2008-09-18 21:26 ------- Originally, staprun.c:main() called cap.c:init_cap(), which did the following: void init_cap(void) { uid_t uid = getuid(); gid_t gid = getgid(); ... if (setresuid(uid, uid, uid) < 0) ferror("setresuid"); if (setresgid(gid, gid, gid) < 0) ferror("setresgid"); } Which basically set the effective and saved user/group ids to the real user/group id. Then, staprun.c:main() called staprun_funcs.c:check_permissions() int check_permissions(void) { /* If we're root, we can do anything. */ if (geteuid() == 0) return 1; ... } Without the code in init_cap(), the euid of staprun is always 0, since staprun is setuid 0. Changing that 'geteuid()' call to 'getuid()' seems to fix the problem. Fixed in commit 0387bde. -- What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED http://sourceware.org/bugzilla/show_bug.cgi?id=6903 ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.