Installing MIT-K5 client libraries as non-root

Marcus Watts mdw at spam.ifs.umich.edu
Fri Aug 31 01:45:08 EDT 2007


On 8/29/07, Mike Friedman <mikef at berkeley.edu> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Is there a way to install K5 (1.6.2 in particular) for client use without
> being superuser?  I thought I could do this as long as my userid owns all
> the directories into which I'm building and installing (I'm not installing
> a KDC). However, now I find that 'make install' wants to run 'ginstall'
> with the '-o root' option. Since I'm a non-root user, I'm not going to be
> able to chown anything, much less to root.
>
> On this system (Solaris 10), I'm interested only in the K5 libraries (for
> our own apps, written to the MIT K5 API) and the client utilities (e.g.,
> kinit, kadmin, etc.), not in the supplied apps such as those in
> ../appl/bsd. Is there, perchance, a configure or make option to specify
> that I don't want to install the binaries that are supposed to run as
> root, in particular, that I don't want/need to do chowns or setuids?
>
> Thanks.

"Sachin Punadikar" <punadikar.sachin at gmail.com> had suggested:
> Hi Mike,
> 
> Did you tried the below option while running the configure script ? Please
> try it. It will give you an option to install the libraries in the location
> you desire.
> ------------------------------------------------------------------------------
> By default, `make install' will install all the files in
> `/usr/local/bin', `/usr/local/lib' etc.  You can specify
> an installation prefix other than `/usr/local' using `--prefix',
> for instance `--prefix=$HOME'.
> -------------------------------------------------------------------------------
> -
> You can get more information by running
> $./configure --help
> 
> I hope this will resolve your problem.
> 
> - Sachin.

This won't solve Mike's problem.

--prefix sets where the software lives at runtime.  If you're installing
into your own directory that's probably useful.  But it's not sufficient,
because it doesn't address "install...-o root".

Another related option is DESTDIR.  Ie, Make install DESTDIR=/foo
This also alters the install process -- it prefixes every install path
with DESTDIR.  This is useful with AFS (ro vs. rw paths), and it's also
useful when building software packages for rpms, .deb's, etc.  The
key difference between prefix & DESTDIR is that DESTDIR shouldn't be
in the runtime path, prefix should be.  Again, DESTDIR won't solve
"install...-o root".

What you probably really want to pay attention to is autoconf's
AC_PROG_INSTALL, which selects a copy of install to set as @INSTALL@,
which then gets expanded when config/pre.in is prepended to all
the output makefiles.  You can override what AC_PROG_INSTALL would
select by setting INSTALL=
	ie,
		configure ... INSTALL=my-own-install
if you don't want to write your own install, you can use
the shell script in the kerberos source,
	./configure INSTALL=`pwd`/config/install-sh
the neat thing about this shell script is that you can
override the choices it makes for chown/chgrp at runtime.
So when you do make install, you can instead do this:
	env CHOWNPROG=/bin/true CHGRPPROG=/bin/true make install
This should answer's Mike's needs.

Under debian, yet another option is 'fakeroot' - but this
isn't necessary since the regular install doesn't blow up if
it can't give files away to root.

When I last ran into this problem (aix 4.3) I wound up writing
a glp and setting CHMODPROG='ignoreit chmod' for make install,
Here is the glp (grungy little program) ignoreit.c:
	main(argc,argv, envp)
		char **argv;
		char **envp;
	{
		int pid, status;
		switch(pid = fork()) {
		case 0:
			execvp(argv[1], argv+1);
			perror("exec");
			exit(0);
		case -1:
			exit(1);
		default:
			break;
		}
		waitpid(pid, &status, 0);
		exit(0);
	}
You can probably come up with a better solution than this; I was in
a hurry.

				-Marcus Watts



More information about the Kerberos mailing list