Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 374787 Details for
Bug 542688
bltk will run any command as root
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
sudoectomy
bltk.diff (text/plain), 24.76 KB, created by
Matthew Garrett
on 2009-11-30 15:48:18 UTC
(
hide
)
Description:
sudoectomy
Filename:
MIME Type:
Creator:
Matthew Garrett
Created:
2009-11-30 15:48:18 UTC
Size:
24.76 KB
patch
obsolete
>commit c8ec303db77b41832ce111cc10bb214c017292bb >Author: Matthew Garrett <mjg@redhat.com> >Date: Mon Nov 30 10:44:17 2009 -0500 > > Sudoectomy > >diff --git a/bltk/Makefile b/bltk/Makefile >index 8407198..21f1c4d 100644 >--- a/bltk/Makefile >+++ b/bltk/Makefile >@@ -89,10 +89,6 @@ clean : FORCE > @$(RM) *~ last_cmd last_results history > @$(RM) .bltk install.log uninstall.log .plot_history > >-su : pre-install >- $(MAKE) -C tools/sudo install >- @touch .bltk >- > _lazy : FORCE > @for f in $(CMDS); \ > do \ >diff --git a/bltk/data/list b/bltk/data/list >index 15d6bb1..3b1e654 100644 >--- a/bltk/data/list >+++ b/bltk/data/list >@@ -51,7 +51,6 @@ > ./tools/bltk/bltk_get_timer.sh > ./tools/bltk/bltk_get_user_field.sh > ./tools/bltk/bltk_get_xdpyinfo.sh >-./tools/bltk/bltk_hd_state.sh > ./tools/bltk/bltk_install.sh > ./tools/bltk/bltk_save_sys_info.sh > ./tools/bltk/bltk_spy.sh >@@ -66,9 +65,6 @@ > ./tools/get_realpath/bltk_get_realpath.c > ./tools/get_realpath/Makefile > ./tools/Makefile >-./tools/sudo >-./tools/sudo/bltk_sudo.c >-./tools/sudo/Makefile > ./tools/time > ./tools/time/bltk_time.c > ./tools/time/Makefile >diff --git a/bltk/include/bltk.h b/bltk/include/bltk.h >index d9069c4..c95569b 100644 >--- a/bltk/include/bltk.h >+++ b/bltk/include/bltk.h >@@ -429,8 +429,6 @@ extern int dpms_proc_flg; > > extern char *results; > >-extern char *bltk_sudo; >- > extern int abort_flg; > extern int ac_ignore; > >diff --git a/bltk/tools/Makefile b/bltk/tools/Makefile >index 2e734eb..20615da 100644 >--- a/bltk/tools/Makefile >+++ b/bltk/tools/Makefile >@@ -1,5 +1,5 @@ > >-SUBDIRS = xse bltk sudo get_realpath type_command analyzer time bat_drain >+SUBDIRS = xse bltk get_realpath type_command analyzer time bat_drain > > all : FORCE > @for dir in $(SUBDIRS); \ >@@ -19,8 +19,5 @@ install : > > uninstall : > >-su sudo : FORCE >- $(MAKE) -C sudo >- > FORCE : > >diff --git a/bltk/tools/analyzer/bltk_report.sh b/bltk/tools/analyzer/bltk_report.sh >index 403c525..6f7f64e 100644 >--- a/bltk/tools/analyzer/bltk_report.sh >+++ b/bltk/tools/analyzer/bltk_report.sh >@@ -1401,11 +1401,6 @@ print_hd() > { > typeset hd_model > typeset hd_size >- typeset hd_ai=0 >- typeset hd_st=0 >- typeset hd_sl=0 >- typeset hd_cnt=0 >- typeset hd_state > typeset ret > typeset num > typeset list >@@ -1418,14 +1413,6 @@ print_hd() > typeset xgbsize > typeset xgbsize_unit > >- get_value HD_MODEL; hd_model=$VALUE >- get_value HD_SIZE; hd_size=$VALUE >- get_value HD_RPM; hd_rpm=$VALUE >- if [[ -z $hd_rpm ]] >- then >- hd_rpm=`$BLTK_BIN/bltk_get_hd_rpm "$hd_model"` >- fi >- > ret=`$BLTK_GET_STAT_CMD -s $stat -c rd` > if [[ $? = 0 ]] > then >@@ -1454,87 +1441,15 @@ print_hd() > xwr="$var" > wr="$var per sec" > fi >- ret=`$BLTK_GET_STAT_CMD -s $stat -c hd` >- if [[ $? = 0 ]] >- then >- CMD="$BLTK_GET_STAT_CMD -s $stat -a hd" >- list=`$CMD` >- ret=$? >- [[ $ret != 0 ]] && error "$CMD failed" >- for v in $list >- do >- if [[ "$v" = a/i ]] >- then >- (( hd_ai++ )) >- elif [[ "$v" = st ]] >- then >- (( hd_st++ )) >- elif [[ "$v" = sl ]] >- then >- (( hd_sl++ )) >- elif [[ $warn != 1 ]] >- then >- warn=1 >- warning "Unexpected hd state value, see $stat file" >- break >- fi >- done >- (( hd_cnt = hd_ai + hd_st + hd_sl )) >- if (( hd_cnt != 0 )) >- then >- calc "*f2" $hd_ai 100 >- hd_ai=$CALC_RES >- calc "/f2" $hd_ai $hd_cnt >- hd_ai=$CALC_RES >- >- calc "*f2" $hd_st 100 >- hd_st=$CALC_RES >- calc "/f2" $hd_st $hd_cnt >- hd_st=$CALC_RES >- >- calc "/f2" $hd_sl 100 >- hd_sl=$CALC_RES >- calc "/f2" $hd_sl $hd_cnt >- hd_sl=$CALC_RES >- >- hd_state="active/idle $hd_ai%, standby $hd_st%, sleeping $hd_sl%" >- fi >- fi > > print_head "HD" >- print_item "HD Model" "$hd_model" >- if [[ $split_mode = TRUE ]] >- then >- hd_size=`echo "$hd_size" | sed -e "s/(//g"` >- hd_size=`echo "$hd_size" | sed -e "s/)//g"` >- if [[ -z $hd_size ]] >- then >- print_item "HD Size (Mbytes)" "" >- print_item "HD Size (GB)" "" >- else >- set $hd_size >- xmbsize=$1 >- xmbsize_unit=$2 >- xgbsize=$3 >- xgbsize_unit=$4 >- print_item "HD Size ($xmbsize_unit)" "$xmbsize" >- print_item "HD Size ($xgbsize_unit)" "$xgbsize" >- fi >- else >- print_item "HD Size" "$hd_size" >- fi >- print_item "HD RPM" "$hd_rpm" > if [[ $split_mode = TRUE ]] > then > print_item "HD Reads (per sec)" "$xrd" > print_item "HD Writes (per sec)" "$xwr" >- print_item "HD State (active/idle%)" "$hd_ai" >- print_item "HD State (standby%)" "$hd_st" >- print_item "HD State (sleeping%)" "$hd_sl" > else > print_item "HD Reads" "$rd" > print_item "HD Writes" "$wr" >- print_item "HD State" "$hd_state" > fi > } > >diff --git a/bltk/tools/bat_drain/bat_drain.sh b/bltk/tools/bat_drain/bat_drain.sh >index 62cef5f..cb2b540 100644 >--- a/bltk/tools/bat_drain/bat_drain.sh >+++ b/bltk/tools/bat_drain/bat_drain.sh >@@ -100,16 +100,12 @@ set_bltk_root() > set_bltk_root > > export BLTK_BIN=$BLTK_ROOT/bin >-export BLTK_SUDO=$BLTK_BIN/bltk_sudo > export BLTK_GET_DMIDECODE=$BLTK_BIN/bltk_get_dmidecode > export BLTK_GET_SYSTEM_RELEASE=$BLTK_BIN/bltk_get_system_release > >-if [[ -x $BLTK_SUDO ]] >-then >- MANUFACTURER=`$BLTK_SUDO $BLTK_GET_DMIDECODE -m` >- PRODUCT_NAME=`$BLTK_SUDO $BLTK_GET_DMIDECODE -p` >- SYSTEM_RELEASE=`$BLTK_GET_SYSTEM_RELEASE -v` >-fi >+MANUFACTURER=`cat /sys/devices/virtual/dmi/id/sys_vendor` >+PRODUCT_NAME=`cat /sys/devices/virtual/dmi/id/product_name` >+SYSTEM_RELEASE=`$BLTK_GET_SYSTEM_RELEASE -v` > > # percents > BAT_CRITICAL=5 >@@ -1874,16 +1870,6 @@ fini_user() > $fini_user_cmd > } > >-bat_startup() >-{ >- if [[ -x $BLTK_SUDO ]] >- then >- $BLTK_SUDO modprobe cpufreq_stats >/dev/null 2>&1 >- fi >-} >- >-bat_startup >- > init_srgs "$@" > > if [[ $left_work_flg = TRUE ]] >diff --git a/bltk/tools/bltk/Makefile b/bltk/tools/bltk/Makefile >index e902fdb..028c1d9 100644 >--- a/bltk/tools/bltk/Makefile >+++ b/bltk/tools/bltk/Makefile >@@ -14,7 +14,7 @@ HIDERS = ../../include/bltk.h > TARGETS = $(BIN)/bltk > > SHFILES = \ >- bltk_hd_state bltk_save_sys_info bltk_get_info \ >+ bltk_save_sys_info bltk_get_info \ > bltk_get_ac_adapter bltk_get_bat bltk_get_cpustat \ > bltk_get_cpufreq bltk_get_cpuinfo bltk_get_cpustate \ > bltk_get_dmidecode bltk_get_hdparm \ >diff --git a/bltk/tools/bltk/bltk_check.sh b/bltk/tools/bltk/bltk_check.sh >index af8099c..cd53086 100644 >--- a/bltk/tools/bltk/bltk_check.sh >+++ b/bltk/tools/bltk/bltk_check.sh >@@ -84,14 +84,6 @@ command_line() > cmd_startup > [[ $? != 0 ]] && exit 1 > >-$BLTK_SUDO_CMD >-if [[ $? != 0 ]] >-then >- echo "Cannot run $BLTK_SUDO_CMD" >- echo "Please perform 'make su' command" >- exit 2 >-fi >- > command_line "$@" > > #rm -rf $RES >diff --git a/bltk/tools/bltk/bltk_get_dmidecode.sh b/bltk/tools/bltk/bltk_get_dmidecode.sh >index f087ea3..f9784c0 100644 >--- a/bltk/tools/bltk/bltk_get_dmidecode.sh >+++ b/bltk/tools/bltk/bltk_get_dmidecode.sh >@@ -74,65 +74,13 @@ command_line() > done > > shift $((OPTIND-1)) >- >- DMIDECODE=$* >- TMP_FILE=$BLTK_ROOT/tmp/dmidecode >- >- if [[ -z $DMIDECODE ]] >- then >- type -p dmidecode >/dev/null 2>&1 >- if [[ $? = 0 ]] >- then >- rm -f $TMP_FILE >- $BLTK_SUDO_CMD dmidecode >$TMP_FILE >- DMIDECODE=$TMP_FILE >- else >- if [[ $manufacturer_flg = TRUE ]] >- then >- : >- elif [[ $product_name_flg = TRUE ]] >- then >- : >- else >- echo "MANUFACTURER =" >- echo "PRODUCT_NAME =" >- fi >- exit 1 >- fi >- fi >- >- MANUFACTURER= >- PRODUCT_NAME= > } > > command_line "$@" > >-while read line >-do >- if [[ "$line" == *"System Information"* ]] >- then >- read line_m >- read line_p >- break >- fi >-done < $DMIDECODE >- >- >-if [[ ! -z "$line_m" ]] >-then >- if [[ "$line_m" == *"Manufacturer: "* ]] >- then >- MANUFACTURER=${line_m#Manufacturer: } >- fi >-fi >+MANUFACTURER=`cat /sys/devices/virtual/dmi/id/sys_vendor` > >-if [[ ! -z "$line_p" ]] >-then >- if [[ "$line_p" == *"Product Name: "* ]] >- then >- PRODUCT_NAME=${line_p#Product Name: } >- fi >-fi >+PRODUCT_NAME=`cat /sys/devices/virtual/dmi/id/product_name` > > if [[ $manufacturer_flg = TRUE ]] > then >@@ -145,6 +93,4 @@ else > echo "PRODUCT_NAME = $PRODUCT_NAME" > fi > >-rm -f $TMP_FILE >- > exit 0 >diff --git a/bltk/tools/bltk/bltk_get_hdparm.sh b/bltk/tools/bltk/bltk_get_hdparm.sh >index 6608ea9..c3c82de 100644 >--- a/bltk/tools/bltk/bltk_get_hdparm.sh >+++ b/bltk/tools/bltk/bltk_get_hdparm.sh >@@ -74,29 +74,10 @@ fi > HD_DEV_NAME=/dev/$HD_NAME > > rm -f $TMP_FILE >-$BLTK_SUDO_CMD hdparm -iI "$HD_DEV_NAME" >$TMP_FILE 2>&1 > > echo "DF_NAME = $DF_NAME" > echo "DF_DEV_NAME = $DF_DEV_NAME" > echo "HD_NAME = $HD_NAME" > echo "HD_DEV_NAME = $HD_DEV_NAME" > >-str=`grep '^ Model=' $TMP_FILE` >-str=${str# Model=} >-str=${str%%, *} >-if [[ -z "$str" ]] >-then >- str=`grep '^ Model Number:' $TMP_FILE` >- str=${str#*Model Number:} >- str=`echo $str` >-fi >-echo "HD_MODEL = $str" >- >-str=`grep 'device size with M = 1000' $TMP_FILE` >-str=${str#*device size with M = 1000*:} >-str=`echo $str` >-echo "HD_SIZE = $str" >- >-rm -f $TMP_FILE >- > exit 0 >diff --git a/bltk/tools/bltk/bltk_get_user_field.sh b/bltk/tools/bltk/bltk_get_user_field.sh >index 3a728a2..4bdc0de 100644 >--- a/bltk/tools/bltk/bltk_get_user_field.sh >+++ b/bltk/tools/bltk/bltk_get_user_field.sh >@@ -75,29 +75,10 @@ fi > HD_DEV_NAME=/dev/$HD_NAME > > rm -f $TMP_FILE >-$BLTK_SUDO_CMD /sbin/hdparm -iI "$HD_DEV_NAME" >$TMP_FILE 2>&1 > > echo "DF_NAME = $DF_NAME" > echo "DF_DEV_NAME = $DF_DEV_NAME" > echo "HD_NAME = $HD_NAME" > echo "HD_DEV_NAME = $HD_DEV_NAME" > >-str=`grep '^ Model=' $TMP_FILE` >-str=${str# Model=} >-str=${str%%, *} >-if [[ -z "$str" ]] >-then >- str=`grep '^ Model Number:' $TMP_FILE` >- str=${str#*Model Number:} >- str=`echo $str` >-fi >-echo "HD_MODEL = $str" >- >-str=`grep 'device size with M = 1000' $TMP_FILE` >-str=${str#*device size with M = 1000*:} >-str=`echo $str` >-echo "HD_SIZE = $str" >- >-rm -f $TMP_FILE >- > exit 0 >diff --git a/bltk/tools/bltk/bltk_hd_state.sh b/bltk/tools/bltk/bltk_hd_state.sh >deleted file mode 100644 >index 0fddb9f..0000000 >--- a/bltk/tools/bltk/bltk_hd_state.sh >+++ /dev/null >@@ -1,55 +0,0 @@ >-#!/bin/bash >-# >-# Copyright (c) 2006 Intel Corp. >-# Copyright (c) 2006 Konstantin Karasyov <konstantin.a.karasyov@intel.com> >-# Copyright (c) 2006 Vladimir Lebedev <vladimir.p.lebedev@intel.com> >-# All rights reserved. >-# >-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >-# >-# Redistribution and use in source and binary forms, with or without >-# modification, are permitted provided that the following conditions >-# are met: >-# >-# Redistributions of source code must retain the above copyright notice, >-# this list of conditions and the following disclaimer. >-# >-# Redistributions in binary form must reproduce the above copyright >-# notice, this list of conditions and the following disclaimer in the >-# documentation and/or other materials provided with the distribution. >-# >-# Neither the name of Intel Corporation nor the names of its contributors >-# may be used to endorse or promote products derived from this software >-# without specific prior written permission. >-# >-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED >-# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED >-# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF >-# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH >-# DAMAGE. >-# >-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >-# >- >- >-unalias -a >- >-D=$1 >- >-str=`$BLTK_SUDO_CMD hdparm -C $D | grep "drive state is"` >-[[ $? != 0 ]] && exit 1 >-C=${str##* } >- >-[[ "$C" = "active/idle" ]] && exit 101 >-[[ "$C" = "standby" ]] && exit 102 >-[[ "$C" = "sleeping" ]] && exit 103 >- >-exit 100 >- >diff --git a/bltk/tools/bltk/bltk_install.sh b/bltk/tools/bltk/bltk_install.sh >index e2afcb7..8d203ff 100644 >--- a/bltk/tools/bltk/bltk_install.sh >+++ b/bltk/tools/bltk/bltk_install.sh >@@ -100,18 +100,6 @@ done > cd $BLTK_ROOT > [[ $? != 0 ]] && exit 1 > >-$BLTK_SUDO_CMD >/dev/null 2>&1 >-if [[ $? != 0 ]] >-then >- SU=TRUE >-fi >- >-if [[ $SU = TRUE ]] >-then >- make su >- [[ $? != 0 ]] && exit 1 >-fi >- > CWD=$PWD > > for work in $WORK >diff --git a/bltk/tools/bltk/bltk_save_sys_info.sh b/bltk/tools/bltk/bltk_save_sys_info.sh >index 1bc67b6..91cbb1a 100644 >--- a/bltk/tools/bltk/bltk_save_sys_info.sh >+++ b/bltk/tools/bltk/bltk_save_sys_info.sh >@@ -48,13 +48,6 @@ group=`id -gn` > > trap 'trap_action 1; exit 1' 1 2 3 6 15 > #trap 'echo trap 11 >&2' 11 >-trap_action() >-{ >- [[ ! -a "$SAVEDIR" ]] && return >- $BLTK_SUDO_CMD chown -h -R $user:$group $SAVEDIR >- $BLTK_SUDO_CMD chmod -R a+rw $SAVEDIR >- $BLTK_SUDO_CMD rm -rf $SAVEDIR >-} > > PROG=$0 > >@@ -102,10 +95,7 @@ SAVELIST=" > > if [[ -a $SAVEDIR ]] > then >- CMD="$BLTK_SUDO_CMD chmod -R a+rw $SAVEDIR" >- $CMD >- [[ $? != 0 ]] && error "$CMD failed" >- CMD="$BLTK_SUDO_CMD rm -rf $SAVEDIR" >+ CMD="rm -rf $SAVEDIR" > $CMD > [[ $? != 0 ]] && error "$CMD failed" > fi >@@ -122,13 +112,13 @@ do > CMD="mkdir -p -m 0777 $dstdir" > $CMD > [[ $? != 0 ]] && error "$CMD failed" >- CMD="$BLTK_SUDO_CMD cp -d -r $src $dst" >+ CMD="cp -d -r $src $dst" > $CMD > [[ $? != 0 ]] && warning "$CMD failed" >- CMD="$BLTK_SUDO_CMD chown -h -R $user:$group $dst" >+ CMD="chown -h -R $user:$group $dst" > $CMD > [[ $? != 0 ]] && warning "$CMD failed" >- CMD="$BLTK_SUDO_CMD chmod -R a+rw $dst" >+ CMD="chmod -R a+rw $dst" > $CMD > [[ $? != 0 ]] && warning "$CMD failed" > done >>$SAVEDIR/err.log 2>&1 >@@ -144,21 +134,9 @@ free >$SAVEDIR/free 2>&1 > df -lk >$SAVEDIR/df 2>&1 > ps -lef >$SAVEDIR/ps 2>&1 > ### glxinfo >$SAVEDIR/glxinfo 2>&1 >-$BLTK_SUDO_CMD dmidecode >$SAVEDIR/dmidecode 2>&1 > xset q >$SAVEDIR/xset 2>&1 > > HDPARM=hdparm > >-for h in hda hdb hdc hdd sda sdb sdc sdd >-do >- grep " $h " /proc/diskstats >/dev/null 2>&1 >- if [[ $? = 0 ]] >- then >- $BLTK_SUDO_CMD $HDPARM /dev/$h >$SAVEDIR/hdparm.$h 2>&1 >- $BLTK_SUDO_CMD $HDPARM -iI /dev/$h >>$SAVEDIR/hdparm.$h 2>&1 >- $BLTK_SUDO_CMD $HDPARM -C /dev/$h >>$SAVEDIR/hdparm.$h 2>&1 >- fi >-done >- > exit 0 > >diff --git a/bltk/tools/bltk/bltk_wl_common.sh b/bltk/tools/bltk/bltk_wl_common.sh >index 23ac52a..8f8df64 100644 >--- a/bltk/tools/bltk/bltk_wl_common.sh >+++ b/bltk/tools/bltk/bltk_wl_common.sh >@@ -132,7 +132,6 @@ cmd_startup() > export BLTK_LIB=$BLTK_ROOT/lib > export BLTK_TMP=$BLTK_ROOT/tmp > >- [[ -z $BLTK_SUDO_CMD ]] && export BLTK_SUDO_CMD=$BLTK_BIN/bltk_sudo > [[ -z $BLTK_CALC_CMD ]] && export BLTK_CALC_CMD=$BLTK_BIN/bltk_calc > [[ -z $BLTK_TIME_CMD ]] && export BLTK_TIME_CMD=$BLTK_BIN/bltk_time > [[ -z $BLTK_TYPE_COMMAND_CMD ]] && export BLTK_TYPE_COMMAND_CMD=$BLTK_BIN/bltk_type_command >@@ -210,7 +209,6 @@ wl_startup() > > export BLTK_WL_INSTALL_FILE=$BLTK_WL_ROOT/.installed > >- [[ -z $BLTK_SUDO_CMD ]] && export BLTK_SUDO_CMD=$BLTK_BIN/bltk_sudo > [[ -z $BLTK_CALC_CMD ]] && export BLTK_CALC_CMD=$BLTK_BIN/bltk_calc > [[ -z $BLTK_TIME_CMD ]] && export BLTK_TIME_CMD=$BLTK_BIN/bltk_time > [[ -z $BLTK_TYPE_COMMAND_CMD ]] && export BLTK_TYPE_COMMAND_CMD=$BLTK_BIN/bltk_type_command >@@ -539,27 +537,6 @@ wl_remove_dir() > return 0 > } > >-wl_remove_dir_su() >-{ >- typeset dir=$1 >- >- if [[ -a $dir ]] >- then >- CMD="$BLTK_SUDO_CMD rm -rf $dir" >- $CMD >- if [[ $? != 0 ]] >- then >- wl_error_msg "$CMD failed" >- wl_error_msg "Cannot remove $dir" >- return 1 >- fi >- fi >-# CMD="rmdir -p `dirname $dir`" >-# $CMD >/dev/null 2>&1 >-# return 0 >- return 0 >-} >- > wl_move_dir() > { > typeset dir1=$1 >diff --git a/bltk/tools/bltk/main.c b/bltk/tools/bltk/main.c >index 9a8b04f..5ebe197 100644 >--- a/bltk/tools/bltk/main.c >+++ b/bltk/tools/bltk/main.c >@@ -214,8 +214,6 @@ int stat_system = 0; > int comment_cnt = 0; > char *comment[MAX_LINES]; > >-char *bltk_sudo = "bltk_sudo_NOT_SET"; >- > char stop_fname[STR_LEN]; > > int show_demo = 0; >@@ -249,7 +247,6 @@ int debug_workload_flg = 0; > > int start_prog_flg = 0; > char *start_prog = NULL; >-int start_prog_su_flg = 0; > > xtime_t arg_time = EMPTY_VALUE; > xtime_t idle_test_time = EMPTY_VALUE; >@@ -944,15 +941,6 @@ static void start_warning2(void) > write_to_stdout_work_out_log("Do NOT touch anything\n"); > } > >-static void pre_init_vars(void) >-{ >- char cmd[STR_LEN]; >- >- (void)sprintf(cmd, "%s modprobe cpufreq_stats >>%s 2>&1", >- bltk_sudo, warning_log_fname); >- (void)prog_system(cmd); >-} >- > static int environment_init(int argc, char **argv) > { > char cmdline[STR_LEN]; >@@ -1050,26 +1038,6 @@ static int environment_init(int argc, char **argv) > (void)sprintf(cmd, "%s >%s/cmd", cmdline, results); > (void)prog_system(cmd); > >- (void)sprintf(str, "%s/bin/bltk_sudo", bltk_root); >- bltk_sudo = strdup(str); >- if (access(str, X_OK) != 0) { >- (void)sprintf(prt_str, "Cannot access %s\n", str); >- write_to_err_log(prt_str); >- (void)sprintf(prt_str, "Please perform 'make su' command\n"); >- write_to_err_log(prt_str); >- prog_exit(1); >- } >- (void)sprintf(cmd, "%s/bin/bltk_sudo", bltk_root); >- ret = prog_system(cmd); >- if (ret != 0) { >- (void)sprintf(prt_str, "Cannot run %s\n", str); >- write_to_err_log(prt_str); >- (void)sprintf(prt_str, "Please perform 'make su' command\n"); >- write_to_err_log(prt_str); >- prog_exit(1); >- } >- prog_putenv("BLTK_SUDO_CMD", str); >- > set_signal(SIGTERM); > set_signal(SIGINT); > set_signal(SIGQUIT); >@@ -1086,8 +1054,6 @@ static int environment_init(int argc, char **argv) > prog_exit(1); > } > >- pre_init_vars(); >- > init_vars(); > > return (0); >@@ -1987,11 +1953,6 @@ int main(int argc, char **argv) > case 'e': > start_prog_flg = 1; > start_prog = optarg; >- start_prog_su_flg = 1; >- break; >- case 'E': >- start_prog_flg = 1; >- start_prog = optarg; > break; > case 'y': > yes = 1; >@@ -2415,11 +2376,7 @@ int main(int argc, char **argv) > } > > if (start_prog_flg) { >- if (start_prog_su_flg) { >- (void)sprintf(cmd, "%s '%s'", bltk_sudo, start_prog); >- } else { >- (void)sprintf(cmd, "%s", start_prog); >- } >+ (void)sprintf(cmd, "%s", start_prog); > (void)sprintf(prt_str, "Start prog %s\n", cmd); > write_to_stdout_work_out_log(prt_str); > ret = prog_system(cmd); >diff --git a/bltk/tools/bltk/stat.c b/bltk/tools/bltk/stat.c >index 921b1a9..2a53c84 100644 >--- a/bltk/tools/bltk/stat.c >+++ b/bltk/tools/bltk/stat.c >@@ -205,24 +205,6 @@ void turn_off_stat_memory(void) > } > } > >-#define LAPTOP_MODE "laptop_mode" >- >-static int laptop_mode_stop_done = 0; >- >-void laptop_mode_stop(void) >-{ >- char cmd[STR_LEN]; >- >- if (!stat_log_proc_flg || laptop_mode_stop_done) { >- return; >- } >- >- laptop_mode_stop_done = 1; >- debug("laptop_mode_stop()"); >- (void)sprintf(cmd, "%s %s >/dev/null 2>&1", bltk_sudo, LAPTOP_MODE); >- (void)prog_system(cmd); >-} >- > void stat_sync(char *why) > { > debug("stat_sync() by %s", why); >@@ -320,7 +302,6 @@ void check_critical_state(void) > if (stat_memory_saved) { > send_sighup(); > } >- laptop_mode_stop(); > if (!idle_test_mode) { > save_sys_info_2(); > } >@@ -438,34 +419,6 @@ get_percentage_delta(ll_t val_100, ll_t val_prev, ll_t val_curr, char *str) > return (ret); > } > >-void hd_state(char *str) >-{ >- char cmd[STR_LEN]; >- int ret; >- >- if (hd_stat_ignore) { >- (void)sprintf(str, " -"); >- return; >- } >- >- (void)sprintf(cmd, "./bin/bltk_hd_state %s >>%s 2>&1", >- hd_dev_name, "/dev/null"); >- >- ret = prog_system(cmd); >- ret = WEXITSTATUS(ret); >- if (ret == 100) { >- (void)sprintf(str, "err"); >- } else if (ret == 101) { >- (void)sprintf(str, "a/i"); >- } else if (ret == 102) { >- (void)sprintf(str, " st"); >- } else if (ret == 103) { >- (void)sprintf(str, " sl"); >- } else { >- (void)sprintf(str, "err"); >- } >-} >- > static int get_display_state(void) > { > char cmd[STR_LEN]; >@@ -1129,7 +1082,7 @@ void write_report_str(char *work_type, char *comment) > if (hd_stat_ignore == 0) { > int del_rd = 0, del_wr = 0; > >- hd_state(shd); >+ sprintf(shd, " -"); > > if (hd_stat_rd_wr_ignore == 0) { > get_hd_stat(1, &c_hd_stat); >diff --git a/bltk/tools/sudo/Makefile b/bltk/tools/sudo/Makefile >deleted file mode 100644 >index 30bc7c6..0000000 >--- a/bltk/tools/sudo/Makefile >+++ /dev/null >@@ -1,43 +0,0 @@ >- >-CFLAGS = -Wall -pedantic -std=c99 -g -O2 >-#LDFLAGS = -L/usr/X11R6/lib -lX11 >- >-BIN = ../../bin >- >-FILES = bltk_sudo >- >-OFILES = ${FILES:=.o} >-CFILES = ${FILES:=.c} >- >-HIDERS = >- >-TARGETS = $(BIN)/bltk_sudo >- >-SHFILES = >-SHFILES_SH = ${SHFILES:=.sh} >-SHTARGETS = $(SHFILES:%=$(BIN)/%) >- >- >-all : $(BIN) $(SUBDIRS) $(TARGETS) $(SHTARGETS) FORCE >- >-$(TARGETS) : ${OFILES} >- $(CC) $(OFILES) $(LDFLAGS) -o $@ >- >-bltk_sudo.o : $(HIDERS) bltk_sudo.c >- >-$(SHTARGETS) : $(SHFILES_SH) >- cp $(@:$(BIN)/%=%.sh) $@ >- @chmod a+x $@ >- >-$(BIN) : FORCE >- @if [ ! -d $@ ]; then mkdir -p -m 0777 $@; fi >- >- >-install : FORCE >- @echo Root password is required >- @su root -c "chown root:root $(TARGETS); chmod +s $(TARGETS)" >- >-clean : >- @$(RM) $(TARGETS) *.o $(SHTARGETS) *~ >- >-FORCE : >diff --git a/bltk/tools/sudo/bltk_sudo.c b/bltk/tools/sudo/bltk_sudo.c >deleted file mode 100644 >index c0b62b2..0000000 >--- a/bltk/tools/sudo/bltk_sudo.c >+++ /dev/null >@@ -1,76 +0,0 @@ >-/* >- * Copyright (c) 2006 Intel Corp. >- * Copyright (c) 2006 Konstantin Karasyov <konstantin.a.karasyov@intel.com> >- * Copyright (c) 2006 Vladimir Lebedev <vladimir.p.lebedev@intel.com> >- * All rights reserved. >- * >- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * >- * Redistributions of source code must retain the above copyright notice, >- * this list of conditions and the following disclaimer. >- * >- * Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * Neither the name of Intel Corporation nor the names of its contributors >- * may be used to endorse or promote products derived from this software >- * without specific prior written permission. >- * >- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS >- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT >- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR >- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT >- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, >- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED >- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED >- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF >- * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH >- * DAMAGE. >- * >- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >- */ >- >-#include <pwd.h> >-#include <string.h> >-#include <errno.h> >-#include <stdio.h> >-#include <unistd.h> >-#include <sys/types.h> >-#include <unistd.h> >-#include <stdlib.h> >-#include <wait.h> >- >-extern int seteuid(uid_t euid); >-extern int setegid(gid_t egid); >- >-int main(int argc, char **argv) >-{ >- char cmd[8192]; >- int ret = 0, i; >- >- cmd[0] = 0; >- for (i = 1; i < argc; i++) { >- (void)strcat(cmd, argv[i]); >- (void)strcat(cmd, " "); >- } >- ret = 0; >- ret += setuid(0); >- ret += setgid(0); >- ret += seteuid(0); >- ret += setegid(0); >- >- if (ret) { >- (void)fprintf(stderr, "bltk_sudo: cannot set su mode\n"); >- return (-1); >- } >- ret = system(cmd); >- ret = WEXITSTATUS(ret); >- return (ret); >-} >diff --git a/bltk/wl_game/bltk_wl_game.sh b/bltk/wl_game/bltk_wl_game.sh >index cc4821d..9b9cdeb 100644 >--- a/bltk/wl_game/bltk_wl_game.sh >+++ b/bltk/wl_game/bltk_wl_game.sh >@@ -78,7 +78,7 @@ clean_gmhome() > { > if [[ -d $GMHOME ]] > then >- CMD="$BLTK_SUDO_CMD rm -rf $GMHOME" >+ CMD="rm -rf $GMHOME" > $CMD > wl_check_error $? "$CMD failed" > fi >diff --git a/bltk/wl_player/bltk_wl_player.sh b/bltk/wl_player/bltk_wl_player.sh >index 33dde0e..f050f21 100644 >--- a/bltk/wl_player/bltk_wl_player.sh >+++ b/bltk/wl_player/bltk_wl_player.sh >@@ -62,7 +62,6 @@ startup() > then > BLTK_WL_FILE=$BLTK_EXTERN_SRC_WL_PLAYER/$PLAY_MD > else >- set_dvd_config > BLTK_WL_FILE=$PLAY_MD > fi > >@@ -97,27 +96,6 @@ echo ALEX DEBUG BLTK_WL_FILE is $BLTK_WL_FILE > ### env | sort >env.log > } > >-set_dvd_config() >-{ >- typeset dvd >- >- for d in /dev/cdrom /dev/hdc /dev/hdd /dev/sr0 >- do >- if [[ -a $d ]] >- then >- dvd=$d >- break >- fi >- done >- >- if [[ ! -a /dev/dvd && ! -z $dvd ]] >- then >- $BLTK_SUDO_CMD ln -s $dvd /dev/dvd >- $BLTK_SUDO_CMD chmod a+r /dev/dvd >- $BLTK_SUDO_CMD hdparm -d1 /dev/dvd >- fi >-} >- > run1() > { > ST_TIME=`$BLTK_TIME_CMD` >diff --git a/bltk/wl_reader/bltk_wl_reader.sh b/bltk/wl_reader/bltk_wl_reader.sh >index 07d6acc..673a000 100644 >--- a/bltk/wl_reader/bltk_wl_reader.sh >+++ b/bltk/wl_reader/bltk_wl_reader.sh >@@ -95,7 +95,7 @@ startup() > fi > if [[ $default_flg = TRUE ]] > then >- CMD="$BLTK_SUDO_CMD rm -f $tmp_reader_file" >+ CMD="rm -f $tmp_reader_file" > $CMD > wl_check_error $? "$CMD fialed" >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 542688
: 374787