Commit 55ce84d9 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Wrap stats report in DEBUG switch

Missed in earlier internationalisation but spotted in the binary - the stats report function is only called from a debug command, but the linker wasn't spotting that and removing the table of stats names.
Translate the descriptive text in debug_err in RPC.c.
Retagged as LanManFS-2_41.
parent 8a3f55c4
......@@ -28,6 +28,13 @@ Prns:Printers
Mnt:Mount
On:on server
User:as user
D00:EnumShares could not log on to %s
D01:EnumShares call on %s
D02:Can't find master browser or DC for %s
D03:EnumServers could not log on to %s
D04:EnumShares call on %s
D05:LogonUser connect to DC failed, user name
D06:NetGetUserInfo call failed, user name
NameL:----Longest-----
NameO:OmniClient
NameH:Machine name
......
......@@ -192,6 +192,7 @@ static void debug_scope ( BYTE *src )
#define debug_scope(a)
#endif
#ifdef DEBUG
static void show_scope ( BYTE *src )
{
int i;
......@@ -217,6 +218,7 @@ static void show_scope ( BYTE *src )
}
printf("'\n");
}
#endif
/* NETNAME management ==================================== */
......
......@@ -52,10 +52,25 @@ int RPC_ErrorCount=0;
/* Debug routine */
static err_t debug_err ( err_t res, char *text, char *name )
typedef enum
{
DE_ENUMSHARESNOLOGON = 0,
DE_ENUMSHARESCALLTO,
DE_NOMASTERBROWSER,
DE_ENUMSERVERSNOLOGON,
DE_ENUMSERVERSCALLTO,
DE_LOGONUSERNOCONN,
DE_NETGETUSERINFO
} debug_errs_t;
static err_t debug_err ( err_t res, debug_errs_t token, char *name )
{
char text[100];
if ( res != OK )
{
sprintf(text, "D%02u", token);
strcpy(text, MsgLookup(text));
RPC_ErrorCount++;
sprintf( RPC_DebugMsg, "%s %s: %s",
text, name, MsgError(res)->errmess );
......@@ -299,14 +314,14 @@ err_t RPC_EnumerateShares ( char *server )
server, "IPC$", NULL, NULL, &drv );
if ( res != OK )
return debug_err( res, "(EnumShares) could not log on to", server );
return debug_err( res, DE_ENUMSHARESNOLOGON, server );
Omni_AddInfo ( OAI_SERVER, server, SMB_GetConnInfo(drv, GCI_SERVERINFO), NULL );
res = RPC_EnumSharesOnConnection ( drv, server );
SMB_DeleteShare ( drv );
return debug_err( res, "EnumShares call on", server );
return debug_err( res, DE_ENUMSHARESCALLTO, server );
}
......@@ -364,20 +379,18 @@ err_t RPC_EnumerateServers ( char *workgroup )
server = RPC_GetDomainController ( workgroup );
if ( server == NULL )
return debug_err( ECANTFINDNAME,
"Can't find master browser or domain controller for",
workgroup );
return debug_err( ECANTFINDNAME, DE_NOMASTERBROWSER, workgroup);
res = SMB_CreateShare ( SHR_IPC, CREATE_NORMAL,
server, "IPC$", NULL, NULL, &drv );
if ( res != OK )
return debug_err( res, "(EnumServers) could not log on to", server );
return debug_err( res, DE_ENUMSERVERSNOLOGON, server );
res = RPC_EnumServersOnConnection ( drv, workgroup );
SMB_DeleteShare ( drv );
return debug_err( res, "EnumServers call on", server );
return debug_err( res, DE_ENUMSERVERSCALLTO, server );
}
/* ---------------------------- */
......@@ -395,8 +408,7 @@ err_t RPC_LogonUser ( char *server, char *user, char *password,
server, "IPC$", user, password, &drv );
if ( res != OK )
return debug_err(res, "LogonUser: connect to DC failed, user name",
user );
return debug_err(res, DE_LOGONUSERNOCONN, user );
/* NetUserGetInfo */
StartParams ( 0x0038, "zWrLh",
......@@ -440,7 +452,7 @@ err_t RPC_LogonUser ( char *server, char *user, char *password,
SMB_DeleteShare ( drv );
return debug_err(res, "NetGetUserInfo() call failed, user name", user );
return debug_err(res, DE_NETGETUSERINFO, user );
}
......
......@@ -41,6 +41,7 @@ struct stat_info
char *name;
};
#ifdef DEBUG
static struct stat_info statinfo[] =
{
STA_SERIOUS_BARF, SCLASS_GENERAL, "Internal errors",
......@@ -96,6 +97,7 @@ void Stat_Show ( void )
}
printf("\n");
}
#endif
/* ------------- */
......@@ -109,5 +111,3 @@ bool Stat_Init ( void )
return true;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment