/* as the syslog is not prepared, error is send to web*/
strlcpy(buff, "<H3>Error: Opengate configuration file ",BUFFMAXLN);
- strncat(buff, CONFIGFILE,BUFFMAXLN);
- strncat(buff, " is not found. Call the administrator.</H3><BR>",BUFFMAXLN);
+ strlcat(buff, CONFIGFILE,BUFFMAXLN);
+ strlcat(buff, " is not found. Call the administrator.</H3><BR>",BUFFMAXLN);
PutMessageToClient(buff);
return -1;
if(*errMsg!='\0'){
/* as the syslog is not prepared, error is send to web*/
strlcpy(buff, "<H3>Error: Opengate configuration file ",BUFFMAXLN);
- strncat(buff, CONFIGFILE,BUFFMAXLN);
- strncat(buff, " is illegal. Call the administrator.</H3><HR>",BUFFMAXLN);
- strncat(buff, "XML parser message: ", BUFFMAXLN);
- strncat(buff, errMsg, BUFFMAXLN);
- strncat(buff, "<HR>", BUFFMAXLN);
+ strlcat(buff, CONFIGFILE,BUFFMAXLN);
+ strlcat(buff, " is illegal. Call the administrator.</H3><HR>",BUFFMAXLN);
+ strlcat(buff, "XML parser message: ", BUFFMAXLN);
+ strlcat(buff, errMsg, BUFFMAXLN);
+ strlcat(buff, "<HR>", BUFFMAXLN);
PutMessageToClient(buff);
return -1;
if(isNull(ezxml_attr(xmlRoot, "ConfigVersion"))||
(strcmp(CONFIG_VERSION, ezxml_attr(xmlRoot, "ConfigVersion"))!=0)){
strlcpy(buff, "<H3>Error: Opengate configuration file ",BUFFMAXLN);
- strncat(buff, CONFIGFILE, BUFFMAXLN);
- strncat(buff, " has mismatch version.<br> Please update it with ",BUFFMAXLN);
- strncat(buff, CONFIGFILE, BUFFMAXLN);
- strncat(buff, ".sample.",BUFFMAXLN);
+ strlcat(buff, CONFIGFILE, BUFFMAXLN);
+ strlcat(buff, " has mismatch version.<br> Please update it with ",BUFFMAXLN);
+ strlcat(buff, CONFIGFILE, BUFFMAXLN);
+ strlcat(buff, ".sample.",BUFFMAXLN);
PutMessageToClient(buff);
return -1;
/* as the syslog is not prepared, error is send to web*/
strlcpy(buff, "<H3>Error: correct SYSLOG setting(local0-local7) is not found in Opengate configuration file ",BUFFMAXLN);
- strncat(buff, CONFIGFILE,BUFFMAXLN);
- strncat(buff, ". Call the administrator.</H3><BR>",BUFFMAXLN);
+ strlcat(buff, CONFIGFILE,BUFFMAXLN);
+ strlcat(buff, ". Call the administrator.</H3><BR>",BUFFMAXLN);
PutMessageToClient(buff);
return -1;
/* prepare userid-long as [userid@extraid] */
strlcpy(userIdLong, userId, WORDMAXLN);
if(!isNull(extraId)){
- strncat(userIdLong, "@", WORDMAXLN);
- strncat(userIdLong, extraId, WORDMAXLN);
+ strlcat(userIdLong, "@", WORDMAXLN);
+ strlcat(userIdLong, extraId, WORDMAXLN);
}
/* exclusive exec of ipfw to avoid overlapped rule number */
while((pStr=va_arg(ap, char *))!=(char *)0){
strcat(commandLine, " ");
- strncat(commandLine, pStr, BUFFMAXLN);
+ strlcat(commandLine, pStr, BUFFMAXLN);
}
free(pStr);
va_end(ap);
while((pStr=va_arg(ap, char *))!=(char *)0){
strcat(commandLine, " ");
- strncat(commandLine, pStr, BUFFMAXLN);
+ strlcat(commandLine, pStr, BUFFMAXLN);
}
free(pStr);
va_end(ap);
/* set filter */
strlcpy(filter, "(uid=", BUFFMAXLN);
- strncat(filter, userid, BUFFMAXLN);
- strncat(filter, ")", BUFFMAXLN);
+ strlcat(filter, userid, BUFFMAXLN);
+ strlcat(filter, ")", BUFFMAXLN);
/* search LDAP entry */
ret = ldap_search_ext_s(ld,baseDn,LDAP_SCOPE_SUBTREE,
/* meaning is [(head or space) userid-string (space or tail)] */
/* last-arg 0 of RegEx means ignore-case */
strlcpy(userIdPattern, "(^| )", WORDMAXLN);
- strncat(userIdPattern, userId, WORDMAXLN);
- strncat(userIdPattern, "( |$)", WORDMAXLN);
+ strlcat(userIdPattern, userId, WORDMAXLN);
+ strlcat(userIdPattern, "( |$)", WORDMAXLN);
return RegExMatch(usersList, userIdPattern, 0);
}
/* set full userid */
strlcpy(useridfull, userId,USERMAXLN);
if(!isNull(extraId)){
- strncat(useridfull, GetConfValue("UserIdSeparator"), USERMAXLN);
- strncat(useridfull, extraId, USERMAXLN);
+ strlcat(useridfull, GetConfValue("UserIdSeparator"), USERMAXLN);
+ strlcat(useridfull, extraId, USERMAXLN);
}
return useridfull;
}
/* if set mail domain, mail from userid+@+maildomain */
if(!isNull(pMailDomain)){
strlcpy(mailDefault, userId, BUFFMAXLN);
- strncat(mailDefault, "@", BUFFMAXLN);
- strncat(mailDefault, pMailDomain, BUFFMAXLN);
+ strlcat(mailDefault, "@", BUFFMAXLN);
+ strlcat(mailDefault, pMailDomain, BUFFMAXLN);
return TRUE;
}else{
err_msg("ERR at %s#%d: Can't get mail domain string from conf file.",__FILE__,__LINE__);
/* if orp string can be get from env var, concatenate it as uid@org */
pEnv=getenvEx(GetConfValue("AuthServer/OrgAttribute"),TRUE,TRUE);
if(!isNull(pEnv)){
- strncat(userid, GetConfValue("UserIdSeparator"), USERMAXLN);
- strncat(userid, pEnv, USERMAXLN);
+ strlcat(userid, GetConfValue("UserIdSeparator"), USERMAXLN);
+ strlcat(userid, pEnv, USERMAXLN);
}
ret=TRUE;
}
else{
pEnv=getenvEx(GetConfValue("AuthServer/EppnAttribute"),TRUE,FALSE);
if(!isNull(pEnv)){
- strncat(userid, pEnv, USERMAXLN);
+ strlcat(userid, pEnv, USERMAXLN);
ret=TRUE;
}
}
for(pBuff = tempBuff;
(pNext=StrSplit(pBuff, beforeStr)) != NULL;
pBuff = pNext){
- strncat(buff,pBuff,BUFFMAXLN);
- strncat(buff,afterStr,BUFFMAXLN);
+ strlcat(buff,pBuff,BUFFMAXLN);
+ strlcat(buff,afterStr,BUFFMAXLN);
}
- strncat(buff,pBuff,BUFFMAXLN);
+ strlcat(buff,pBuff,BUFFMAXLN);
return 0;
}
/* as the syslog is not prepared, error is send to web*/
strlcpy(buff, "<H3>Error: Opengate configuration file ",BUFFMAXLN);
- strncat(buff, CONFIGFILE,BUFFMAXLN);
- strncat(buff, " is not found. Call the administrator.</H3><BR>",BUFFMAXLN);
+ strlcat(buff, CONFIGFILE,BUFFMAXLN);
+ strlcat(buff, " is not found. Call the administrator.</H3><BR>",BUFFMAXLN);
PutMessageToClient(buff);
return -1;
if(*errMsg!='\0'){
/* as the syslog is not prepared, error is send to web*/
strlcpy(buff, "<H3>Error: Opengate configuration file ",BUFFMAXLN);
- strncat(buff, CONFIGFILE,BUFFMAXLN);
- strncat(buff, " is illegal. Call the administrator.</H3><HR>",BUFFMAXLN);
- strncat(buff, "XML parser message: ", BUFFMAXLN);
- strncat(buff, errMsg, BUFFMAXLN);
- strncat(buff, "<HR>", BUFFMAXLN);
+ strlcat(buff, CONFIGFILE,BUFFMAXLN);
+ strlcat(buff, " is illegal. Call the administrator.</H3><HR>",BUFFMAXLN);
+ strlcat(buff, "XML parser message: ", BUFFMAXLN);
+ strlcat(buff, errMsg, BUFFMAXLN);
+ strlcat(buff, "<HR>", BUFFMAXLN);
PutMessageToClient(buff);
return -1;
if(isNull(ezxml_attr(xmlRoot, "ConfigVersion"))||
(strcmp(CONFIG_VERSION, ezxml_attr(xmlRoot, "ConfigVersion"))!=0)){
strlcpy(buff, "<H3>Error: Opengate configuration file ",BUFFMAXLN);
- strncat(buff, CONFIGFILE, BUFFMAXLN);
- strncat(buff, " has mismatch version.<br> Please update it with ",BUFFMAXLN);
- strncat(buff, CONFIGFILE, BUFFMAXLN);
- strncat(buff, ".sample.",BUFFMAXLN);
+ strlcat(buff, CONFIGFILE, BUFFMAXLN);
+ strlcat(buff, " has mismatch version.<br> Please update it with ",BUFFMAXLN);
+ strlcat(buff, CONFIGFILE, BUFFMAXLN);
+ strlcat(buff, ".sample.",BUFFMAXLN);
PutMessageToClient(buff);
return -1;
/* as the syslog is not prepared, error is send to web*/
strlcpy(buff, "<H3>Error: correct SYSLOG setting(local0-local7) is not found in Opengate configuration file ",BUFFMAXLN);
- strncat(buff, CONFIGFILE,BUFFMAXLN);
- strncat(buff, ". Call the administrator.</H3><BR>",BUFFMAXLN);
+ strlcat(buff, CONFIGFILE,BUFFMAXLN);
+ strlcat(buff, ". Call the administrator.</H3><BR>",BUFFMAXLN);
PutMessageToClient(buff);
return -1;
/* prepare userid-long as [userid@extraid] */
strlcpy(userIdLong, userId, WORDMAXLN);
if(!isNull(extraId)){
- strncat(userIdLong, "@", WORDMAXLN);
- strncat(userIdLong, extraId, WORDMAXLN);
+ strlcat(userIdLong, "@", WORDMAXLN);
+ strlcat(userIdLong, extraId, WORDMAXLN);
}
/* exclusive exec of ipfw to avoid overlapped rule number */
/* prepare mail command [/bin/rmail user@domain] */
strlcpy(mailCmd, mailCmdPath, BUFFMAXLN);
- strncat(mailCmd, " ", BUFFMAXLN);
- strncat(mailCmd, mailAddress, BUFFMAXLN);
+ strlcat(mailCmd, " ", BUFFMAXLN);
+ strlcat(mailCmd, mailAddress, BUFFMAXLN);
/* prepare a pipe connected to the mail command */
mailer = popen(mailCmd, "w");
while((pStr=va_arg(ap, char *))!=(char *)0){
strcat(commandLine, " ");
- strncat(commandLine, pStr, BUFFMAXLN);
+ strlcat(commandLine, pStr, BUFFMAXLN);
}
free(pStr);
va_end(ap);
while((pStr=va_arg(ap, char *))!=(char *)0){
strcat(commandLine, " ");
- strncat(commandLine, pStr, BUFFMAXLN);
+ strlcat(commandLine, pStr, BUFFMAXLN);
}
free(pStr);
va_end(ap);