/doc/hacker-guide/

fprintf (gf_log_logfile, "Starting Time: %s\n", timestr); fprintf (gf_log_logfile, "Command line : "); for (i = 0; i < argc; i++) { fprintf (gf_log_logfile, "%s ", argv[i]); } fprintf (gf_log_logfile, "\nPID : %d\n", mypid); if (uname_ret == 0) { fprintf (gf_log_logfile, "System name : %s\n", uname_buf.sysname); fprintf (gf_log_logfile, "Nodename : %s\n", uname_buf.nodename); fprintf (gf_log_logfile, "Kernel Release : %s\n", uname_buf.release); fprintf (gf_log_logfile, "Hardware Identifier: %s\n", uname_buf.machine); } fprintf (gf_log_logfile, "\n"); fflush (gf_log_logfile); } #endif int glusterfs_read_secure_access_file (void) { FILE *fp = NULL; char line[100] = {0,}; int cert_depth = 1; /* Default SSL CERT DEPTH */ regex_t regcmpl; char *key = {"^option transport.socket.ssl-cert-depth"}; char keyval[50] = {0,}; int start = 0, end = 0, copy_len = 0; regmatch_t result[1] = {{0} }; fp = fopen (SECURE_ACCESS_FILE, "r"); if (!fp) goto out; /* Check if any line matches with key */ while (fgets(line, sizeof(line), fp) != NULL) { if (regcomp (®cmpl, key, REG_EXTENDED)) { goto out; } if (!regexec (®cmpl, line, 1, result, 0)) { start = result[0].rm_so; end = result[0].rm_eo; copy_len = end - start; strcpy (keyval, line+copy_len); if (keyval[0]) { cert_depth = atoi(keyval); if (cert_depth == 0) cert_depth = 1; /* Default SSL CERT DEPTH */ break; } } regfree(®cmpl); } out: if (fp) fclose (fp)