From 03744dc0cd49a54b4dd30645a2b77007c9d19bdc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 5 May 1996 11:34:03 +0000 Subject: - added hostname support to smbstatus - fix a bug where -s would not be recognised --- source/utils/status.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/utils/status.c b/source/utils/status.c index ed0ae532114..1ae38528d03 100644 --- a/source/utils/status.c +++ b/source/utils/status.c @@ -33,6 +33,7 @@ struct connect_record crec; extern int DEBUGLEVEL; extern FILE *dbf; +extern pstring myhostname; static pstring Ucrit_username = ""; /* added by OH */ int Ucrit_pid[100]; /* Ugly !!! */ /* added by OH */ @@ -69,7 +70,7 @@ int main(int argc, char *argv[]) return(1); } - while ((c = getopt(argc, argv, "pdsu:")) != EOF) { + while ((c = getopt(argc, argv, "pds:u:")) != EOF) { switch (c) { case 'd': verbose = 1; @@ -89,13 +90,13 @@ int main(int argc, char *argv[]) } } - - if (!lp_load(servicesf,False)) { fprintf(stderr, "Can't load %s - run testparm to debug it\n", servicesf); return (-1); } + get_myname(myhostname, NULL); + if (verbose) { printf("using configfile = %s\n", servicesf); printf("lockdir = %s\n", *lp_lockdir() ? lp_lockdir() : "NULL"); @@ -113,6 +114,9 @@ int main(int argc, char *argv[]) printf("You need to have status=yes in your smb config file\n"); return(0); } + else if (verbose) { + printf("Opened status file %s\n", fname); + } uid = getuid(); -- cgit