[dovecot-cvs] dovecot/src/auth auth-digest-md5.c,1.13,1.14 auth.c,1.5,1.6 auth.h,1.3,1.4 userinfo-passwd-file.c,1.19,1.20

cras at procontrol.fi cras at procontrol.fi
Sun Dec 22 10:18:31 EET 2002


Update of /home/cvs/dovecot/src/auth
In directory danu:/tmp/cvs-serv13893/auth

Modified Files:
	auth-digest-md5.c auth.c auth.h userinfo-passwd-file.c 
Log Message:
t_strsplit() returns now const char **, which removes a few nasty casts.
Removed a few unneded functions and did some small cleanups.



Index: auth-digest-md5.c
===================================================================
RCS file: /home/cvs/dovecot/src/auth/auth-digest-md5.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- auth-digest-md5.c	22 Dec 2002 07:52:49 -0000	1.13
+++ auth-digest-md5.c	22 Dec 2002 08:18:29 -0000	1.14
@@ -59,7 +59,7 @@
 {
 	String *qoplist, *realms;
 	Buffer *buf;
-	char *const *tmp;
+	const char *const *tmp;
 	unsigned char nonce[16];
 	int i;
 
@@ -206,7 +206,7 @@
 
 static int verify_realm(const char *realm)
 {
-	char *const *tmp;
+	const char *const *tmp;
 
 	for (tmp = auth_realms; *tmp != NULL; tmp++) {
 		if (strcasecmp(realm, *tmp) == 0)
@@ -270,10 +270,9 @@
 }
 
 /* remove leading and trailing whitespace */
-static char *trim(char *str)
+static const char *trim(const char *str)
 {
-	/* @UNSAFE */
-	char *ret;
+	const char *ret;
 
 	while (IS_LWS(*str)) str++;
 	ret = str;
@@ -281,7 +280,7 @@
 	while (*str != '\0') str++;
 	if (str > ret) {
 		while (IS_LWS(str[-1])) str--;
-		*str = '\0';
+		ret = t_strdup_until(ret, str);
 	}
 
 	return ret;
@@ -383,7 +382,7 @@
 
 	if (strcmp(key, "digest-uri") == 0) {
 		/* type / host / serv-name */
-		char *const *uri = t_strsplit(value, "/");
+		const char *const *uri = t_strsplit(value, "/");
 
 		if (uri[0] == NULL || uri[1] == NULL) {
 			*error = "Invalid digest-uri";

Index: auth.c
===================================================================
RCS file: /home/cvs/dovecot/src/auth/auth.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- auth.c	19 Dec 2002 23:56:23 -0000	1.5
+++ auth.c	22 Dec 2002 08:18:29 -0000	1.6
@@ -15,7 +15,7 @@
 };
 
 AuthMethod auth_methods;
-char *const *auth_realms;
+const char *const *auth_realms;
 
 static AuthModuleList *auth_modules;
 static AuthReplyData failure_reply;
@@ -105,7 +105,7 @@
 
 void auth_init(void)
 {
-	char *const *methods;
+	const char *const *methods;
 	const char *env;
 
         auth_modules = NULL;

Index: auth.h
===================================================================
RCS file: /home/cvs/dovecot/src/auth/auth.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- auth.h	19 Dec 2002 23:56:23 -0000	1.3
+++ auth.h	22 Dec 2002 08:18:29 -0000	1.4
@@ -15,7 +15,7 @@
 } AuthModule;
 
 extern AuthMethod auth_methods;
-extern char *const *auth_realms;
+extern const char *const *auth_realms;
 
 void auth_register_module(AuthModule *module);
 void auth_unregister_module(AuthModule *module);

Index: userinfo-passwd-file.c
===================================================================
RCS file: /home/cvs/dovecot/src/auth/userinfo-passwd-file.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- userinfo-passwd-file.c	21 Dec 2002 13:08:49 -0000	1.19
+++ userinfo-passwd-file.c	22 Dec 2002 08:18:29 -0000	1.20
@@ -107,7 +107,7 @@
 				    AuthCookieReplyData *reply)
 {
 	PasswdUser *pu;
-	char *const *tmp;
+	const char *const *tmp;
 	unsigned char digest[16];
 	const char *str;
 
@@ -190,7 +190,7 @@
 }
 
 static void passwd_file_add(PasswdFile *pw, const char *username,
-			    const char *pass, char *const *args)
+			    const char *pass, const char *const *args)
 {
 	/* args = uid, gid, user info, home dir, shell, realm, mail, chroot */
 	PasswdUser *pu;
@@ -312,7 +312,7 @@
 static void passwd_file_parse_file(PasswdFile *pw)
 {
 	IStream *input;
-	char *const *args;
+	const char *const *args;
 	const char *line;
 
 	input = i_stream_create_file(pw->fd, default_pool, 2048, FALSE);




More information about the dovecot-cvs mailing list