On Mon, 1 Jun 2020 at 14:59, Ryan Marsaw via blfs-dev <[email protected]> wrote: > > On Mon, 1 Jun 2020, John Burrell via blfs-dev wrote: > > > On Mon, 1 Jun 2020 at 11:35, Xi Ruoyao via blfs-dev > > <[email protected]> wrote: > >> > >> On 2020-06-01 10:58 +0100, John Burrell via blfs-dev wrote: > >> > I use MSB's package user package management system and up til now it > >> > has worked fine but I've come unstuck installing sudo-1.9.0. > >> > > >> > I get: > >> > > >> > make[1]: Entering directory '/usr/src/security/sudo/sudo-1.9.0/lib/util' > >> > /bin/sh ../../scripts/mkinstalldirs /usr/lib/sudo > >> > case "" in \ > >> > *-no-install*) ;; \ > >> > *) if [ X"yes" = X"yes" ]; then \ > >> > INSTALL_BACKUP='' /bin/sh ../../libtool --tag=disable-static --quiet > >> > --mode=install /bin/sh ../../install-sh -c -o 0 -g 0 libsudo_util.la > >> > /usr/lib/sudo; \ > >> > fi;; \ > >> > esac > >> > /sbin/chown: changing ownership of > >> > '/usr/lib/sudo/libsudo_util.so.0.0.0': Operation not permitted > >> > make[1]: *** [Makefile:284: install] Error 1 > >> > > >> > In the dir lib/util the relevant bit of the Makefile.in is: > >> > > >> > install: install-dirs > >> > case "$(LT_LDFLAGS)" in \ > >> > *-no-install*) ;; \ > >> > *) if [ X"$(shlib_enable)" = X"yes" ]; then \ > >> > INSTALL_BACKUP='$(INSTALL_BACKUP)' $(LIBTOOL) > >> > $(LTFLAGS) --quiet --mode=install $(INSTALL) $(INSTALL_OWNER) > >> > libsudo_util.la $(DESTDIR)$(libexecdir)/sudo; \ > >> > fi;; \ > >> > esac > >> > > >> > install-dirs: > >> > $(SHELL) $(scriptdir)/mkinstalldirs $(DESTDIR)$(libexecdir)/sudo > >> > > >> > install-binaries: > >> > > >> > install-includes: > >> > > >> > install-doc: > >> > > >> > install-plugin: > >> > > >> > I assume the chown occurs as part of the install-binaries but I can't > >> > find the code for install-binaries. Could someone give me a clue as to > >> > where I might find this code? > >> > >> I never use this package management approach but it does not make sense to > >> install sudo with a non-root user owning it. sudo only works as a > >> setuid-root > >> executable. > >> -- > > I set any necessary setuid-root binaries and the required root > > ownerships after installation. But at the moment I can't install it. > > I need to edit the Makefile to remove the chown on the library in > > /usr/lib/sudo but I don't know where that chown command is. > > > > Thanks > > > > jb. > > One change that can be made is by editing the Makefile.in: > > Look for these lines: > # User and group ids the installed files should be "owned" by > install_uid = 0 > install_gid = 0 > > By replacing the 0s with the uid/gid of the user who's building Sudo, > you'll be able to install Sudo in a DESTDIR way without any errors. Of > course it'll be up to you to change the ownership of the files > afterwards. The file permissions should not need to be modified (at > least that's been my experience). > > Cheers, > > --Ryan > --
Thanks for your suggestion. Yes, I tried playing with those, but, as you say, I had to use DESTDIR and then install the files. I found that the chown and chgrp commands are set up in install-sh. They are set as variables CHOWN and CHGROUP. So I added a sed in my script do disable using these and then made the few required changes at the end of the script as root. Everything is fine now. jb. -- http://lists.linuxfromscratch.org/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
