From 3a9627f69d4983ba02c9456fd87fc599ddc26711 Mon Sep 17 00:00:00 2001 From: fche Date: Fri, 12 Oct 2007 01:51:10 +0000 Subject: * staprun error-check reordering for parseko/cmdline* tests * staprun.c (main): Move checks for init_cap and getuid from just before command line argument parsing to just after. --- runtime/staprun/ChangeLog | 5 +++++ runtime/staprun/staprun.c | 20 +++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/runtime/staprun/ChangeLog b/runtime/staprun/ChangeLog index 4e23c424..2a9029d0 100644 --- a/runtime/staprun/ChangeLog +++ b/runtime/staprun/ChangeLog @@ -1,3 +1,8 @@ +2007-10-11 Frank Ch. Eigler + + * staprun.c (main): Move checks for init_cap and getuid + from just before command line argument parsing to just after. + 2007-10-09 Martin Hunt * common.c (set_clexec): New. diff --git a/runtime/staprun/staprun.c b/runtime/staprun/staprun.c index 67b01abb..44ac0313 100644 --- a/runtime/staprun/staprun.c +++ b/runtime/staprun/staprun.c @@ -211,15 +211,8 @@ int main(int argc, char **argv) exit(1); } - if (geteuid() != 0) { - err("ERROR: The effective user ID of staprun must be set to the root user.\n" - " Check permissions on staprun and ensure it is a setuid root program.\n"); - exit(1); - } - - if (!init_cap()) - exit(1); - + /* NB: Don't do the geteuid()!=0 check here, since we want to + test command-line error-handling while running non-root. */ /* Get rid of a few standard environment variables (which */ /* might cause us to do unintended things). */ rc = unsetenv("IFS") || unsetenv("CDPATH") || unsetenv("ENV") @@ -258,6 +251,15 @@ int main(int argc, char **argv) usage(argv[0]); } + if (geteuid() != 0) { + err("ERROR: The effective user ID of staprun must be set to the root user.\n" + " Check permissions on staprun and ensure it is a setuid root program.\n"); + exit(1); + } + + if (!init_cap()) + exit(1); + if (check_permissions() != 1) usage(argv[0]); -- cgit From 940a04c71b0cbcf12c373b096036cdd6fd640008 Mon Sep 17 00:00:00 2001 From: zhaolei Date: Fri, 12 Oct 2007 06:02:41 +0000 Subject: 2007-10-12 Zhaolei * queue_stats.stp (qsq_start): Fix problem that compile fails when calling qsq_utilization or other query functions next to qsq_start. --- tapset/ChangeLog | 5 +++++ tapset/queue_stats.stp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 72dca971..f87de8ba 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,8 @@ +2007-10-12 Zhaolei + + * queue_stats.stp (qsq_start): Fix problem that compile fails when + calling qsq_utilization or other query functions next to qsq_start. + 2007-10-11 Zhaolei * queue_stats.stp (qsq_utilization): Update queue account datas diff --git a/tapset/queue_stats.stp b/tapset/queue_stats.stp index 5cf24c40..f2fd8dc6 100644 --- a/tapset/queue_stats.stp +++ b/tapset/queue_stats.stp @@ -52,10 +52,10 @@ function qs_done (qname) { # done servicing request # ------------------------------------------------------------------------ function qsq_start (qname) { # reset statistics for new baseline - delete qs_rcount[qname] + qs_rcount[qname] = 0 delete qs_rtime[qname] delete qs_rlentime[qname] - delete qs_wcount[qname] + qs_wcount[qname] = 0 delete qs_wtime[qname] delete qs_wlentime[qname] delete qs_dcount[qname] -- cgit