summaryrefslogtreecommitdiffstats
path: root/src/lib/krb5/krb/unparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/krb5/krb/unparse.c')
-rw-r--r--src/lib/krb5/krb/unparse.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/lib/krb5/krb/unparse.c b/src/lib/krb5/krb/unparse.c
index fc9cc7a80..7247d9a44 100644
--- a/src/lib/krb5/krb/unparse.c
+++ b/src/lib/krb5/krb/unparse.c
@@ -120,13 +120,9 @@ krb5_unparse_name_ext(context, principal, name, size)
switch (*cp) {
case COMPONENT_SEP:
case REALM_SEP:
- case '\0':
- *q++ = '\\';
- *q++ = *cp;
- break;
case '\\':
*q++ = '\\';
- *q++ = '\\';
+ *q++ = *cp;
break;
case '\t':
*q++ = '\\';
@@ -140,6 +136,10 @@ krb5_unparse_name_ext(context, principal, name, size)
*q++ = '\\';
*q++ = 'b';
break;
+ case '\0':
+ *q++ = '\\';
+ *q++ = '0';
+ break;
default:
*q++ = *cp;
}
@@ -156,11 +156,22 @@ krb5_unparse_name_ext(context, principal, name, size)
switch (*cp) {
case COMPONENT_SEP:
case REALM_SEP:
- case '\t':
case '\\':
*q++ = '\\';
*q++ = *cp;
break;
+ case '\t':
+ *q++ = '\\';
+ *q++ = 't';
+ break;
+ case '\n':
+ *q++ = '\\';
+ *q++ = 'n';
+ break;
+ case '\b':
+ *q++ = '\\';
+ *q++ = 'b';
+ break;
case '\0':
*q++ = '\\';
*q++ = '0';