Been playing around with the modifications I've made to my local copy of they mud and learned a couple of things. First off, my passwords aren't being encrypted and secondly, there is a function in asciipasswd.c that doesn't like my redefined macro. Here are my most recent diffs, the one for utils.h has changed and I have one for asciipasswd.c
src/utils.h
Code:
--- ../tbamud/src/utils.h Mon Jun 22 00:20:14 2015
+++ ../tbamud/src/utils.h Sun Jul 5 16:27:40 2015
@@ -70,6 +70,8 @@
int get_class_by_name(char *classname);
char * convert_from_tabs(char * string);
int count_non_protocol_chars(char * str);
+/* crypt wrapper utility */
+const char * wrap_crypt(const char *, const char *);
/* Public functions made available form weather.c */
void weather_and_time(int mode);
@@ -927,9 +929,11 @@
#if defined(NOCRYPT) || !defined(CIRCLE_CRYPT)
/** When crypt is not defined. (NOTE: Player passwords will be plain text.) */
#define CRYPT(a,b) (a)
+#define ACRYPT(a,b) (a)
#else
/** When crypt is defined. Player passwords stored encrypted. */
-#define CRYPT(a,b) ((char *) crypt((a),(b)))
+#define CRYPT(a,b) (wrap_crypt((a),(b)))
+#define ACRYPT(a,b) ((char *) crypt((a),(b)))
#endif
/* Config macros */
src/util/asciipasswd.c
Code:
--- ../tbamud/src/util/asciipasswd.c Sun Jun 9 12:57:48 2013
+++ ../tbamud/src/util/asciipasswd.c Sun Jul 5 16:24:31 2015
@@ -22,7 +22,7 @@
if (argc != 3)
fprintf(stderr, "Usage: %s name password\n", argv[0]);
else
- printf("Name: %s\nPass: %s\n", CAP(argv[1]), CRYPT(argv[2], CAP(argv[1])));
+ printf("Name: %s\nPass: %s\n", CAP(argv[1]), ACRYPT(argv[2], CAP(argv[1])));
return (0);
}
If I could get people to review, test and comment I'd appreciate it. Thanks.