configdse.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. /** BEGIN COPYRIGHT BLOCK
  2. * This Program is free software; you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation; version 2 of the License.
  5. *
  6. * This Program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  9. *
  10. * You should have received a copy of the GNU General Public License along with
  11. * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  12. * Place, Suite 330, Boston, MA 02111-1307 USA.
  13. *
  14. * In addition, as a special exception, Red Hat, Inc. gives You the additional
  15. * right to link the code of this Program with code not covered under the GNU
  16. * General Public License ("Non-GPL Code") and to distribute linked combinations
  17. * including the two, subject to the limitations in this paragraph. Non-GPL Code
  18. * permitted under this exception must only link to the code of this Program
  19. * through those well defined interfaces identified in the file named EXCEPTION
  20. * found in the source code files (the "Approved Interfaces"). The files of
  21. * Non-GPL Code may instantiate templates or use macros or inline functions from
  22. * the Approved Interfaces without causing the resulting work to be covered by
  23. * the GNU General Public License. Only Red Hat, Inc. may make changes or
  24. * additions to the list of Approved Interfaces. You must obey the GNU General
  25. * Public License in all respects for all of the Program code and other code used
  26. * in conjunction with the Program except the Non-GPL Code covered by this
  27. * exception. If you modify this file, you may extend this exception to your
  28. * version of the file, but you are not obligated to do so. If you do not wish to
  29. * provide this exception without modification, you must delete this exception
  30. * statement from your version and license this file solely under the GPL without
  31. * exception.
  32. *
  33. *
  34. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  35. * Copyright (C) 2005 Red Hat, Inc.
  36. * All rights reserved.
  37. * END COPYRIGHT BLOCK **/
  38. #ifdef HAVE_CONFIG_H
  39. # include <config.h>
  40. #endif
  41. /* configdse.c - routines to manage the config DSE */
  42. #include <stdio.h>
  43. #include <string.h>
  44. #include <sys/types.h>
  45. #include <errno.h>
  46. #ifndef _WIN32
  47. #include <sys/socket.h>
  48. #include <sys/param.h>
  49. #endif
  50. #include "log.h"
  51. #include "slap.h"
  52. #include "pw.h"
  53. static int check_all_maxdiskspace_and_mlogsize(Slapi_PBlock *pb, LDAPMod **mod, char *returntext);
  54. static void get_log_max_size( LDAPMod *mod,
  55. char *maxdiskspace_str,
  56. char *mlogsize_str,
  57. int *maxdiskspace,
  58. int *mlogsize);
  59. /* List of attributes which require server restart to take effect */
  60. static const char *requires_restart[] = {
  61. "cn=config:nsslapd-port",
  62. "cn=config:nsslapd-secureport",
  63. "cn=config:" CONFIG_LDAPI_FILENAME_ATTRIBUTE,
  64. "cn=config:" CONFIG_LDAPI_SWITCH_ATTRIBUTE,
  65. "cn=config:nsslapd-workingdir",
  66. "cn=config:nsslapd-plugin",
  67. "cn=config:nsslapd-sslclientauth",
  68. "cn=config:nsslapd-changelogdir",
  69. "cn=config:nsslapd-changelogsuffix",
  70. "cn=config:nsslapd-changelogmaxentries",
  71. "cn=config:nsslapd-changelogmaxage",
  72. "cn=config:nsslapd-db-locks",
  73. #if !defined(_WIN32) && !defined(AIX)
  74. "cn=config:nsslapd-maxdescriptors",
  75. #endif
  76. "cn=config:" CONFIG_RETURN_EXACT_CASE_ATTRIBUTE,
  77. "cn=config:" CONFIG_SCHEMA_IGNORE_TRAILING_SPACES,
  78. "cn=config,cn=ldbm:nsslapd-idlistscanlimit",
  79. "cn=config,cn=ldbm:nsslapd-parentcheck",
  80. "cn=config,cn=ldbm:nsslapd-dbcachesize",
  81. "cn=config,cn=ldbm:nsslapd-dbncache",
  82. "cn=config,cn=ldbm:nsslapd-cachesize",
  83. "cn=config,cn=ldbm:nsslapd-plugin",
  84. "cn=encryption,cn=config:nssslsessiontimeout",
  85. "cn=encryption,cn=config:nssslclientauth",
  86. "cn=encryption,cn=config:nsssl2",
  87. "cn=encryption,cn=config:nsssl3" };
  88. static int
  89. isASyntaxOrMrPluginOrPss(Slapi_Entry *e)
  90. {
  91. char *ptype = slapi_entry_attr_get_charptr(e, ATTR_PLUGIN_TYPE);
  92. int retval = (ptype && !strcasecmp(ptype, "syntax"));
  93. if (!retval)
  94. retval = (ptype && !strcasecmp(ptype, "matchingrule"));
  95. if (!retval)
  96. retval = (ptype && !strcasecmp(ptype, "pwdstoragescheme"));
  97. if (!retval)
  98. retval = (ptype && !strcasecmp(ptype, "reverpwdstoragescheme"));
  99. slapi_ch_free((void**)&ptype);
  100. return retval;
  101. }
  102. /* these attr types are ignored for the purposes of configuration search/modify */
  103. static int
  104. ignore_attr_type(const char *attr_type)
  105. {
  106. if ( !attr_type ||
  107. (strcasecmp (attr_type, "cn") == 0) ||
  108. (strcasecmp (attr_type, "aci") == 0) ||
  109. (strcasecmp (attr_type, "objectclass") == 0) ||
  110. (strcasecmp (attr_type, "numsubordinates") == 0) ||
  111. (strcasecmp (attr_type, "modifytimestamp") == 0) ||
  112. (strcasecmp (attr_type, "modifiersname") == 0)) {
  113. return 1;
  114. }
  115. return 0;
  116. }
  117. int
  118. read_config_dse (Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *returncode, char *returntext, void *arg)
  119. {
  120. struct berval *vals[2];
  121. struct berval val;
  122. Slapi_Backend *be;
  123. slapdFrontendConfig_t *slapdFrontendConfig;
  124. struct slapdplugin *pPlugin;
  125. char *cookie;
  126. int i;
  127. slapdFrontendConfig = getFrontendConfig();
  128. vals[0] = &val;
  129. vals[1] = NULL;
  130. /*
  131. * We can skip using the config accessor functions here because we're holding
  132. * the read lock explicitly
  133. */
  134. CFG_LOCK_READ(slapdFrontendConfig);
  135. /* show backend config */
  136. attrlist_delete ( &e->e_attrs, "nsslapd-backendconfig");
  137. for ( i = 0;
  138. slapdFrontendConfig->backendconfig &&
  139. slapdFrontendConfig->backendconfig[i];
  140. i++) {
  141. val.bv_val = slapdFrontendConfig->backendconfig[i];
  142. val.bv_len = strlen ( val.bv_val );
  143. attrlist_merge ( &e->e_attrs, "nsslapd-backendconfig", vals);
  144. }
  145. CFG_UNLOCK_READ(slapdFrontendConfig);
  146. /* show other config entries */
  147. attrlist_delete ( &e->e_attrs, "nsslapd-backendconfig");
  148. cookie = NULL;
  149. be = slapi_get_first_backend (&cookie);
  150. while ( be )
  151. {
  152. if(!be->be_private)
  153. {
  154. Slapi_DN dn;
  155. slapi_sdn_init(&dn);
  156. be_getconfigdn(be,&dn);
  157. val.bv_val = (char*)slapi_sdn_get_ndn(&dn);
  158. val.bv_len = strlen (val.bv_val);
  159. attrlist_merge ( &e->e_attrs, "nsslapd-backendconfig", vals);
  160. slapi_sdn_done(&dn);
  161. }
  162. be = slapi_get_next_backend (cookie);
  163. }
  164. slapi_ch_free ((void **)&cookie);
  165. /* show be_type */
  166. attrlist_delete( &e->e_attrs, "nsslapd-betype");
  167. cookie = NULL;
  168. be = slapi_get_first_backend(&cookie);
  169. while ( be ) {
  170. if( !be->be_private )
  171. {
  172. val.bv_val = be->be_type;
  173. val.bv_len = strlen (be->be_type);
  174. attrlist_replace( &e->e_attrs, "nsslapd-betype", vals );
  175. }
  176. be = slapi_get_next_backend(cookie);
  177. }
  178. slapi_ch_free ( (void **) &cookie);
  179. /* show private suffixes */
  180. attrlist_delete ( &e->e_attrs, "nsslapd-privatenamespaces");
  181. cookie = NULL;
  182. be = slapi_get_first_backend(&cookie);
  183. while ( be )
  184. {
  185. if(be->be_private)
  186. {
  187. int n= 0;
  188. const Slapi_DN *base= NULL;
  189. do {
  190. base= slapi_be_getsuffix(be,n);
  191. if(base!=NULL)
  192. {
  193. val.bv_val = (void*)slapi_sdn_get_dn(base); /* jcm: had to cast away const */
  194. val.bv_len = strlen (val.bv_val);
  195. attrlist_merge ( &e->e_attrs, "nsslapd-privatenamespaces", vals);
  196. }
  197. n++;
  198. } while (base!=NULL);
  199. }
  200. be = slapi_get_next_backend(cookie);
  201. }
  202. slapi_ch_free ((void **) &cookie);
  203. /* show syntax plugins */
  204. attrlist_delete ( &e->e_attrs, CONFIG_PLUGIN_ATTRIBUTE );
  205. for ( pPlugin = slapi_get_global_syntax_plugins(); pPlugin != NULL;
  206. pPlugin = pPlugin->plg_next ) {
  207. val.bv_val = pPlugin->plg_dn;
  208. val.bv_len = strlen ( val.bv_val );
  209. attrlist_merge ( &e->e_attrs, CONFIG_PLUGIN_ATTRIBUTE, vals );
  210. }
  211. /* show matching rule plugins */
  212. for ( pPlugin = slapi_get_global_mr_plugins(); pPlugin != NULL;
  213. pPlugin = pPlugin->plg_next ) {
  214. val.bv_val = pPlugin->plg_dn;
  215. val.bv_len = strlen ( val.bv_val );
  216. attrlist_merge ( &e->e_attrs, CONFIG_PLUGIN_ATTRIBUTE, vals );
  217. }
  218. /* show requiresrestart */
  219. attrlist_delete( &e->e_attrs, "nsslapd-requiresrestart");
  220. for ( i = 0; i < sizeof(requires_restart)/sizeof(requires_restart[0]); i++ ) {
  221. val.bv_val = (char *)requires_restart[i];
  222. val.bv_len = strlen (val.bv_val);
  223. attrlist_merge ( &e->e_attrs, "nsslapd-requiresrestart", vals);
  224. }
  225. /* show the rest of the configuration parameters */
  226. *returncode= config_set_entry(e);
  227. return SLAPI_DSE_CALLBACK_OK;
  228. }
  229. int
  230. load_config_dse(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* ignored, int *returncode, char *returntext, void *arg)
  231. {
  232. int retval = LDAP_SUCCESS;
  233. Slapi_Attr *attr = 0;
  234. for (slapi_entry_first_attr(e, &attr); (retval == LDAP_SUCCESS) && attr;
  235. slapi_entry_next_attr(e, attr, &attr))
  236. {
  237. char *attr_name = 0;
  238. struct berval **values = 0;
  239. int nvals = 0;
  240. slapi_attr_get_type(attr, &attr_name);
  241. if (ignore_attr_type(attr_name))
  242. continue;
  243. slapi_attr_get_numvalues(attr, &nvals);
  244. /* convert the values into an array of bervals */
  245. if (nvals)
  246. {
  247. Slapi_Value *v = 0;
  248. int index = 0;
  249. values = (struct berval **)slapi_ch_malloc((nvals+1) *
  250. sizeof(struct berval *));
  251. values[nvals] = 0;
  252. for (index = slapi_attr_first_value(attr, &v);
  253. v && (index != -1);
  254. index = slapi_attr_next_value(attr, index, &v))
  255. {
  256. values[index] = (struct berval *)slapi_value_get_berval(v);
  257. }
  258. }
  259. if (attr_name)
  260. {
  261. retval = config_set(attr_name, values, returntext, 1 /* force apply */);
  262. if ((retval != LDAP_SUCCESS) &&
  263. slapi_attr_flag_is_set(attr, SLAPI_ATTR_FLAG_OPATTR))
  264. retval = LDAP_SUCCESS; /* ignore attempts to modify operational attrs */
  265. }
  266. if (values)
  267. {
  268. /* slapi_value_get_berval returns the actual memory owned by the
  269. slapi attr, so we cannot free it */
  270. slapi_ch_free((void **)&values);
  271. }
  272. }
  273. *returncode = retval;
  274. return (retval == LDAP_SUCCESS) ? SLAPI_DSE_CALLBACK_OK
  275. : SLAPI_DSE_CALLBACK_ERROR;
  276. }
  277. int
  278. load_plugin_entry(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* ignored, int *returncode, char *returntext, void *arg)
  279. {
  280. int retval = LDAP_SUCCESS;
  281. if (isASyntaxOrMrPluginOrPss(e))
  282. {
  283. /*
  284. * syntax/matching/passwd storage scheme rule plugins are loaded
  285. * at bootstrap time, so no need to load them here. BUT -- the
  286. * descriptive information that is registered by the plugin is
  287. * thrown away during bootstrap time, so we set it here.
  288. */
  289. (void)plugin_add_descriptive_attributes( e, NULL );
  290. } else {
  291. /*
  292. * Process plugins that were not loaded during bootstrap.
  293. */
  294. retval = plugin_setup(e, 0, 0, 1);
  295. /*
  296. * well this damn well sucks, but this function is used as a callback
  297. * and to ensure we do not continue if a plugin fails to load or init
  298. * properly we must exit here.
  299. */
  300. if(retval)
  301. {
  302. char dnbuf[ BUFSIZ ];
  303. slapi_log_error( SLAPI_LOG_FATAL, NULL,
  304. "Unable to load plugin \"%s\"\n",
  305. escape_string( slapi_entry_get_dn_const( e ), dnbuf ));
  306. exit(1);
  307. }
  308. }
  309. *returncode = retval;
  310. return (retval == LDAP_SUCCESS) ? SLAPI_DSE_CALLBACK_OK
  311. : SLAPI_DSE_CALLBACK_ERROR;
  312. }
  313. int
  314. modify_config_dse(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg)
  315. {
  316. char *config_attr;
  317. LDAPMod **mods;
  318. int rc = LDAP_SUCCESS;
  319. int apply_mods = 0;
  320. char *pwd = 0;
  321. int checked_all_maxdiskspace_and_mlogsize = 0;
  322. slapi_pblock_get( pb, SLAPI_MODIFY_MODS, &mods );
  323. returntext[0] = '\0';
  324. /*
  325. * First pass: set apply mods to 0 so only input validation will be done;
  326. * 2nd pass: set apply mods to 1 to apply changes to internal storage
  327. */
  328. for ( apply_mods = 0; apply_mods <= 1; apply_mods++ ) {
  329. int i = 0;
  330. for (i = 0; (mods[i] && (LDAP_SUCCESS == rc)); i++) {
  331. if ((mods[i]->mod_op & LDAP_MOD_DELETE) ||
  332. (mods[i]->mod_op & LDAP_MOD_ADD)) {
  333. rc= LDAP_UNWILLING_TO_PERFORM;
  334. PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "%s attributes is not allowed",
  335. (mods[i]->mod_op & LDAP_MOD_DELETE) ? "Deleting" : "Adding");
  336. } else if (mods[i]->mod_op & LDAP_MOD_REPLACE) {
  337. /* send all aci modifications to the backend */
  338. config_attr = (char *)mods[i]->mod_type;
  339. if (ignore_attr_type(config_attr))
  340. continue;
  341. if ( (checked_all_maxdiskspace_and_mlogsize == 0 ) &&
  342. ((strcasecmp( mods[i]->mod_type, CONFIG_ERRORLOG_MAXLOGDISKSPACE_ATTRIBUTE) == 0) ||
  343. (strcasecmp( mods[i]->mod_type, CONFIG_ERRORLOG_MAXLOGSIZE_ATTRIBUTE) == 0) ||
  344. (strcasecmp( mods[i]->mod_type, CONFIG_ACCESSLOG_MAXLOGDISKSPACE_ATTRIBUTE) == 0) ||
  345. (strcasecmp( mods[i]->mod_type, CONFIG_ACCESSLOG_MAXLOGSIZE_ATTRIBUTE) == 0) ||
  346. (strcasecmp( mods[i]->mod_type, CONFIG_AUDITLOG_MAXLOGDISKSPACE_ATTRIBUTE) == 0) ||
  347. (strcasecmp( mods[i]->mod_type, CONFIG_AUDITLOG_MAXLOGSIZE_ATTRIBUTE) == 0)) )
  348. {
  349. checked_all_maxdiskspace_and_mlogsize = 1;
  350. if ( (rc=check_all_maxdiskspace_and_mlogsize(pb, mods, returntext)) != LDAP_SUCCESS )
  351. {
  352. goto finish_and_return;
  353. }
  354. }
  355. rc = config_set(config_attr, mods[i]->mod_bvalues, returntext,
  356. apply_mods);
  357. }
  358. }
  359. }
  360. finish_and_return:
  361. /*
  362. * The DSE code will be writing the resultant entry value to the
  363. * dse.ldif file. We *must*not* write plain passwords into here.
  364. */
  365. slapi_entry_attr_delete( e, CONFIG_ROOTPW_ATTRIBUTE );
  366. /* if the password has been set, it will be hashed */
  367. if ((pwd = config_get_rootpw()) != NULL) {
  368. slapi_entry_attr_set_charptr(e, CONFIG_ROOTPW_ATTRIBUTE, pwd);
  369. slapi_ch_free((void**)&pwd);
  370. }
  371. *returncode= rc;
  372. if(LDAP_SUCCESS == rc) {
  373. return(SLAPI_DSE_CALLBACK_OK); /* success -- apply the mods. */
  374. }
  375. else {
  376. return(SLAPI_DSE_CALLBACK_ERROR); /* failure -- reject the mods. */
  377. }
  378. }
  379. int
  380. postop_modify_config_dse(Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entry* e, int *returncode, char *returntext, void *arg)
  381. {
  382. static int num_requires_restart = sizeof(requires_restart)/sizeof(char*);
  383. LDAPMod **mods;
  384. int i, j;
  385. char *p;
  386. slapi_pblock_get( pb, SLAPI_MODIFY_MODS, &mods );
  387. returntext[0] = '\0';
  388. for (i = 0; mods[i]; i++) {
  389. if (mods[i]->mod_op & LDAP_MOD_REPLACE ) {
  390. /* Check if the server needs to be restarted */
  391. for (j = 0; j < num_requires_restart; j++)
  392. {
  393. p = strchr (requires_restart[j], ':');
  394. if (p == NULL)
  395. continue;
  396. while ( *(++p) == ' ' || *p == '\t' );
  397. if ( strcasecmp (p, mods[i]->mod_type) == 0 ) {
  398. PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,
  399. "The change of %s will not take effect "
  400. "until the server is restarted", mods[i]->mod_type);
  401. slapi_log_error (SLAPI_LOG_FATAL, NULL, "%s\n", returntext);
  402. break;
  403. }
  404. }
  405. if (j < num_requires_restart) {
  406. /* That's enough, don't check remaining mods any more */
  407. break;
  408. }
  409. }
  410. }
  411. *returncode = LDAP_SUCCESS;
  412. return *returncode;
  413. }
  414. static int
  415. check_all_maxdiskspace_and_mlogsize(Slapi_PBlock *pb, LDAPMod **mods, char *returntext)
  416. {
  417. int i = 0;
  418. int rc = LDAP_SUCCESS;
  419. int errormaxdiskspace = -1;
  420. int errormlogsize = -1;
  421. int accessmaxdiskspace = -1;
  422. int accessmlogsize = -1;
  423. int auditmaxdiskspace = -1;
  424. int auditmlogsize = -1;
  425. for (i = 0; mods[i] ; i++)
  426. {
  427. get_log_max_size(mods[i],
  428. CONFIG_ERRORLOG_MAXLOGDISKSPACE_ATTRIBUTE,
  429. CONFIG_ERRORLOG_MAXLOGSIZE_ATTRIBUTE,
  430. &errormaxdiskspace,
  431. &errormlogsize);
  432. get_log_max_size(mods[i],
  433. CONFIG_ACCESSLOG_MAXLOGDISKSPACE_ATTRIBUTE,
  434. CONFIG_ACCESSLOG_MAXLOGSIZE_ATTRIBUTE,
  435. &accessmaxdiskspace,
  436. &accessmlogsize);
  437. get_log_max_size(mods[i],
  438. CONFIG_AUDITLOG_MAXLOGDISKSPACE_ATTRIBUTE,
  439. CONFIG_AUDITLOG_MAXLOGSIZE_ATTRIBUTE,
  440. &auditmaxdiskspace,
  441. &auditmlogsize);
  442. }
  443. if ( (rc=check_log_max_size(
  444. CONFIG_ERRORLOG_MAXLOGDISKSPACE_ATTRIBUTE,
  445. CONFIG_ERRORLOG_MAXLOGSIZE_ATTRIBUTE,
  446. errormaxdiskspace,
  447. errormlogsize,
  448. returntext,
  449. SLAPD_ERROR_LOG)) != LDAP_SUCCESS )
  450. {
  451. return rc;
  452. }
  453. if ( (rc=check_log_max_size(
  454. CONFIG_ACCESSLOG_MAXLOGDISKSPACE_ATTRIBUTE,
  455. CONFIG_ACCESSLOG_MAXLOGSIZE_ATTRIBUTE,
  456. accessmaxdiskspace,
  457. accessmlogsize,
  458. returntext,
  459. SLAPD_ACCESS_LOG)) != LDAP_SUCCESS )
  460. {
  461. return rc;
  462. }
  463. if ( (rc=check_log_max_size(
  464. CONFIG_AUDITLOG_MAXLOGDISKSPACE_ATTRIBUTE,
  465. CONFIG_AUDITLOG_MAXLOGSIZE_ATTRIBUTE,
  466. auditmaxdiskspace,
  467. auditmlogsize,
  468. returntext,
  469. SLAPD_AUDIT_LOG)) != LDAP_SUCCESS )
  470. {
  471. return rc;
  472. }
  473. return rc;
  474. }
  475. static void
  476. get_log_max_size( LDAPMod *mod,
  477. char *maxdiskspace_str,
  478. char *mlogsize_str,
  479. int *maxdiskspace,
  480. int *mlogsize)
  481. {
  482. if ( mod->mod_bvalues != NULL &&
  483. (strcasecmp( mod->mod_type, maxdiskspace_str ) == 0) )
  484. {
  485. *maxdiskspace = atoi((char *) mod->mod_bvalues[0]->bv_val);
  486. }
  487. if ( mod->mod_bvalues != NULL &&
  488. (strcasecmp( mod->mod_type, mlogsize_str ) == 0) )
  489. {
  490. *mlogsize = atoi((char *) mod->mod_bvalues[0]->bv_val);
  491. }
  492. }