summaryrefslogtreecommitdiffstats
path: root/buildrun.cxx
diff options
context:
space:
mode:
authorhunt <hunt>2006-03-06 20:44:29 +0000
committerhunt <hunt>2006-03-06 20:44:29 +0000
commit70404fc597fe283753bb2f86f95c4c9f008f324d (patch)
treef61d42a73603f916a178091d7fd456690c7f47fd /buildrun.cxx
parentaceaf24112298270202da8a4a6b5116006ae00e3 (diff)
downloadsystemtap-steved-70404fc597fe283753bb2f86f95c4c9f008f324d.tar.gz
systemtap-steved-70404fc597fe283753bb2f86f95c4c9f008f324d.tar.xz
systemtap-steved-70404fc597fe283753bb2f86f95c4c9f008f324d.zip
2006-03-06 Martin Hunt <hunt@redhat.com>
* buildrun.cxx (run_pass): Add "-u username". * stapfuncs.5.in: Document system().
Diffstat (limited to 'buildrun.cxx')
-rw-r--r--buildrun.cxx7
1 files changed, 6 insertions, 1 deletions
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 <sys/wait.h>
+#include <pwd.h>
}
@@ -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()) + " ";