|
@@ -284,7 +284,12 @@ err:
|
|
|
return p;
|
|
|
}
|
|
|
|
|
|
-#define UPCALL_BUF_LEN 128
|
|
|
+/* XXX: Need some documentation about why UPCALL_BUF_LEN is so small.
|
|
|
+ * Is user space expecting no more than UPCALL_BUF_LEN bytes?
|
|
|
+ * Note that there are now _two_ NI_MAXHOST sized data items
|
|
|
+ * being passed in this string.
|
|
|
+ */
|
|
|
+#define UPCALL_BUF_LEN 256
|
|
|
|
|
|
struct gss_upcall_msg {
|
|
|
refcount_t count;
|
|
@@ -462,8 +467,17 @@ static int gss_encode_v1_msg(struct gss_upcall_msg *gss_msg,
|
|
|
p += len;
|
|
|
gss_msg->msg.len += len;
|
|
|
}
|
|
|
- if (service_name != NULL) {
|
|
|
- len = scnprintf(p, buflen, "service=%s ", service_name);
|
|
|
+ if (service_name) {
|
|
|
+ char *c = strchr(service_name, '@');
|
|
|
+
|
|
|
+ if (!c)
|
|
|
+ len = scnprintf(p, buflen, "service=%s ",
|
|
|
+ service_name);
|
|
|
+ else
|
|
|
+ len = scnprintf(p, buflen,
|
|
|
+ "service=%.*s srchost=%s ",
|
|
|
+ (int)(c - service_name),
|
|
|
+ service_name, c + 1);
|
|
|
buflen -= len;
|
|
|
p += len;
|
|
|
gss_msg->msg.len += len;
|