Lazy-Newb-Pack / Lazy-Newb-Pack-Linux

A Lazy Newb Pack for Linux
http://lazynewbpack.com/
150 stars 12 forks source link

Failing to set capabilities on dwarf therapist file #57

Closed daniel-ferguson closed 6 years ago

daniel-ferguson commented 6 years ago

LNP Pack version: LinuxLNP-0.44.10-r011 (from http://dffd.bay12games.com/file.php?id=13244)

The terminal window which asks for sudo privileges for dwarf therapist is popping up on every ./startlnp. Initially I thought nothing of it, though eventually it got a bit annoying so I checked out the script. The terminal window closes right after password entry so there's no time to spot any errors.

On reading the script I realised it was supposed to be setting capabilities on the dwarf therapist binary, which is strange because capabilities should be persistent, it shouldn't be asking me every time I start LNP.

Then I spotted this...

The filename dwarftherapist is used when checking capabilities: https://github.com/Lazy-Newb-Pack/Lazy-Newb-Pack-Linux/blob/master/pack/startlnp#L31

And DwarfTherapist when setting them: https://github.com/Lazy-Newb-Pack/Lazy-Newb-Pack-Linux/blob/master/pack/startlnp#L35


Modifying line 35 to use LNP/utilities/dwarf_therapist/dwarftherapist fixes the issue. Checking that file's caps after starting NLP again confirms it:

> getcap LNP/utilities/dwarf_therapist/dwarftherapist
LNP/utilities/dwarf_therapist/dwarftherapist = cap_sys_ptrace+eip

edit: It looks like this issue was almost fixed in https://github.com/Lazy-Newb-Pack/Lazy-Newb-Pack-Linux/commit/7b10e350cee00b19da8972ba95ed85592bbd61f2#diff-32c92e3ccaa15cc07869e4fde585c314

lethosor commented 6 years ago

Yeah, DT changed its naming scheme recently.

carterscottm commented 6 years ago

Fixed in 4a337fd4ec3cf11b0bb8ff7e07c00e6f7a25e195.