Skip to content

Commit 7359aa3

Browse files
Merge pull request #943 from Bischoff/iucv-trim-newlines
Trim newlines and other hidden characters from userid
2 parents 77d3764 + 358eff5 commit 7359aa3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

doc/source/makeimage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Feilong manages the deployed VM via IUCV channel. IUCV service
106106
should be configured on zLinux before capture it to make image. Following the below
107107
steps to install and configure IUCV service.
108108

109-
1. Logon your BYOL(Bring Your Own Linux, which will be used to represent the Linux
109+
1. Logon your BYOL (Bring Your Own Linux, which will be used to represent the Linux
110110
on which the Feilong will be run), and copy the following files
111111
to target VM
112112

zthin-parts/zthin/src/IUCV/iucvserver.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,11 @@ int check_client_authorization(int newsockfd, char *req_userid)
7676
syslog(LOG_ERR, "ERROR: Fail to close authorized file after reading: %s\n",strerror(errno));
7777
}
7878
fp = NULL;
79+
/* trim invisible characters from the userid */
80+
len = strcspn(client_userid, "\r\n ");
81+
client_userid[len] = '\0';
7982
/* if the userid is not authorized, send error message back*/
80-
if (strcasecmp(req_userid,client_userid))
83+
if (strcasecmp(req_userid, client_userid))
8184
{
8285
sprintf(err_msg, "UNAUTHORIZED_ERROR: Userid %s is not authorized, IUCV agent only can communicate with specified open cloud user!#0", req_userid);
8386
syslog(LOG_ERR, err_msg);

0 commit comments

Comments
 (0)