rayantony / linux-track

Automatically exported from code.google.com/p/linux-track
MIT License
0 stars 0 forks source link

segfault when /tmp/linuxtrack.01-5.log are not available #96

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run ltr_gui as root
2. run ltr_gui as non-root

What is the expected output? What do you see instead?
expected output is typical program execution on running ltr_gui as non-root.  
Instead it segfaults as it tries to open a file it doesnt have permission to 
due to root ownership.

What version of the product are you using? On what operating system?
both latest download and HEAD on MASTER of the source.  Ubuntu 14.04

Please provide any additional information below.
I have a patch for this problem which is to use random named logs instead of 
01-5.

Let me know if there is anything else I can do to help

Original issue reported on code.google.com by zdw...@gmail.com on 1 Jun 2015 at 2:40

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

thank you for reporting that problem; I tried to avoid such problems by 
checking if the program runs under root (and refusing to run if it is under 
root), but apparently I overlooked this...

That said, I used to use random filenames, but I wanted to avoid filling /tmp 
with logs; this was an idea to "rotate" logs, avoiding wasting space. I'll try 
to come up with some compromise...

Thank you for the patch, I do appreciate the effort you put into that, but I'm 
afraid I'll end up using the mkstemp function, that does very similar thing.

By the way, did you encounter any other problems that made you to try running 
it as root?

Kind regards,

Michal

Original comment by f.jo...@email.cz on 1 Jun 2015 at 6:32

GoogleCodeExporter commented 9 years ago
ah cool thanks.  I haven't coded in C in a long time.  mkstemp is an
infinetly better solution.  I did not have any other problems running as
root.  I was having some permission problems that I tried sorting out by
running as root and in a docker container, and then it took me a while to
figure out this cause, but I think it was the only negative side-effect.

Instead of mkstemp, you might also be able to check the permission of the
file before trying to open it.

Original comment by zdw...@gmail.com on 1 Jun 2015 at 8:04

GoogleCodeExporter commented 9 years ago
Hello,
the fix is now in the repository; you can download new universal package to 
test it here:

http://linuxtrack.eu/test/linuxtrack-0.99.12fix-32.zip

http://linuxtrack.eu/test/linuxtrack-0.99.12fix-64.zip

Please let me know if it does work for you too...
Thank you for your help, I really appreciate it.

Kind regards,

Michal

Original comment by f.jo...@email.cz on 1 Jun 2015 at 8:13