- added a check for broken RH5 include files. With the standard RH5
[kai/samba.git] / source3 / utils / status.c
index 1a05f2b1afe573ce266b863961ef51be6276af73..40bafbe0c275c9ba367e48d2456085f1f66f09b1 100644 (file)
@@ -2,7 +2,7 @@
    Unix SMB/Netbios implementation.
    Version 1.9.
    status reporting
-   Copyright (C) Andrew Tridgell 1994-1997
+   Copyright (C) Andrew Tridgell 1994-1998
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -120,7 +120,7 @@ static void print_share_mode(share_mode_entry *e, char *fname)
   charset_initialise();
 
   DEBUGLEVEL = 0;
-  dbf = fopen("/dev/null","w");
+  dbf = stderr;
 
   if (getuid() != geteuid()) {
     printf("smbstatus should not be run setuid\n");
@@ -152,7 +152,7 @@ static void print_share_mode(share_mode_entry *e, char *fname)
 
   get_myname(myhostname, NULL);
 
-  if (!lp_load(servicesf,False)) {
+  if (!lp_load(servicesf,False,False,False)) {
     fprintf(stderr, "Can't load %s - run testparm to debug it\n", servicesf);
     return (-1);
   }
@@ -199,6 +199,7 @@ static void print_share_mode(share_mode_entry *e, char *fname)
     {
       if (fread(&crec,sizeof(crec),1,f) != 1)
        break;
+      if (crec.cnum == -1) continue;
       if ( crec.magic == 0x280267 && process_exists(crec.pid) 
            && Ucrit_checkUsername(uidtoname(crec.uid))                      /* added by OH */
          )