Coda File System

pdbtool maxid debugging

From: Greg Troxel <gdt_at_ir.bbn.com>
Date: 16 Jul 1999 13:36:35 -0000
This is kind of trivial, but given that maxids seem to be getting
messed up, it seems like pdbtool should be able to report on this.

I should mention that the system on which I'm having trouble with
maxids getting bonked is NetBSD 1.4 on i386, with coda 5.2.7.

gcc version egcs-2.91.60 19981201 (egcs-1.1.1 release)
NetBSD 1.4 (GENERIC) #0: Fri May  7 12:27:31 PDT 1999 perry_at_cynic.cynic.net:/usr/src/sys/arch/i386/compile/GENERIC i386


Index: pdbtool.c
===================================================================
RCS file: /IR-CVS/coda/coda-src/al/pdbtool.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 pdbtool.c
*** pdbtool.c	1999/06/21 17:20:37	1.1.1.2
--- pdbtool.c	1999/07/16 13:28:43
***************
*** 379,384 ****
--- 379,396 ----
  	PDB_db_close(h);
  }
  
+ /* SHOW MAXIDS */
+ void tool_get_maxids(int argc,char *argv[]){
+ 	PDB_HANDLE h;
+ 	int maxuid, maxgid;
+ 	if(check_args_num(argc,1)){
+ 		printf("Usage: get_maxids\n");
+ 	}
+ 	h = PDB_db_open(O_RDWR);
+ 	PDB_db_maxids(h, &maxuid, &maxgid);
+ 	PDB_db_close(h);
+ 	printf("maxuid %d maxgid %d\n", maxuid, maxgid);
+ }
  
  /* SET MAXIDS */
  void tool_maxids(int argc,char *argv[]){
***************
*** 443,448 ****
--- 455,461 ----
  	printf("cm\tcompact the database (RARE)\n");
  	printf("ci\tchange the Id of a new user or group\n");
  	printf("cn\tchange the Name of a user\n");
+ 	printf("ids\tget the database maxids\n");
  	printf("maxids\tset the database maxids\n");
  	printf("u\tupdate an id\n");
  }
***************
*** 465,470 ****
--- 478,484 ----
  	{"ci", tool_changeId, 0, "change the Id of a user or group"},
  	{"cn", tool_changeName, 0, "change the Name of a user"},
  	{"u", tool_update, 0, "update an id"},
+ 	{"ids", tool_get_maxids, 0, "get the database maxids"},
  	{"maxids", tool_maxids, 0, "set the database maxids"},
  	{"help", tool_help, 0, "print help on commands"},
  	{"quit", Parser_exit, 0, "get me out of here"},
Received on 1999-07-16 09:37:43