[Fedora-directory-commits] adminserver/lib/libadmin util.c, 1.9, 1.10
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/adminserver/lib/libadmin
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22940/lib/libadmin
Modified Files:
util.c
Log Message:
Resolves: #357501
Summary: Console/admin express: can't view log files
Description: Implemented getLogDir to get the log dir from the server's
config info. To share psetHasObjectClass, moved it from security.c to
lib/libadmin/util.c.
Index: util.c
===================================================================
RCS file: /cvs/dirsec/adminserver/lib/libadmin/util.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- util.c 11 May 2007 19:44:05 -0000 1.9
+++ util.c 31 Oct 2007 05:30:54 -0000 1.10
@@ -1349,72 +1349,90 @@
PRStatus status = PR_GetFileInfo(name, &fileinfo);
ret = ((status == PR_SUCCESS) && (fileinfo.type == filetype));
if (ret) {
- /* checks out ok - let's split it into the base name and the parent dir,
- open the parent dir, and see if the base name exists in the parent dir
- */
- char *copy = PL_strdup(name);
- size_t len = strlen(copy);
- char *ptr = ©[len-1];
- /* get the basename - a really bad name may look like
- /path/foo/// or even ///////////////// */
- for (; (ptr > copy) && (*ptr == '/'); --ptr) {
- /* do nothing */
- }
- if ((ptr == copy) && (*ptr == '/')) {
- /* bad - string consists of nothing but '/' */
- ptr = NULL;
- ret = 0;
- } else {
- PRDir *pdir;
- PRDirEntry *pent;
+ /* checks out ok - let's split it into the base name and the parent dir,
+ open the parent dir, and see if the base name exists in the parent dir
+ */
+ char *copy = PL_strdup(name);
+ size_t len = strlen(copy);
+ char *ptr = ©[len-1];
+ /* get the basename - a really bad name may look like
+ /path/foo/// or even ///////////////// */
+ for (; (ptr > copy) && (*ptr == '/'); --ptr) {
+ /* do nothing */
+ }
+ if ((ptr == copy) && (*ptr == '/')) {
+ /* bad - string consists of nothing but '/' */
+ ptr = NULL;
+ ret = 0;
+ } else {
+ PRDir *pdir;
+ PRDirEntry *pent;
- ret = 0;
- if (*ptr == '/') {
- *ptr = 0; /* terminate the string at the first trailing '/' */
- }
- ptr = strrchr(copy, '/');
- if (!ptr) {
- ptr = copy;
- copy = PL_strdup(".");
- } else {
- *ptr = 0;
- ++ptr;
- ptr = PL_strdup(ptr);
- }
- /* copy now points at the parent, ptr at the child */
- if (pdir = PR_OpenDir(copy)) {
- for(pent = PR_ReadDir(pdir, PR_SKIP_BOTH); pent && !ret;
- pent = PR_ReadDir(pdir, PR_SKIP_BOTH)) {
- ret = !strcmp(pent->name, ptr);
- }
- PR_CloseDir(pdir);
- }
- if (ret && childname && (filetype == PR_FILE_DIRECTORY)) {
- ret = 0;
- /* we've verified that name is a valid directory - see if
- the given filename exists in that directory */
- if (pdir = PR_OpenDir(name)) {
- for(pent = PR_ReadDir(pdir, PR_SKIP_BOTH); pent && !ret;
- pent = PR_ReadDir(pdir, PR_SKIP_BOTH)) {
- if (childlen > 0) {
- ret = !strncmp(pent->name, childname, childlen);
- } else {
- ret = !strcmp(pent->name, childname);
- }
- }
- PR_CloseDir(pdir);
- if (ret) {
- /* child exists - check type */
- char *fullname = PR_smprintf("%s%c%s", name, FILE_PATHSEP, childname);
- status = PR_GetFileInfo(fullname, &fileinfo);
- ret = ((status == PR_SUCCESS) && (fileinfo.type == childtype));
- PR_smprintf_free(fullname);
- }
- }
- }
- }
- PL_strfree(copy);
- PL_strfree(ptr);
+ ret = 0;
+ if (*ptr == '/') {
+ *ptr = 0; /* terminate the string at the first trailing '/' */
+ }
+ ptr = strrchr(copy, '/');
+ if (!ptr) {
+ ptr = copy;
+ copy = PL_strdup(".");
+ } else {
+ *ptr = 0;
+ ++ptr;
+ ptr = PL_strdup(ptr);
+ }
+ /* copy now points at the parent, ptr at the child */
+ if (pdir = PR_OpenDir(copy)) {
+ for(pent = PR_ReadDir(pdir, PR_SKIP_BOTH); pent && !ret;
+ pent = PR_ReadDir(pdir, PR_SKIP_BOTH)) {
+ ret = !strcmp(pent->name, ptr);
+ }
+ PR_CloseDir(pdir);
+ }
+ if (ret && childname && (filetype == PR_FILE_DIRECTORY)) {
+ ret = 0;
+ /* we've verified that name is a valid directory - see if
+ the given filename exists in that directory */
+ if (pdir = PR_OpenDir(name)) {
+ for(pent = PR_ReadDir(pdir, PR_SKIP_BOTH); pent && !ret;
+ pent = PR_ReadDir(pdir, PR_SKIP_BOTH)) {
+ if (childlen > 0) {
+ ret = !strncmp(pent->name, childname, childlen);
+ } else {
+ ret = !strcmp(pent->name, childname);
+ }
+ }
+ PR_CloseDir(pdir);
+ if (ret) {
+ /* child exists - check type */
+ char *fullname = PR_smprintf("%s%c%s", name, FILE_PATHSEP, childname);
+ status = PR_GetFileInfo(fullname, &fileinfo);
+ ret = ((status == PR_SUCCESS) && (fileinfo.type == childtype));
+ PR_smprintf_free(fullname);
+ }
+ }
+ }
+ }
+ PL_strfree(copy);
+ PL_strfree(ptr);
}
return ret;
}
+
+NSAPI_PUBLIC int
+util_psetHasObjectClass(PsetHndl pset, const char *ocname)
+{
+ int rval = 0;
+ char *val = NULL;
+ ValueType nodeObjectClass = psetGetObjectClass(pset, "" /* use root node */, &rval);
+ ValueType iter = nodeObjectClass;
+
+ rval = 0;
+ while ((!rval) && ((val = *iter++))) {
+ rval = !PL_strcasecmp(ocname, val);
+ }
+
+ deleteValue(nodeObjectClass);
+ return rval;
+}
+
15 years, 11 months
[Fedora-directory-commits] adminserver/admserv/cgi-src40 viewlog.c, 1.9, 1.10 security.c, 1.11, 1.12 cgicommon.h, 1.1, 1.2
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/adminserver/admserv/cgi-src40
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22940/admserv/cgi-src40
Modified Files:
viewlog.c security.c cgicommon.h
Log Message:
Resolves: #357501
Summary: Console/admin express: can't view log files
Description: Implemented getLogDir to get the log dir from the server's
config info. To share psetHasObjectClass, moved it from security.c to
lib/libadmin/util.c.
Index: viewlog.c
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/cgi-src40/viewlog.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- viewlog.c 27 Jun 2007 22:24:59 -0000 1.9
+++ viewlog.c 31 Oct 2007 05:30:53 -0000 1.10
@@ -56,19 +56,19 @@
#define RESOURCE_FILE "viewlog"
#define resource_key(a,b) a b
-#define DBT_INV_NUMBER resource_key(RESOURCE_FILE, "1")
-#define DBT_INV_NUMBER_DESC resource_key(RESOURCE_FILE, "2")
-#define DBT_SUBTITLE resource_key(RESOURCE_FILE, "3")
-#define DBT_WITH resource_key(RESOURCE_FILE, "4")
-#define DBT_NO_DIR resource_key(RESOURCE_FILE, "5")
-#define DBT_NO_DIR_DESC resource_key(RESOURCE_FILE, "6")
-#define DBT_NO_FILE resource_key(RESOURCE_FILE, "7")
-#define DBT_NO_FILE_DESC resource_key(RESOURCE_FILE, "8")
-#define DBT_NO_DIR_FOUND resource_key(RESOURCE_FILE, "9")
-#define DBT_NO_ID resource_key(RESOURCE_FILE, "10")
-#define DBT_NO_ID_DESC resource_key(RESOURCE_FILE, "11")
-#define DBT_INV_NOHTML resource_key(RESOURCE_FILE, "12")
-#define DBT_INV_NOHTML_DESC resource_key(RESOURCE_FILE, "13")
+#define DBT_INV_NUMBER resource_key(RESOURCE_FILE, "1")
+#define DBT_INV_NUMBER_DESC resource_key(RESOURCE_FILE, "2")
+#define DBT_SUBTITLE resource_key(RESOURCE_FILE, "3")
+#define DBT_WITH resource_key(RESOURCE_FILE, "4")
+#define DBT_NO_DIR resource_key(RESOURCE_FILE, "5")
+#define DBT_NO_DIR_DESC resource_key(RESOURCE_FILE, "6")
+#define DBT_NO_FILE resource_key(RESOURCE_FILE, "7")
+#define DBT_NO_FILE_DESC resource_key(RESOURCE_FILE, "8")
+#define DBT_NO_DIR_FOUND resource_key(RESOURCE_FILE, "9")
+#define DBT_NO_ID resource_key(RESOURCE_FILE, "10")
+#define DBT_NO_ID_DESC resource_key(RESOURCE_FILE, "11")
+#define DBT_INV_NOHTML resource_key(RESOURCE_FILE, "12")
+#define DBT_INV_NOHTML_DESC resource_key(RESOURCE_FILE, "13")
/* html resource */
#define DBT_DISPLAY_LOGFILE_SELECT_BEGIN resource_key(RESOURCE_FILE, "20")
@@ -107,23 +107,23 @@
while(fgets(line, sizeof(line), cmd)) {
if(strncmp(line, "format=", 7))
if((!str) || (strstr(line, str))) {
- count++;
- if(count<=num) {
- if(!buffer)
- buffer = (char **)MALLOC(sizeof(char *));
- else
- buffer = (char **)REALLOC(buffer, count*(sizeof(char *)));
- }
- else
- FREE(buffer[replace]);
- temp = strlen(line);
- line[temp-1] = ' ';
- line[temp] = '\n';
- line[temp+1] = '\0';
- buffer[replace] = STRDUP(line);
- if(replace == (num-1))
- replace=0;
- else replace++;
+ count++;
+ if(count<=num) {
+ if(!buffer)
+ buffer = (char **)MALLOC(sizeof(char *));
+ else
+ buffer = (char **)REALLOC(buffer, count*(sizeof(char *)));
+ }
+ else
+ FREE(buffer[replace]);
+ temp = strlen(line);
+ line[temp-1] = ' ';
+ line[temp] = '\n';
+ line[temp+1] = '\0';
+ buffer[replace] = STRDUP(line);
+ if(replace == (num-1))
+ replace=0;
+ else replace++;
}
}
if(count < num) { /* could not find num entries */
@@ -133,7 +133,7 @@
/* replace is at the first entry to output */
for(temp=0; temp<count; temp++) {
- fputs(buffer[replace], stdout);
+ fputs(buffer[replace], stdout);
FREE(buffer[replace]);
if(replace == (num-1))
replace=0;
@@ -144,12 +144,12 @@
}
static void i18nInit() {
- i18nResource = res_find_and_init_resource(PROPERTYDIR, RESOURCE_FILE);
- i18nResource_common = res_find_and_init_resource(PROPERTYDIR, COMMON_RESOURCE_FILE);
+ i18nResource = res_find_and_init_resource(PROPERTYDIR, RESOURCE_FILE);
+ i18nResource_common = res_find_and_init_resource(PROPERTYDIR, COMMON_RESOURCE_FILE);
- if (getenv("HTTP_ACCEPT_LANGUAGE")) {
- acceptLanguage = getenv("HTTP_ACCEPT_LANGUAGE");
- }
+ if (getenv("HTTP_ACCEPT_LANGUAGE")) {
+ acceptLanguage = getenv("HTTP_ACCEPT_LANGUAGE");
+ }
}
@@ -176,12 +176,12 @@
for(x=0; logfiles && logfiles[x]; x++) {
if (curlog && !strcmp(curlog, logfiles[x])) {
- fprintf(stdout, getResourceString(DBT_DISPLAY_LOGFILE_VALUE_SELECTED),
- logfiles[x], logfiles[x]);
+ fprintf(stdout, getResourceString(DBT_DISPLAY_LOGFILE_VALUE_SELECTED),
+ logfiles[x], logfiles[x]);
}
else {
- fprintf(stdout, getResourceString(DBT_DISPLAY_LOGFILE_SELECT_VALUE),
- logfiles[x], logfiles[x]);
+ fprintf(stdout, getResourceString(DBT_DISPLAY_LOGFILE_SELECT_VALUE),
+ logfiles[x], logfiles[x]);
}
at_least_one = 1;
}
@@ -193,69 +193,88 @@
}
-
/*
- * Given the server's ID, find the log directory for that instance.
- * Note that the earlier version of the product supported having multiple log file
- * directories. This version assumes all log files are in the same directory. This
- * is a result of the FHS work which encourages the use of one log directory per
- * product or instance.
+ * With the FHS work, plus the injunction against
+ * paths in CGI parameters, we should get the
+ * logdir from the server config, using the pset interface
*/
-
-char *get_log_dir(char *id) {
-
- char *return_dir = NULL;
- PsetHndl pset = NULL;
- int rv = 0;
-
- char *errorlog_attr = NULL;
- char *accesslog_attr = NULL;
+static char *
+getLogDir(AdmldapInfo info, const char *id)
+{
+ int rval = 0;
+ char *logdir = NULL;
+ PsetHndl pset;
char *configdir = util_get_conf_dir();
- char *secdir = util_get_security_dir();
- rv = ADMSSL_InitSimple(configdir, secdir, 0);
- if (rv) {
- if (i18nResource) {
- char msgbuf[BUFSIZ];
- rpt_err(APP_ERROR,
- getResourceString(CMN_SSL_INIT_ERROR),
- NULL, NULL);
- } else {
- rpt_err(APP_ERROR, "SSL related initialization failed", NULL, NULL);
- }
+ if (!PL_strncasecmp(id, "admin-serv", strlen("admin-serv"))) {
+ return PL_strdup(util_get_log_dir()); /* same as admin server log dir */
}
- pset = psetCreateSSL(id, configdir, NULL, NULL, &rv);
+ /* Log dir for the DS */
+ /* create pset with this dn */
+ pset = psetCreateSSL((char *)id, configdir, NULL, NULL, &rval);
+ if (pset && ((rval == PSET_OP_OK) || (rval == PSET_LOCAL_OPEN_FAIL))) { /* only admin-serv uses local file */
+ if (util_psetHasObjectClass(pset, DSOBJECTCLASS)) {
+ char *host = psetGetAttrSingleValue(pset, "serverHostName", &rval);
+ char *sport = psetGetAttrSingleValue(pset, "nsServerPort", &rval);
+ char *ssecport = psetGetAttrSingleValue(pset, "nsSecureServerPort", &rval);
+ char *ssecurity = psetGetAttrSingleValue(pset, "nsServerSecurity", &rval);
+ int port, security;
+ char *user = NULL;
+ char *binddn = NULL;
+ char *bindpw = admldapGetSIEPWD(info);
+ int freebindpw = 1;
+ char *p;
+
+ ADM_GetUserDNString(&rval, &user);
+ if (!user) {
+ ADM_GetCurrentUsername(&rval, &user);
+ }
+ /* if user is just attr val, get dn */
+ binddn = admldapGetUserDN(info, user);
+ if (!bindpw) {
+ freebindpw = 0;
+ ADM_GetCurrentPassword(&rval, &bindpw);
+ }
+ security = (ssecurity && !PL_strcasecmp(ssecurity, "on")) ? 1 : 0;
+ if (security) {
+ if (ssecport) {
+ port = atoi(ssecport);
+ } else {
+ port = 636;
+ }
+ } else {
+ if (sport) {
+ port = atoi(sport);
+ } else {
+ port = 389;
+ }
+ }
- if (pset) {
- return_dir = psetGetAttrSingleValue(pset, LOGDIRATTR, &rv);
- if (!return_dir) { /* no log dir - get dir from error log */
- char *errorlog = psetGetAttrSingleValue(pset, ERRORLOGATTR, &rv);
- if (errorlog) {
- char *ptr = strrchr(errorlog, FILE_PATHSEP);
- if (ptr) {
- *ptr = '\0';
- return_dir = errorlog;
- }
+ psetDelete(pset);
+ pset = psetRealCreateSSL(host, port, security, DSCONFIGENTRY,
+ binddn, bindpw, NULL, &rval);
+ logdir = psetGetAttrSingleValue(pset, DSERRORLOGDIR, &rval);
+ p = strstr(logdir, "/errors");
+ if (p) {
+ *p = '\0';
}
- }
- psetDelete(pset);
- }
- if(!return_dir) {
- char *logdir = util_get_log_dir();
- if (!strncasecmp(id, "admin-", 6)) {
- return PL_strdup(logdir);
- } else if (!strncmp(id, "slapd-", 6)) {
- /* DIRECTORY SERVER and admin server share the same log dir parent */
- return_dir = PR_smprintf("%s%c..%c%s", logdir, FILE_PATHSEP, FILE_PATHSEP, id);
+ PL_strfree(host);
+ PL_strfree(sport);
+ PL_strfree(ssecport);
+ PL_strfree(ssecurity);
+ PL_strfree(binddn);
+ if (freebindpw) {
+ PL_strfree(bindpw);
+ }
}
}
+ psetDelete(pset);
- return return_dir;
+ return logdir;
}
-
int main(int argc, char *argv[])
{
@@ -276,6 +295,9 @@
int print_html = 1;
int proceed = 0;
char msg[BUFSIZ];
+ AdmldapInfo ldapInfo = NULL; /* our config */
+ int rc = 0;
+ char *configdir = NULL;
i18nInit();
@@ -323,13 +345,20 @@
if(!num) num=DEF_SIZE;
- if(!logdir) {
- logdir = get_log_dir(id);
- if(!logdir) {
- PR_snprintf(msg, sizeof(msg), getResourceString(DBT_NO_DIR_FOUND), id);
- rpt_err(INCORRECT_USAGE,
- getResourceString(DBT_NO_DIR), msg, NULL);
- }
+ configdir = util_get_conf_dir();
+ ldapInfo = admldapBuildInfoOnly(configdir, &rc);
+ if (rc || !ldapInfo) {
+ PR_snprintf(line, sizeof(line),
+ getResourceString(CMN_CONFIGPROBLEM),
+ configdir ? configdir : "(null)", rc);
+ rpt_err(APP_ERROR, line, NULL, NULL);
+ } else {
+ logdir = getLogDir(ldapInfo, id);
+ if(!logdir) {
+ PR_snprintf(msg, sizeof(msg),
+ getResourceString(DBT_NO_DIR_FOUND), id);
+ rpt_err(INCORRECT_USAGE, getResourceString(DBT_NO_DIR), msg, NULL);
+ }
}
if(nohtml) {
@@ -417,5 +446,5 @@
}
}
- return 0;
+ return 0;
}
Index: security.c
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/cgi-src40/security.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- security.c 28 Jun 2007 18:07:01 -0000 1.11
+++ security.c 31 Oct 2007 05:30:53 -0000 1.12
@@ -402,23 +402,6 @@
return (str==NULL?(char *)"(null)":str);
}
-static int
-psetHasObjectClass(PsetHndl pset, const char *ocname)
-{
- int rval = 0;
- char *val = NULL;
- ValueType nodeObjectClass = psetGetObjectClass(pset, "" /* use root node */, &rval);
- ValueType iter = nodeObjectClass;
-
- rval = 0;
- while ((!rval) && ((val = *iter++))) {
- rval = !PL_strcasecmp(ocname, val);
- }
-
- deleteValue(nodeObjectClass);
- return rval;
-}
-
/*
* With the FHS work, plus the injunction against
* paths in CGI parameters, we should get the
@@ -441,7 +424,7 @@
pset = psetCreateSSL((char *)sie, configdir, NULL, NULL, &rval);
if (pset && ((rval == PSET_OP_OK) || (rval == PSET_LOCAL_OPEN_FAIL))) { /* only admin-serv uses local file */
securitydir = psetGetAttrSingleValue(pset, "configuration.encryption.certdir", &rval);
- if (!securitydir && psetHasObjectClass(pset, DSOBJECTCLASS)) {
+ if (!securitydir && util_psetHasObjectClass(pset, DSOBJECTCLASS)) {
char *host = psetGetAttrSingleValue(pset, "serverHostName", &rval);
char *sport = psetGetAttrSingleValue(pset, "nsServerPort", &rval);
char *ssecport = psetGetAttrSingleValue(pset, "nsSecureServerPort", &rval);
Index: cgicommon.h
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/cgi-src40/cgicommon.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cgicommon.h 9 May 2007 00:26:30 -0000 1.1
+++ cgicommon.h 31 Oct 2007 05:30:53 -0000 1.2
@@ -34,5 +34,6 @@
#define DSOBJECTCLASS "nsdirectoryserver" /* name of table in cgicommon */
#define DSCONFIGENTRY "cn=config"
#define DSSECURITYDIR "nsslapd-certdir"
+#define DSERRORLOGDIR "nsslapd-errorlog"
#endif /* CGICOMMON_H */
15 years, 11 months
[Fedora-directory-commits] adminserver/include/libadmin libadmin.h, 1.8, 1.9
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/adminserver/include/libadmin
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22940/include/libadmin
Modified Files:
libadmin.h
Log Message:
Resolves: #357501
Summary: Console/admin express: can't view log files
Description: Implemented getLogDir to get the log dir from the server's
config info. To share psetHasObjectClass, moved it from security.c to
lib/libadmin/util.c.
Index: libadmin.h
===================================================================
RCS file: /cvs/dirsec/adminserver/include/libadmin/libadmin.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- libadmin.h 11 May 2007 19:44:05 -0000 1.8
+++ libadmin.h 31 Oct 2007 05:30:54 -0000 1.9
@@ -578,6 +578,9 @@
NSAPI_PUBLIC int
util_verify_file_or_dir(const char *path, PRFileType, const char *child, size_t, PRFileType);
+NSAPI_PUBLIC int
+util_psetHasObjectClass(PsetHndl pset, const char *ocname);
+
NSPR_END_EXTERN_C
#endif /* libadmin_h */
15 years, 11 months
[Fedora-directory-commits] ldapserver/ldap/schema 50ns-mail.ldif, 1.5, 1.6
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/schema
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv30194/ldapserver/ldap/schema
Added Files:
50ns-mail.ldif
Log Message:
Resolves: bug 353071
Description: Need to support mail server schema
Fix Description: There are customers who are using the mail schema, so we need to keep it in the product.
Index: 50ns-mail.ldif
===================================================================
RCS file: 50ns-mail.ldif
diff -N 50ns-mail.ldif
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ 50ns-mail.ldif 26 Oct 2007 22:04:38 -0000 1.6
@@ -0,0 +1,80 @@
+#
+# BEGIN COPYRIGHT BLOCK
+# This Program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; version 2 of the License.
+#
+# This Program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA.
+#
+# In addition, as a special exception, Red Hat, Inc. gives You the additional
+# right to link the code of this Program with code not covered under the GNU
+# General Public License ("Non-GPL Code") and to distribute linked combinations
+# including the two, subject to the limitations in this paragraph. Non-GPL Code
+# permitted under this exception must only link to the code of this Program
+# through those well defined interfaces identified in the file named EXCEPTION
+# found in the source code files (the "Approved Interfaces"). The files of
+# Non-GPL Code may instantiate templates or use macros or inline functions from
+# the Approved Interfaces without causing the resulting work to be covered by
+# the GNU General Public License. Only Red Hat, Inc. may make changes or
+# additions to the list of Approved Interfaces. You must obey the GNU General
+# Public License in all respects for all of the Program code and other code used
+# in conjunction with the Program except the Non-GPL Code covered by this
+# exception. If you modify this file, you may extend this exception to your
+# version of the file, but you are not obligated to do so. If you do not wish to
+# provide this exception without modification, you must delete this exception
+# statement from your version and license this file solely under the GPL without
+# exception.
+#
+#
+# Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
+# Copyright (C) 2005 Red Hat, Inc.
+# All rights reserved.
+# END COPYRIGHT BLOCK
+#
+#
+# Schema for Netscape Messaging Server 4.x. Some attributes are also
+# used by NMS 5.x
+#
+dn: cn=schema
+attributeTypes: ( 2.16.840.1.113730.3.1.16 NAME ( 'mailDeliveryOption' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.707 NAME ( 'vacationstartdate' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.18 NAME ( 'mailHost' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.33 NAME ( 'mgrpModerator' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.25 NAME ( 'mgrpDeliverTo' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( mgrpApprovePassword-oid NAME ( 'mgrpApprovePassword' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.31 NAME ( 'mailEnhancedUniqueMember' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.781 NAME ( 'mgrpAddHeader' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.22 NAME ( 'mgrpAllowedBroadcaster' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.30 NAME ( 'mgrpRFC822MailMember' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( nsmsgNumMsgQuota-oid NAME ( 'nsmsgNumMsgQuota' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.13 NAME ( 'mailAlternateAddress' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.708 NAME ( 'vacationenddate' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.20 NAME ( 'mailProgramDeliveryInfo' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.801 NAME ( 'mgrpRemoveHeader' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.12 NAME ( 'mailAccessDomain' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.14 NAME ( 'mailAutoReplyMode' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.15 NAME ( 'mailAutoReplyText' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.21 NAME ( 'mailQuota' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.788 NAME ( 'mgrpBroadcasterPolicy' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.24 NAME ( 'mailRoutingAddress' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.19 NAME ( 'mailMessageStore' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.520 NAME ( 'nswmExtendedUserPrefs' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.26 NAME ( 'mgrpErrorsTo' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.23 NAME ( 'mgrpAllowedDomain' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.28 NAME ( 'mgrpMsgRejectAction' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( nsmsgDisallowAccess-oid NAME ( 'nsmsgDisallowAccess' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.17 NAME ( 'mailForwardingAddress' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.32 NAME ( 'mgrpMsgMaxSize' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.29 NAME ( 'mgrpMsgRejectText' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 2.16.840.1.113730.3.1.789 NAME ( 'mgrpNoDuplicateChecks' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Messaging Server 4.x' )
+objectclasses: ( 2.16.840.1.113730.3.2.3 NAME 'mailRecipient' DESC '' SUP top AUXILIARY MUST ( objectClass ) MAY ( cn $ mail $ mailAlternateAddress $ mailHost $ mailRoutingAddress $ mailAccessDomain $ mailAutoReplyMode $ mailAutoReplyText $ mailDeliveryOption $ mailForwardingAddress $ mailMessageStore $ mailProgramDeliveryInfo $ mailQuota $ multiLineDescription $ uid $ userPassword ) X-ORIGIN 'Netscape Messaging Server 4.x' )
+objectclasses: ( 2.16.840.113730.3.2.37 NAME 'nsMessagingServerUser' DESC '' SUP top AUXILIARY MUST ( objectClass ) MAY ( cn $ mailAccessDomain $ mailAutoReplyMode $ mailAutoReplyText $ mailDeliveryOption $ mailForwardingAddress $ mailMessageStore $ mailProgramDeliveryInfo $ mailQuota $ nsmsgDisallowAccess $ nsmsgNumMsgQuota $ nswmExtendedUserPrefs $ vacationstartdate $ vacationenddate ) X-ORIGIN 'Netscape Messaging Server 4.x' )
+objectclasses: ( 2.16.840.1.113730.3.2.4 NAME 'mailGroup' DESC '' SUP top AUXILIARY MUST ( objectClass ) MAY ( cn $ mail $ mailAlternateAddress $ mailHost $ mailRoutingAddress $ mgrpAddHeader $ mgrpAllowedBroadcaster $ mgrpAllowedDomain $ mgrpApprovePassword $ mgrpBroadcasterPolicy $ mgrpDeliverTo $ mgrpErrorsTo $ mgrpModerator $ mgrpMsgMaxSize $ mgrpMsgRejectAction $ mgrpMsgRejectText $ mgrpNoDuplicateChecks $ mgrpRemoveHeader $ mgrpRFC822MailMember $ owner ) X-ORIGIN 'Netscape Messaging Server 4.x' )
+objectclasses: ( 2.16.840.1.113730.3.2.5 NAME 'groupOfMailEnhancedUniqueNames' DESC '' SUP top AUXILIARY MUST ( objectClass $ cn ) MAY ( businessCategory $ description $ mailEnhancedUniqueMember $ o $ ou $ owner $ seeAlso ) X-ORIGIN 'Netscape Messaging Server 4.x' )
+objectclasses: ( 2.16.840.1.113730.3.2.24 NAME 'netscapeMailServer' DESC '' SUP top AUXILIARY MUST ( objectClass ) X-ORIGIN 'Netscape Messaging Server 4.x' )
15 years, 11 months
[Fedora-directory-commits] ldapserver Makefile.am, 1.63, 1.64 Makefile.in, 1.79, 1.80 aclocal.m4, 1.58, 1.59 configure, 1.75, 1.76 missing, 1.43, 1.44 install-sh, 1.43, 1.44 depcomp, 1.43, 1.44 compile, 1.42, 1.43 config.sub, 1.42, 1.43 config.guess, 1.42, 1.43
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv30194/ldapserver
Modified Files:
Makefile.am Makefile.in aclocal.m4 configure missing
install-sh depcomp compile config.sub config.guess
Log Message:
Resolves: bug 353071
Description: Need to support mail server schema
Fix Description: There are customers who are using the mail schema, so we need to keep it in the product.
Index: Makefile.am
===================================================================
RCS file: /cvs/dirsec/ldapserver/Makefile.am,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- Makefile.am 18 Oct 2007 00:08:26 -0000 1.63
+++ Makefile.am 26 Oct 2007 22:04:37 -0000 1.64
@@ -173,6 +173,7 @@
$(srcdir)/ldap/schema/50ns-admin.ldif \
$(srcdir)/ldap/schema/50ns-certificate.ldif \
$(srcdir)/ldap/schema/50ns-directory.ldif \
+ $(srcdir)/ldap/schema/50ns-mail.ldif \
$(srcdir)/ldap/schema/50ns-value.ldif \
$(srcdir)/ldap/schema/50ns-web.ldif \
$(srcdir)/ldap/schema/60pam-plugin.ldif \
Index: Makefile.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/Makefile.in,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- Makefile.in 19 Oct 2007 20:05:12 -0000 1.79
+++ Makefile.in 26 Oct 2007 22:04:37 -0000 1.80
@@ -1088,6 +1088,7 @@
$(srcdir)/ldap/schema/50ns-admin.ldif \
$(srcdir)/ldap/schema/50ns-certificate.ldif \
$(srcdir)/ldap/schema/50ns-directory.ldif \
+ $(srcdir)/ldap/schema/50ns-mail.ldif \
$(srcdir)/ldap/schema/50ns-value.ldif \
$(srcdir)/ldap/schema/50ns-web.ldif \
$(srcdir)/ldap/schema/60pam-plugin.ldif \
15 years, 11 months
[Fedora-directory-commits] ldapserver/ldap/admin/src/scripts migrate-ds.res, 1.7, 1.8
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23864
Modified Files:
migrate-ds.res
Log Message:
Resolves: Bug 345711
Description: migration : ignore idl switch value in 6.21 and earlier
Fix Description: Fix the error message
Index: migrate-ds.res
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/migrate-ds.res,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- migrate-ds.res 17 Oct 2007 15:56:53 -0000 1.7
+++ migrate-ds.res 26 Oct 2007 22:00:32 -0000 1.8
@@ -26,7 +26,7 @@
error_removing_index_file = Could not remove the index file '%s'. Error: %s\n\n
error_recreating_index_file = Could not re-create the index file '%s'. Error: %s\n\n
error_reading_dbversion = Could not read the old database version information from '%s'. Error: %s\n\n
-error_database_too_old = The database at '%s' is version '%s/%s'.\
+error_database_too_old = The database at '%s' is too old to be migrated as a binary copy. You must export to LDIF.\n\n
This version cannot be migrated using the database binaries. You must\
first convert the databases to LDIF format and use the cross platform\
migration procedure. This procedure is documented in the migration\
15 years, 11 months
[Fedora-directory-commits] ldapserver/ldap/admin/src/scripts DSMigration.pm.in, 1.21, 1.22
by Doctor Conrad
Author: rmeggins
Update of /cvs/dirsec/ldapserver/ldap/admin/src/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4852
Modified Files:
DSMigration.pm.in
Log Message:
Resolves: bug 345711
Description: migration : ignore idl switch value in 6.21 and earlier
Fix Description: Fix the error message
Index: DSMigration.pm.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/admin/src/scripts/DSMigration.pm.in,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- DSMigration.pm.in 23 Oct 2007 02:13:53 -0000 1.21
+++ DSMigration.pm.in 25 Oct 2007 18:11:59 -0000 1.22
@@ -302,7 +302,7 @@
if (@errs) {
return @errs;
} elsif ($isold) {
- return ('error_database_too_old', $olddbdir, @verinfo);
+ return ('error_database_too_old', $srcdir);
}
if (-d $srcdir && ! -d $destdir && !$filesonly) {
15 years, 11 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/acl acllas.c, 1.10, 1.11 aclparse.c, 1.10, 1.11
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/acl
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14369/ldap/servers/plugins/acl
Modified Files:
acllas.c aclparse.c
Log Message:
Resolves: #339791
Summary: rhds71sp1 rhel3u6 - ns-slapd process dies with segmentation fault
Description: ldap_utf8prev, LDAP_UTF8PREV, and LDAP_UTF8DEC were sometimes
used without checking the returned pointer going back beyond the beginning
of the string.
Index: acllas.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/acllas.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- acllas.c 19 Oct 2007 15:36:01 -0000 1.10
+++ acllas.c 24 Oct 2007 18:41:15 -0000 1.11
@@ -562,7 +562,10 @@
/* ignore trailing whitespace */
len = strlen(user);
ptr = user+len-1;
- while(ldap_utf8isspace(ptr)){ *ptr = '\0'; LDAP_UTF8DEC(ptr); }
+ while(ptr >= user && ldap_utf8isspace(ptr)) {
+ *ptr = '\0';
+ LDAP_UTF8DEC(ptr);
+ }
}
/*
@@ -806,7 +809,10 @@
/* ignore trailing whitespace */
len = strlen(groupName);
ptr = groupName+len-1;
- while(ldap_utf8isspace(ptr)) { *ptr = '\0'; LDAP_UTF8DEC(ptr); }
+ while(ptr >= groupName && ldap_utf8isspace(ptr)) {
+ *ptr = '\0';
+ LDAP_UTF8DEC(ptr);
+ }
}
/*
@@ -966,7 +972,10 @@
/* ignore trailing whitespace */
len = strlen(role);
ptr = role+len-1;
- while(ldap_utf8isspace(ptr)) { *ptr = '\0'; LDAP_UTF8DEC(ptr); }
+ while(ptr >= role && ldap_utf8isspace(ptr)) {
+ *ptr = '\0';
+ LDAP_UTF8DEC(ptr);
+ }
}
/*
@@ -1118,7 +1127,10 @@
while(ldap_utf8isspace(attrName)) LDAP_UTF8INC(attrName);
len = strlen(attrName);
ptr = attrName+len-1;
- while(ldap_utf8isspace(ptr)) { *ptr = '\0'; LDAP_UTF8DEC(ptr); }
+ while(ptr >= attrName && ldap_utf8isspace(ptr)) {
+ *ptr = '\0';
+ LDAP_UTF8DEC(ptr);
+ }
/* See if we have a parent[2].attr" rule */
@@ -1346,7 +1358,10 @@
while(ldap_utf8isspace(attr)) LDAP_UTF8INC(attr);
len = strlen(attr);
ptr = attr+len-1;
- while(ldap_utf8isspace(ptr)) { *ptr = '\0'; LDAP_UTF8DEC(ptr); }
+ while(ptr >= attr && ldap_utf8isspace(ptr)) {
+ *ptr = '\0';
+ LDAP_UTF8DEC(ptr);
+ }
slapi_log_error( SLAPI_LOG_ACL, plugin_name,
"DS_LASAuthMethodEval:authtype:%s authmethod:%s\n",
@@ -2124,7 +2139,10 @@
while(ldap_utf8isspace(attrName)) LDAP_UTF8INC(attrName);
len = strlen(attrName);
ptr = attrName+len-1;
- while(ldap_utf8isspace(ptr)) { *ptr = '\0'; LDAP_UTF8DEC(ptr); }
+ while(ptr >= attrName && ldap_utf8isspace(ptr)) {
+ *ptr = '\0';
+ LDAP_UTF8DEC(ptr);
+ }
slapi_log_error( SLAPI_LOG_ACL, plugin_name,"Attr:%s\n" , attrName, 0,0);
Index: aclparse.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/acl/aclparse.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- aclparse.c 19 Oct 2007 22:14:56 -0000 1.10
+++ aclparse.c 24 Oct 2007 18:41:15 -0000 1.11
@@ -464,7 +464,7 @@
char *next;
next = s + 12;
s--;
- while (s != str && ldap_utf8isspace(s)) LDAP_UTF8DEC(s);
+ while (s > str && ldap_utf8isspace(s)) LDAP_UTF8DEC(s);
if (s && *s == ';') {
/* We don't support authenticate stuff */
return ACL_INVALID_AUTHORIZATION;
@@ -1542,9 +1542,12 @@
if (*str) {
/* ignore trailing whitespace */
- len = strlen(str);
- ptr = str+len-1;
- while(ldap_utf8isspace(ptr)){ *ptr = '\0'; LDAP_UTF8DEC(ptr); }
+ len = strlen(str);
+ ptr = str+len-1;
+ while(ptr >= str && ldap_utf8isspace(ptr)) {
+ *ptr = '\0';
+ LDAP_UTF8DEC(ptr);
+ }
}
}
15 years, 11 months
[Fedora-directory-commits] ldapserver/ldap/servers/plugins/syntaxes value.c, 1.8, 1.9
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/syntaxes
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14369/ldap/servers/plugins/syntaxes
Modified Files:
value.c
Log Message:
Resolves: #339791
Summary: rhds71sp1 rhel3u6 - ns-slapd process dies with segmentation fault
Description: ldap_utf8prev, LDAP_UTF8PREV, and LDAP_UTF8DEC were sometimes
used without checking the returned pointer going back beyond the beginning
of the string.
Index: value.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/syntaxes/value.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- value.c 2 Oct 2007 18:39:50 -0000 1.8
+++ value.c 24 Oct 2007 18:41:15 -0000 1.9
@@ -88,13 +88,14 @@
*/
void
value_normalize(
- char *s,
- int syntax,
+ char *s,
+ int syntax,
int trim_spaces
)
{
- char *d;
- int prevspace, curspace;
+ char *head = s;
+ char *d;
+ int prevspace, curspace;
if ( ! (syntax & SYNTAX_CIS) && ! (syntax & SYNTAX_CES) ) {
return;
@@ -107,10 +108,10 @@
d = s;
if (trim_spaces) {
- /* strip leading blanks */
- while (utf8isspace_fast(s)) {
- LDAP_UTF8INC(s);
- }
+ /* strip leading blanks */
+ while (utf8isspace_fast(s)) {
+ LDAP_UTF8INC(s);
+ }
}
/* for int syntax, look for leading sign, then trim 0s */
@@ -167,8 +168,8 @@
/* compress multiple blanks */
if ( prevspace && curspace ) {
- LDAP_UTF8INC(s);
- continue;
+ LDAP_UTF8INC(s);
+ continue;
}
prevspace = curspace;
if ( syntax & SYNTAX_CIS ) {
@@ -177,28 +178,28 @@
s += ssz;
d += dsz;
} else {
- char *np;
- int sz;
+ char *np;
+ int sz;
- np = ldap_utf8next(s);
- if (np == NULL || np == s) break;
- sz = np - s;
- memmove(d,s,sz);
- d += sz;
- s += sz;
+ np = ldap_utf8next(s);
+ if (np == NULL || np == s) break;
+ sz = np - s;
+ memmove(d,s,sz);
+ d += sz;
+ s += sz;
}
}
*d = '\0';
/* strip trailing blanks */
if (prevspace && trim_spaces) {
- char *nd;
+ char *nd;
- nd = ldap_utf8prev(d);
- while (nd && utf8isspace_fast(nd)) {
- d = nd;
- nd = ldap_utf8prev(d);
- *d = '\0';
- }
+ nd = ldap_utf8prev(d);
+ while (nd && nd >= head && utf8isspace_fast(nd)) {
+ d = nd;
+ nd = ldap_utf8prev(d);
+ *d = '\0';
+ }
}
}
15 years, 11 months
[Fedora-directory-commits] ldapserver/ldap/servers/slapd log.c, 1.19, 1.20
by Doctor Conrad
Author: nhosoi
Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1693
Modified Files:
log.c
Log Message:
Resolves: #188320
Summary: HP-UX: warnings reported by the HP-UX compiler (Comment #25,26)
Change description: moved the DEBUG_TRACE to the place before deleting the
physical log file.
Index: log.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/log.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- log.c 18 Oct 2007 00:08:34 -0000 1.19
+++ log.c 23 Oct 2007 16:13:58 -0000 1.20
@@ -3145,6 +3145,10 @@
return 0;
}
}
+ LDAPDebug(LDAP_DEBUG_TRACE,
+ "LOGINFO:Removing file:%s.%s because of (%s)\n",
+ loginfo.log_error_file, tbuf,
+ logstr);
if (p_delete_logp == delete_logp) {
/* then we are deleteing the first one */
@@ -3159,11 +3163,6 @@
if (PR_Delete(buffer) != PR_SUCCESS) {
LDAPDebug(LDAP_DEBUG_ANY, "LOGINFO:Unable to remove file:%s.%s\n",
loginfo.log_audit_file, tbuf,0);
- } else {
- LDAPDebug(LDAP_DEBUG_TRACE,
- "LOGINFO:Removed file:%s.%s because of (%s)\n",
- loginfo.log_error_file, tbuf,
- logstr);
}
slapi_ch_free((void**)&delete_logp);
loginfo.log_numof_error_logs--;
15 years, 11 months