POV-Ray

The Persistence of Vision Raytracer (POV-Ray).

This is the legacy Bug Tracking System for the POV-Ray project. Bugs listed here are being migrated to our github issue tracker. Please refer to that for new reports or updates to existing ones on this system.

Tasklist

FS#154 - Installation on linux (unix ?) in $HOME/.povray/3.7 set wrong owner

Attached to Project: POV-Ray
Opened by Grimbert Jérôme (Le_Forgeron) - Sunday, 04 July 2010, 17:10 GMT
Last edited by Chris Cason (chrisc) - Wednesday, 15 December 2010, 02:53 GMT
Task Type Possible Bug
Category Platform-specific → Setup/Install
Status Closed
Assigned To No-one
Operating System Linux
Severity Low
Priority Normal
Reported Version 3.70 beta 37a
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Installation script (from sources) when run with a classical “sudo make install” would create povray.ini & povray.conf in $HOME/.povray/3.7 (so far so fine) with the owner as root and the permission to readonly for the real user.

Same goes for the owner of the 3.7 directories tree : .povray & .povray/3.7 are created with root owner, despite being in $HOME of the performing user.

Please fix ?

This task depends upon

Closed by  Chris Cason (chrisc)
Wednesday, 15 December 2010, 02:53 GMT
Reason for closing:  Fixed
Comment by Grimbert Jérôme (Le_Forgeron) - Tuesday, 10 August 2010, 07:34 GMT

Suggestion of correction: in the top level Makefile (or Makefile.in/Makefile.am), the section which create the user directories & files might be amended.

Current code (beta 38)

	@echo "Creating user directories..."; \
	for p in $(povuser) $(povconfuser) ; do \
	  $(mkdir_p) $$p && printf "%s\n" "$$p" "`cat $(povinstall)`" > $(povinstall); \
	done
	@echo "Copying user configuration and INI files..."; \
	for f in povray.conf povray.ini ; do \
	  if test -f $(povconfuser)/$$f; then \
	    echo "Creating backup of $(povconfuser)/$$f"; \
	    mv -f $(povconfuser)/$$f $(povconfuser)/$$f.bak; \
	  fi; \
	done; \
	$(INSTALL_DATA) $(top_srcdir)/povray.conf $(povconfuser)/povray.conf && echo "$(povconfuser)/povray.conf" >> $(povinstall); \
	$(INSTALL_DATA) $(top_builddir)/povray.ini $(povconfuser)/povray.ini && echo "$(povconfuser)/povray.ini" >> $(povinstall)

with additional properties in the start (reminder: povuser = $(HOME)/.povray )

owner= `stat -c %u ${HOME}`
group= `stat -c %g ${HOME}`
	@echo "Creating user directories..."; \
        $owner = 
	for p in $(povuser) $(povconfuser) ; do \
	  $(mkdir_p) $$p && chown $(owner) $$p && chgrp $(group) $$p && printf "%s\n" "$$p" "`cat $(povinstall)`" > $(povinstall); \
	done
	@echo "Copying user configuration and INI files..."; \
	for f in povray.conf povray.ini ; do \
	  if test -f $(povconfuser)/$$f; then \
	    echo "Creating backup of $(povconfuser)/$$f"; \
	    mv -f $(povconfuser)/$$f $(povconfuser)/$$f.bak; \
	  fi; \
	done; \
	$(INSTALL_DATA) $(top_srcdir)/povray.conf $(povconfuser)/povray.conf && chown $(owner) $(povconfuser)/povray.conf && chgrp $(owner) $(povconfuser)/povray.conf &&echo "$(povconfuser)/povray.conf" >> $(povinstall); \
	$(INSTALL_DATA) $(top_builddir)/povray.ini $(povconfuser)/povray.ini && chown $(owner) $(povconfuser)/povray.ini && chgrp $(group) $(povconfuser)/povray.ini && echo "$(povconfuser)/povray.ini" >> $(povinstall)

Of course, protection & detection for chgrp & chown can also be done (like mkdir_p) if needed.

The issue with "sudo make install" is that the $USER is changed to 'root', but the $HOME is not changed. (and within a sudo-ed shell, any 'id' is root, that's a bit the purpose of sudo)

I have no problem that files get installed in the $HOME of the installing user (it's even a good thing), just that the ownership (user & group) should be correct.

Comment by Grimbert Jérôme (Le_Forgeron) - Saturday, 25 September 2010, 19:52 GMT

Still present with beta 39 (from sources via perforce)

Comment by Grimbert Jérôme (Le_Forgeron) - Tuesday, 26 October 2010, 21:45 GMT

change #5166 (#5162) has been done.

Comment by Grimbert Jérôme (Le_Forgeron) - Thursday, 09 December 2010, 13:47 GMT

Checked as fixed with beta 40.

Loading...