Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* LD_LIBRARY_PATH
@ 1995-01-24 11:00 S. Leemburg
  0 siblings, 0 replies; only message in thread
From: S. Leemburg @ 1995-01-24 11:00 UTC (permalink / raw)



PROBLEM DESCRIPTION:

- On OSF/1 version 3.0 running on an ALPHA 2100 A500, using shared
  libraries, I cannot execute an root-setuid-program using a shared
  library specified by the LD_LIBRARY_PATH environment-variable.

  for example, when executing the below program, which calls
  a program using a LD_LIBRARY_PATH specified shared library, I get
  this error: 	'19133:/usr/users/unims/progs//men: \
		/sbin/loader: Fatal Error: cannot map libunims.o'

  ( -rwsr-xr-x   1 root     users      24608 Jan 24 10:59 a.out )

INFORMATION OBTAINED SO FAR:

- In 'Design of the OSF/1 Operating System', Prentice Hall, New Jersey;
  chapter 8.12 is explained that a privileged program with any privilige
  bits set wil allways be loaded with the default loader, for security
  reasons. Chapter 15 explores the security architecture even more.

  In these chapters there is mentioning of a tool 'lib_admin', with 
  which packages can be registered.

  This tool is not available on (DEC) OSF/1, however. A search through
  the manual pages gives no leads to an other name. Inquiries at DEC-
  Holland, thusfar, has had no result.

LOOKING FOR:

- How to register alternative shared libraries which I, as superuser,
  can install, mark secure an still specify by means of LD_LIBRARY_PATH.

ANSWERS TO:

- Please reply to S.Leemburg@inter.nl.net

NB:

- Posting is new to me, please forgive any errors.

TEST PROGRAM:

#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>

#define CMDSIZE		1024
#define	EXECUTE(cmd)	{ fprintf(stderr, "%s\n", #cmd); cmd; }

main(argc, argv)
	int argc;
	char **argv;
{
	uid_t ruid = getuid();
	uid_t euid = geteuid();
	gid_t rgid = getgid();
	gid_t egid = getegid();
	char cmd[CMDSIZE + 1];	/* to store the command */

	/* show id settings */
	EXECUTE(fprintf(stdout,
		"euid=%d (uid=%d), egid=%d (gid=%d)\n", 
		euid, ruid, egid, rgid))

	/* compose command */
	for( *cmd='\0', ++argv, --argc; argc > 0; ++argv, --argc )
		EXECUTE(sprintf(cmd, "%s%s%s", cmd, *cmd ? " " : "", *argv))

	/* switch back to original id's */
	EXECUTE(setgid(rgid))
	EXECUTE(setuid(ruid))

	/* and show them again */
	EXECUTE(fprintf(stdout,
		"euid=%d (uid=%d), egid=%d (gid=%d)\n", 
		euid, ruid, egid, rgid))

	/* show the command */
	EXECUTE(fprintf(stdout,"going to execute: %s\n", cmd))

	/* ask for enter (give time to see statements) */
	EXECUTE((void) fgetc(stdin))

	/* fork and exec the command */
	EXECUTE(system(cmd))

	/* finish */
	EXECUTE(exit(0))
}
--
Stephan Leemburg	
S.Leemburg@inter.nl.net
< alles op persoonlijke titel >
-- 
                              ___    ___________________________
   |   ---------             / | |  /\ Muller Air Freight B.V.  \
   | ___\/|\ _\_____________/  | | / )                           )
  <||    \  \  \ That's Wright  /  \ ( Stephan Leemburg         (


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1995-01-24 11:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-01-24 11:00 LD_LIBRARY_PATH S. Leemburg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox