Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gist printing warning with every invocation #271

Open
uplime opened this issue Nov 16, 2017 · 10 comments
Open

gist printing warning with every invocation #271

uplime opened this issue Nov 16, 2017 · 10 comments

Comments

@uplime
Copy link

uplime commented Nov 16, 2017

I just installed gist, and everything is mostly working as expected, but I get a warning every time I invoke it:

Nicholass-MacBook-Air:~ nchambers$ gist -r eead1d1f1209cc6acb62648ae075afb0
/Users/nchambers/.rvm/gems/ruby-2.4.1/gems/gist-4.6.1/lib/gist.rb:477: warning: Insecure world writable dir /Users/nchambers/qt in PATH, mode 040777
import hexchat

__module_name__ = "partdetach"
__module_version__ = "1.0"
__module_description__ = "/part a channel when detaching from it in ZNC"

def part(word, word_eol, userdata):
	if(len(word) < 2):
		print("no channel specified")

	hexchat.command("PART {words[1]}")
	hexchat.command("CLOSE {words[1]}")
	return hexchat.EAT_ALL

hexchat.hook_server("PART", part)
Nicholass-MacBook-Air:~ nchambers$

That folder is installed by QT, and I'd rather not mess with the permissions. I'm also not concerned with the permissions of that folder, as I know exactly what is in there. Is there any way to disable that warning?

@ConradIrwin
Copy link
Collaborator

ConradIrwin commented Nov 16, 2017 via email

@uplime
Copy link
Author

uplime commented Nov 16, 2017

Certainly: https://gist.github.com/0dcadd1c27ab0b413006b5118d42b9d5

If it helps, I installed via gem install gist and here is my environment:

Nicholass-MacBook-Air:~ nchambers$ rvm --version
rvm 1.29.3 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
Nicholass-MacBook-Air:~ nchambers$ ruby --version
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
Nicholass-MacBook-Air:~ nchambers$ gem --version
2.6.14
Nicholass-MacBook-Air:~ nchambers$

@ConradIrwin
Copy link
Collaborator

ConradIrwin commented Nov 16, 2017 via email

@uplime
Copy link
Author

uplime commented Nov 16, 2017

Ok, it looks like the which command is giving you that error.

It might be, but I've never had which give me that error before, and I'm not sure how it would be aware of the ruby file. If I modify the file to silence which completely, it still prints the error.

If you run something like the following in a termainal

$(which -p which) which

Do you see the error message?

My which doesn't have a -p, but if I try it without the -p I don't get an error.

I think its complaint is that you have a directory in your path that anyone with shell access to your machine could overwrite your binaries (sounds like a security hole, but if it's a single user machine it's probably irrelevant).

That is my guess as well. I'm not overly concerned, since it is just my own personal macbook and not a (production) server. Those are the default permissions that QT created used for the folder, so I'd rather not modify them if that is possible.

@uplime
Copy link
Author

uplime commented Nov 16, 2017

Also, incidentally, I can't find that warning in which's code anywhere: https://opensource.apple.com/source/shell_cmds/shell_cmds-149/which/which.c.auto.html

@ConradIrwin
Copy link
Collaborator

ConradIrwin commented Nov 16, 2017 via email

@uplime
Copy link
Author

uplime commented Nov 16, 2017

Thank you for the suggestion. I will definitely try that. I'm unfamiliar with pry (beyond the fact that it is a debugger). Do I just gem install pry and pry gist whatever?

@uplime
Copy link
Author

uplime commented Nov 16, 2017

So I figured out how to use pry:

Nicholass-MacBook-Air:gist-4.6.1 nchambers$ pwd
/Users/nchambers/.rvm/gems/ruby-2.4.1/gems/gist-4.6.1
Nicholass-MacBook-Air:gist-4.6.1 nchambers$ pry
[1] pry(main)> require './lib/gist'
/Users/nchambers/.rvm/gems/ruby-2.4.1/gems/pry-0.11.3/lib/pry/pager.rb:144: warning: Insecure world writable dir /Users/nchambers/qt in PATH, mode 040777
=> true
[2] pry(main)> Gist.which('clear')
=> true
[3] pry(main)>
Nicholass-MacBook-Air:gist-4.6.1 nchambers$

So if I'm understanding this correctly, it looks like require is the culprit?

@ConradIrwin
Copy link
Collaborator

ConradIrwin commented Nov 16, 2017 via email

@uplime
Copy link
Author

uplime commented Nov 17, 2017

Interesting... I'll dig deeper into that and get back to you. Thanks for the help, even though it's looking like the problem isn't with gist!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants