Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: Mike Auty <mike.auty@gmail.com>
Cc: Linux Trace Devel <linux-trace-devel@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH 1/3] kernel-shark: Show warning message when running as Root
Date: Fri, 9 Aug 2019 15:13:55 +0300
Message-ID: <a4870c9e-2a1b-c8b8-d334-8c77851e5026@gmail.com> (raw)
In-Reply-To: <430194dd-0e96-bb3a-a2de-e4379dd540a1@gmail.com>

Hey Mike,
Very well spotted, thanks!

It will be great if you can test the patches on your machine.

cheers,
Yordan

On 9.08.19 г. 13:33 ч., Mike Auty wrote:
> Hiya,
> 
> I can't really review the rest of the code, my main language is python,
> but I spotted a couple of minor typos that might be worth fixing?  I
> didn't want to post them to everyone since they're fairly trivial.  5:S
> 
> "noRootWorn" might want to "noRootWarn"
> "your one risk." might want to be "your own risk."
> 
> Thanks for putting the patches together so quickly!  5:)
> 
> Mike  5:)
> 
> On 09/08/2019 09:06, Yordan Karadzhov (VMware) wrote:
>> Running the KernelShark GUI with Root privileges is not recommended due
>> to security reasons. The user will be allowed to continue on its own risk.
>>
>> Suggested-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
>> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204475
>> Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
>> ---
>>   kernel-shark/src/KsMainWindow.cpp | 28 ++++++++++++++++++++++++++++
>>   kernel-shark/src/KsMainWindow.hpp |  2 ++
>>   2 files changed, 30 insertions(+)
>>
>> diff --git a/kernel-shark/src/KsMainWindow.cpp b/kernel-shark/src/KsMainWindow.cpp
>> index 6439265..2560bf8 100644
>> --- a/kernel-shark/src/KsMainWindow.cpp
>> +++ b/kernel-shark/src/KsMainWindow.cpp
>> @@ -76,6 +76,9 @@ KsMainWindow::KsMainWindow(QWidget *parent)
>>   	_createMenus();
>>   	_initCapture();
>>   
>> +	if (geteuid() == 0)
>> +		_rootWarning();
>> +
>>   	_splitter.addWidget(&_graph);
>>   	_splitter.addWidget(&_view);
>>   	setCentralWidget(&_splitter);
>> @@ -1271,3 +1274,28 @@ void KsMainWindow::_deselectB()
>>   	_mState.updateLabels();
>>   	_graph.glPtr()->model()->update();
>>   }
>> +
>> +void KsMainWindow::_rootWarning()
>> +{
>> +	QString cbFlag("noRootWorn");
>> +
>> +	if (_settings.value(cbFlag).toBool())
>> +		return;
>> +
>> +	QMessageBox warn;
>> +	warn.setText("KernelShark will have Root privileges.");
>> +	warn.setInformativeText("Continue on your one risk.");
>> +	warn.setIcon(QMessageBox::Warning);
>> +	warn.setStandardButtons(QMessageBox::Close);
>> +
>> +	QCheckBox cb("Don't show this message again.");
>> +
>> +	auto lamCbChec = [&] (int state) {
>> +		if (state)
>> +			_settings.setValue(cbFlag, true);
>> +	};
>> +
>> +	connect(&cb, &QCheckBox::stateChanged, lamCbChec);
>> +	warn.setCheckBox(&cb);
>> +	warn.exec();
>> +}
>> diff --git a/kernel-shark/src/KsMainWindow.hpp b/kernel-shark/src/KsMainWindow.hpp
>> index 62e66a0..4a7b8ab 100644
>> --- a/kernel-shark/src/KsMainWindow.hpp
>> +++ b/kernel-shark/src/KsMainWindow.hpp
>> @@ -238,6 +238,8 @@ private:
>>   
>>   	void _deselectB();
>>   
>> +	void _rootWarning();
>> +
>>   	void _updateFilterMenu();
>>   
>>   	void _filterSyncCBoxUpdate(kshark_context *kshark_ctx);
>>
> 

  parent reply index

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09  8:06 [PATCH 0/3] Handle the case when KernelShark is started " Yordan Karadzhov (VMware)
2019-08-09  8:06 ` [PATCH 1/3] kernel-shark: Show warning message when running " Yordan Karadzhov (VMware)
     [not found]   ` <430194dd-0e96-bb3a-a2de-e4379dd540a1@gmail.com>
2019-08-09 12:13     ` Yordan Karadzhov (VMware) [this message]
2019-08-09 13:19   ` Steven Rostedt
2019-08-09  8:06 ` [PATCH 2/3] kernel-shark: Don't use pkexec " Yordan Karadzhov (VMware)
2019-08-09 13:33   ` Steven Rostedt
2019-08-09  8:06 ` [PATCH 3/3] kernel-shark: Use standart error message in KsMainWindow::_record() Yordan Karadzhov (VMware)
2019-08-09 13:35   ` Steven Rostedt

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a4870c9e-2a1b-c8b8-d334-8c77851e5026@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=mike.auty@gmail.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org linux-trace-devel@archiver.kernel.org
	public-inbox-index linux-trace-devel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox