[Date Prev] [Date Index] [Date Next] [Thread Prev] [Thread Index] [Thread Next]

Problems with conserver "pid" and "quit" commands

Han Pilmeyer han@zk3.dec.com
Tue, 15 Jan 2002 14:01:25 +0100


Hi,

I found three problems with conserver.
1) "console -P" displays in incorrect PID. The attached patch fixes
   this.
2) "console -q" doesn't stop conserver when you're on a "trusted
   connection". When you're authenticated it does work. The attached
   PID uses for "trusted" the same call as for "authenticated".
3) When you give the "console -q" command and you're on a "trusted
   connection", console will ask for the "root" password. However
   conserver never verifies this password and accepts anything. I'm
   not sure what would be the appropriate way to fix this. In fact
   when you are running as root and trusted it would be nice if
   console wouldn't ask for a password at all, so that it is easier to
   use "console -q" from a script. What do others think?

The attached patch fixes problem 1 and 2 (based on the 7.1.4-beta,
which works fine by the way). Can someone apply these to the source?

Cheers.
-- 
-- Han Pilmeyer, email: han@uto.dec.com
-- Compaq Tru64 UNIX engineering / Customer Care Consulting Group
-- Answers are the easy part, questions raise the doubt   -JB
*** master.c	Tue Jan 15 13:12:28 2002
--- master.c.org	Wed Oct 10 20:53:21 2001
***************
*** 437,443 ****
  
  	    if ('t' == cType) {
  		fileWrite(csocket, "trusted -- terminated\r\n", -1);
! 		kill(parentpid, SIGTERM);
  	    } else if ((char *)0 == pcArgs) {
  		fileWrite(csocket, "must be trusted to terminate\r\n", -1);
  	    } else if ((struct passwd *)0 == (pwd = getpwuid(0))) {
--- 437,443 ----
  
  	    if ('t' == cType) {
  		fileWrite(csocket, "trusted -- terminated\r\n", -1);
! 		fSawQuit = 1;
  	    } else if ((char *)0 == pcArgs) {
  		fileWrite(csocket, "must be trusted to terminate\r\n", -1);
  	    } else if ((struct passwd *)0 == (pwd = getpwuid(0))) {
***************
*** 452,458 ****
  	    exit(EX_OK);
  	}
  	if (0 == strcmp(acIn, "pid")) {
! 	    sprintf(acOut, "%d\r\n", parentpid);
  	    (void)fileWrite(csocket, acOut, -1);
  	    (void)fileClose(csocket);
  	    exit(EX_OK);
--- 452,458 ----
  	    exit(EX_OK);
  	}
  	if (0 == strcmp(acIn, "pid")) {
! 	    sprintf(acOut, "%d\r\n", (int)getpid());
  	    (void)fileWrite(csocket, acOut, -1);
  	    (void)fileClose(csocket);
  	    exit(EX_OK);