Csh invocation with euid root looks at group of .cshrc!

jay at artecon.UUCP jay at artecon.UUCP
Fri Feb 6 04:30:00 AEST 1987


Am I missing something obvious here?

I'm running Sun 3.2, and have had (for several years) the following
convenience program installed as 4750 root wheel:

	main(argc, argv)
	int argc;
	char **argv;
	{
		char host[12];
		char cmd[100];
	
		setreuid(0,0);
		if (argc == 1)  {
			system("/bin/csh");
		} else {
			sprintf(cmd, "/usr/ucb/rlogin %s", *++argv);
			system(cmd);
		}
	}

My .cshrc is 600 jay artedev, with the following lines at the top:

	if (`whoami` == "root") then
		source /usr2/jay/.rootaliases
		exit
	endif
	#lots of aliases, etc below

".rootaliases" contains a subset of my usual aliases for use with the root
shell and is 640 root wheel.  This all works fine when protections/group are
set up as above.

However, if I "chgrp wheel" my .cshrc (changing nothing else), my .cshrc no
longer gets sourced when invoking the program (the invocation is without
argument), hence neither does .rootaliases.  Yes, I did say that my .cshrc
was "600", and I am a member of both groups.

			       ?WHY?
Thanks in Advance,
-*jay			Jay Schlegel	sdcsvax!{hp-sdd,telesoft}!artecon!jay
					   	    seismo!esosun!



More information about the Comp.unix.wizards mailing list