1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00

- Removed anything involving portnum global variable. Not proper in

newconf world
- #0002920 reported by aquanight, regarding command line mkpasswd,
  patched by BuHHunyx. Syntax: wircd.exe -P|-p authmethod password.
  If it is -p, it will get shown in a MessageBox, -P it will get copied
to clipboard
This commit is contained in:
stskeeps
2007-06-11 18:36:05 +00:00
parent 83a7cdd734
commit 36ba7623cf
5 changed files with 60 additions and 13 deletions
+6
View File
@@ -1760,3 +1760,9 @@ MOTDs
matches the umode for now)
- #0002695 reported by w00t regarding unused check_registered and
check_registered_user calls in s_misc.c
- Removed anything involving portnum global variable. Not proper in
newconf world
- #0002920 reported by aquanight, regarding command line mkpasswd,
patched by BuHHunyx. Syntax: wircd.exe -P|-p authmethod password.
If it is -p, it will get shown in a MessageBox, -P it will get copied
to clipboard.
+51 -10
View File
@@ -186,7 +186,6 @@ MODVAR char **myargv;
#else
LPCSTR cmdLine;
#endif
int portnum = -1; /* Server port number, listening this */
char *configfile = CONFIGFILE; /* Server configuration file */
int debuglevel = 10; /* Server debug level */
int bootopt = 0; /* Server boot option flags */
@@ -807,13 +806,13 @@ static int bad_command(void)
{
#ifndef _WIN32
(void)printf
("Usage: ircd [-f config] [-h servername] [-p portnumber] [-x loglevel] [-t] [-H]\n");
("Usage: ircd [-f config] [-h servername] [-x loglevel] [-t] [-H]\n");
(void)printf("Server not started\n\n");
#else
if (!IsService)
{
MessageBox(NULL,
"Usage: wircd [-h servername] [-p portnumber] [-x loglevel]\n",
"Usage: wircd [-h servername] [-x loglevel]\n",
"UnrealIRCD/32", MB_OK);
}
#endif
@@ -1217,6 +1216,7 @@ int InitwIRCD(int argc, char *argv[])
break;
#endif
#ifndef _WIN32
case 'p':
case 'P':
{
short type;
@@ -1245,12 +1245,55 @@ int InitwIRCD(int argc, char *argv[])
printf("Encrypted password is: %s\n", result);
exit(0);
}
#else /* _WIN32 */
case 'p':
case 'P':{
short type;
char *result;
srand(TStime());
if ((type = Auth_FindType(p)) == -1) {
MessageBox(NULL, p, "No such auth type", MB_ICONERROR | MB_OK);
return 0;
}
p = *++argv;
argc--;
#ifdef AUTHENABLE_UNIXCRYPT
if ((type == AUTHTYPE_UNIXCRYPT) && (strlen(p) > 8))
{
MessageBox(NULL, "Password truncated to 8 characters due to 'crypt' algorithm. "
"You are suggested to use the 'md5' algorithm instead.", "WARNING", MB_ICONWARNING | MB_OK);
p[8] = '\0';
}
#endif
if (!(result = Auth_Make(type, p))) {
MessageBox(NULL, "Authentication failed\n", "ERROR", MB_ICONERROR | MB_OK);
return 0;
}
if (flag == 'p')
MessageBox(NULL, result, "Encrypted password", MB_ICONINFORMATION | MB_OK);*/
else
if (OpenClipboard(NULL))
{
LPTSTR lptstrCopy;
HGLOBAL hglbCopy;
hglbCopy = GlobalAlloc(GMEM_MOVEABLE, lstrlen(result) + 1);
if(hglbCopy != NULL)
{
lptstrCopy = GlobalLock(hglbCopy);
lstrcpy(lptstrCopy, result);
GlobalUnlock(hglbCopy);
EmptyClipboard();
SetClipboardData(CF_TEXT, hglbCopy);
MessageBox(NULL, "Encrypted password copied to the clipboard",
"Encrypted password", MB_ICONINFORMATION | MB_OK);
}
CloseClipboard();
}
exit 0;
}
#endif
case 'p':
if ((portarg = atoi(p)) > 0)
portnum = portarg;
break;
case 's':
(void)printf("sizeof(aClient) == %ld\n",
(long)sizeof(aClient));
@@ -1506,9 +1549,6 @@ int InitwIRCD(int argc, char *argv[])
#else /* ifndef NEW_IO */
#endif /* ifndef NEW_IO */
#endif
if (portnum < 0)
portnum = PORTNUM;
me.port = portnum;
#ifndef NEW_IO
/* Is that have to be in s_bsd.c huh? */
(void)init_sys();
@@ -1530,6 +1570,7 @@ int InitwIRCD(int argc, char *argv[])
* We accept the first listen record
*/
portnum = conf_listen->port;
me.port = portnum;
/*
* This is completely unneeded-Sts
me.ip.S_ADDR =
+1 -1
View File
@@ -2098,7 +2098,7 @@ static struct SOCKADDR *connect_inet(ConfigItem_link * aconf, aClient *cptr,
bcopy((char *)&aconf->ipnum, (char *)&server.SIN_ADDR,
sizeof(struct IN_ADDR));
bcopy((char *)&aconf->ipnum, (char *)&cptr->ip, sizeof(struct IN_ADDR));
server.SIN_PORT = htons(((aconf->port > 0) ? aconf->port : portnum));
server.SIN_PORT = htons(aconf->port);
*lenp = sizeof(server);
return (struct SOCKADDR *)&server;
}
+2 -1
View File
@@ -136,7 +136,7 @@ DLLFUNC int h_velcro_configrun(ConfigFile *cf, ConfigEntry *ce, int type, int *e
if(!strcmp(ce->ce_varname, "loadmodule4")) {
config_status("%s:%i: loadmodule4: %s",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum, ce->ce_vardata);
Velcro::instanceOf().dependsOnModule("Velcro", ce->ce_vardata);
Velcro::instanceOf().dependsOnModule(".conf", ce->ce_vardata);
return 1;
}
return 0;
@@ -317,3 +317,4 @@ bool Velcro::isModuleLoading(const char *moduleName)
}
return false;
}
-1
View File
@@ -667,7 +667,6 @@ EXPORTS
parse_netmask
place_host_ban
port_range
portnum
pretty_mask
pretty_time_val
proceed_normal_client_handshake