diff --git a/src/init/adduser.sh b/src/init/adduser.sh index f91949481..dccd55014 100755 --- a/src/init/adduser.sh +++ b/src/init/adduser.sh @@ -50,14 +50,14 @@ else USERADD="/usr/sbin/useradd" OSMYSHELL="/sbin/nologin" else - # All current linux distributions should support system accounts for - # users/groups. If not, leave the GROUPADD/USERADD as it was before - # this change - sys_acct_chk () { - $1 --help 2>&1 | grep -e " *-r.*system account" >/dev/null 2>&1 && echo "$1 -r" || echo "$1" - } - GROUPADD=$(sys_acct_chk "/usr/sbin/groupadd -f") - USERADD=$(sys_acct_chk "/usr/sbin/useradd") + # All current linux distributions should support system accounts for + # users/groups. If not, leave the GROUPADD/USERADD as it was before + # this change + sys_acct_chk () { + $1 --help 2>&1 | grep -e " *-r.*system account" >/dev/null 2>&1 && echo "$1 -r" || echo "$1" + } + GROUPADD=$(sys_acct_chk "/usr/sbin/groupadd -f") + USERADD=$(sys_acct_chk "/usr/sbin/useradd") OSMYSHELL="/sbin/nologin" fi @@ -83,7 +83,7 @@ else for U in ${USER} ${USER_MAIL} ${USER_REM}; do if [ -x /usr/bin/getent ]; then if [ `getent passwd ${U} | wc -l` -lt 1 ]; then - if [ "$UNAME" = "OpenBSD" ] || [ "$UNAME" = "SunOS" ]; then + if [ "$UNAME" = "OpenBSD" ] || [ "$UNAME" = "SunOS" ] || [ "$UNAME" = "AIX" ]; then ${USERADD} -d "${DIR}" -s ${OSMYSHELL} -g "${GROUP}" "${U}" else ${USERADD} "${U}" -d "${DIR}" -s ${OSMYSHELL} -g "${GROUP}" diff --git a/src/os_auth/check_cert.c b/src/os_auth/check_cert.c index 365eeceea..35f8dc4c5 100644 --- a/src/os_auth/check_cert.c +++ b/src/os_auth/check_cert.c @@ -129,8 +129,8 @@ int check_subject_cn(X509 *cert, const char *manager) */ int check_hostname(ASN1_STRING *cert_astr, const char *manager) { - label c_labels[DNS_MAX_LABELS]; - label m_labels[DNS_MAX_LABELS]; + OS_label c_labels[DNS_MAX_LABELS]; + OS_label m_labels[DNS_MAX_LABELS]; int c_label_num = 0; int m_label_num = 0; int wildcard_cert = 0; @@ -209,7 +209,7 @@ int check_ipaddr(const ASN1_STRING *cert_astr, const char *manager) * of labels found. strtok() is not used as we want to detect labels with * length zero. */ -int label_array(const char *domain_name, label result[DNS_MAX_LABELS]) +int label_array(const char *domain_name, OS_label result[DNS_MAX_LABELS]) { int label_count = 0; const char *label_start = domain_name; @@ -221,7 +221,7 @@ int label_array(const char *domain_name, label result[DNS_MAX_LABELS]) } if (*label_end == '.' || *label_end == '\0') { - label *new_label = &result[label_count]; + OS_label *new_label = &result[label_count]; if ((new_label->len = (size_t)(label_end - label_start)) > DNS_MAX_LABEL_LEN) { return VERIFY_FALSE; @@ -249,7 +249,7 @@ int label_array(const char *domain_name, label result[DNS_MAX_LABELS]) /* Validate a label according to the guidelines in RFC 1035. This could * be relaxed if necessary. */ -int label_valid(const label *l) +int label_valid(const OS_label *l) { size_t i; @@ -272,7 +272,7 @@ int label_valid(const label *l) /* Compare two labels and determine whether they match. */ -int label_match(const label *label1, const label *label2) +int label_match(const OS_label *label1, const OS_label *label2) { size_t i; diff --git a/src/os_auth/check_cert.h b/src/os_auth/check_cert.h index ff244dd98..377f86af1 100644 --- a/src/os_auth/check_cert.h +++ b/src/os_auth/check_cert.h @@ -37,20 +37,20 @@ #define DNS_MAX_LABELS 127 #define DNS_MAX_LABEL_LEN 63 -typedef struct label_t { +typedef struct OS_label_t { char text[DNS_MAX_LABEL_LEN + 1]; size_t len; } -label; +OS_label; int check_x509_cert(const SSL *ssl, const char *manager); int check_subject_alt_names(X509 *cert, const char *manager); int check_subject_cn(X509 *cert, const char *manager); int check_hostname(ASN1_STRING *cert_astr, const char *manager); int check_ipaddr(const ASN1_STRING *cert_astr, const char *manager); -int label_array(const char *domain_name, label result[DNS_MAX_LABELS]); -int label_valid(const label *label); -int label_match(const label *label1, const label *label2); +int label_array(const char *domain_name, OS_label result[DNS_MAX_LABELS]); +int label_valid(const OS_label *label); +int label_match(const OS_label *label1, const OS_label *label2); char *asn1_to_cstr(ASN1_STRING *astr); #endif /* LIBOPENSSL_ENABLED */