pcb

sudo make install gives core_lists.h root privs

Bug #1589612 reported by Bert Timmerman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Invalid
Low
Bert Timmerman

Bug Description

Hi Bert,

Did not see procedure for submitting patches for PCB at
http://pcb.geda-project.org/contributing.html.

Please see attachment, this seems trivial but on my debian
machine "sudo make install" leaves core_lists.h owned by
root with permission 600, very annoying. Resetting to 666
in the build after the mv allows me to "make" as a normal
user without having to manually fix the permissions.

Maybe this would be helpful to others.

Regards

Wiley Hill

Tags: build-system
Revision history for this message
Bert Timmerman (bert-timmerman) wrote :
Changed in pcb:
milestone: none → next-bug-release
Revision history for this message
Bert Timmerman (bert-timmerman) wrote :

Patch applied and pushed to "home/bert/LP1589612".

Changed in pcb:
importance: Undecided → Low
assignee: nobody → Bert Timmerman (bert-timmerman)
status: New → In Progress
Revision history for this message
Bert Timmerman (bert-timmerman) wrote :

Wiley Hill wrote on 2016-06-14 08:29PM:

Bert

The previous patch I sent only reset permissions on the core_lists.h,
after cleaning the source tree I discovered that to be effective,
permissions needed to be reset on all of the built headers. So I
created a new patch, please see attachment. Note that this patch
includes the changes made by the previous patch.

Regard

Wiley

Revision history for this message
Bert Timmerman (bert-timmerman) wrote :

Patch applied and pushed to "home/bert/LP1589612".

Revision history for this message
Bert Timmerman (bert-timmerman) wrote :

Hi,

I deleted the topic branch because chmod'ing to 666 as root may cause badness.

Basically this should be solved by not ending up with a root owned file.

Kind regards,

Bert Timmerman.

Changed in pcb:
milestone: next-bug-release → future-bug-release
Revision history for this message
Chad Parker (parker-charles) wrote :

I'm not sure how to not end up with root owned files when you use sudo. Isn't it kind of the point of sudo? That you're acting as root for a command?

This happens because core_lists.h and others are generated as part of the build process. If you're doing the build as root, then, yes, the files that are created will be owned by root.

If you build pcb as a regular user, then the files will be created by the regular user, and thus owned by them. A subsequently issued "sudo make install" will do the install part without regenerating any of the build files.

I guess my suggestion is not to build pcb as root, but only install pcb as root. I don't really see this as a bug in pcb. We could update the docs to suggest that the user not build as root (although the build instructions don't mention using sudo at all, even for install).

Changed in pcb:
milestone: pcb-4.1.1 → pcb-4.2.1
Revision history for this message
Chad Parker (parker-charles) wrote :

When I execute "sudo make DESTDIR=/tmp/pcb/testinstall install", I see most files installed with root ownership. The exception is the pcblib-newlib directory which retained my user's ownership credentials. I did not see any files in the build directory change ownership to root, including core_lists.h

I suspect what happened was the original user didn't do a "make" prior to the "sudo make install". Something in the source tree must have changed, so, core_lists.h was rebuilt. The solution here is to always run "make" as a regular user prior to running "sudo make install".

I don't think there's anything to fix here, so, I'm marking this as invalid.

Changed in pcb:
status: In Progress → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.