]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap-urlauth: imap-urlauth - Produce better user permission error message in...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Tue, 27 Jun 2023 10:02:19 +0000 (12:02 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 20 Oct 2023 18:21:41 +0000 (18:21 +0000)
src/lib-imap-urlauth/imap-urlauth.c

index a83e71a883aa89b4065e64842f7e56296fd833cf..c6c0e97be89804f1b3a779a5bd681f762e0edc55 100644 (file)
@@ -312,9 +312,14 @@ int imap_urlauth_generate(struct imap_urlauth_context *uctx,
                *client_error_r = "Invalid URL: Missing user name";
                return 0;
        }
-       if (user->anonymous || strcmp(url->userid, user->username) != 0) {
+       if (user->anonymous) {
+               *client_error_r =
+                       "Anonymous logins not permitted to generate URLAUTH";
+               return 0;
+       }
+       if (strcmp(url->userid, user->username) != 0) {
                *client_error_r = t_strdup_printf(
-                       "Not permitted to generate URLAUTH for user %s",
+                       "Not permitted to generate URLAUTH for other user %s",
                        url->userid);
                return 0;
        }