From 70404fc597fe283753bb2f86f95c4c9f008f324d Mon Sep 17 00:00:00 2001 From: hunt Date: Mon, 6 Mar 2006 20:44:29 +0000 Subject: 2006-03-06 Martin Hunt * buildrun.cxx (run_pass): Add "-u username". * stapfuncs.5.in: Document system(). --- buildrun.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'buildrun.cxx') diff --git a/buildrun.cxx b/buildrun.cxx index 535e31bc..c997d125 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -1,5 +1,5 @@ // build/run probes -// Copyright (C) 2005 Red Hat Inc. +// Copyright (C) 2005, 2006 Red Hat Inc. // // This file is part of systemtap, and is free software. You can // redistribute it and/or modify it under the terms of the GNU General @@ -15,6 +15,7 @@ extern "C" { #include "signal.h" #include +#include } @@ -101,11 +102,15 @@ run_pass (systemtap_session& s) { int rc = 0; + struct passwd *pw = getpwuid(getuid()); + string username = string(pw->pw_name); + // for now, just spawn stpd string stpd_cmd = string("sudo ") + string(PKGLIBDIR) + "/stpd " + (s.bulk_mode ? "" : "-r ") + (s.verbose>1 ? "" : "-q ") + + "-u " + username + " " + (s.output_file.empty() ? "" : "-o " + s.output_file + " "); stpd_cmd += "-d " + stringify(getpid()) + " "; -- cgit