OSSP CVS Repository

ossp - Check-in [3480]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3480
Date: 2003-Jun-30 18:25:54 (local)
2003-Jun-30 16:25:54 (UTC)
User:ms
Branch:
Comment: Repair and improve config section handling in eval run mode.
Tickets:
Inspections:
Files:
ossp-pkg/rc/rc_proc.c      1.55 -> 1.56     17 inserted, 12 deleted

ossp-pkg/rc/rc_proc.c 1.55 -> 1.56

--- rc_proc.c    2003/06/30 16:14:58     1.55
+++ rc_proc.c    2003/06/30 16:25:54     1.56
@@ -202,17 +202,6 @@
             szVerbose = NULL;
         }
         scriptAdd(pFatscript, pRc->m_pScriptfunc);
-        /* Conditionally print config section notice in verbal mode */
-        if (configGetval(RC_VRB_VAL)) {
-            nBytes = (strlen(RC_EVN_TEXT) + strlen(RC_DEF_NCF) * 2 + 2) * sizeof (char);
-            szVerbose = malloc(nBytes);
-            sprintf(szVerbose, RC_EVN_TEXT, RC_DEF_NCF, RC_DEF_NCF);
-            strcat(szVerbose, "\n");
-            scriptnAppend(pFatscript, szVerbose, strlen(szVerbose));
-            free(szVerbose);
-            szVerbose = NULL;
-        }
-        scriptAdd(pFatscript, pRc->m_pScriptcnf);
         for (nSecs = 0; nSecs < nTotalsecs; nSecs++) {
             for (nRcs = 0; nRcs < pRc->m_pList->m_nFiles; nRcs++) {
                 for (nTmp = 0; nTmp < pRc->m_pList->m_ppFilevec[nRcs]->m_nSecs && \
@@ -226,6 +215,20 @@
             qsort((void *)ppSectmp, (size_t)pRc->m_pList->m_nFiles, \
                 sizeof(rc_section_t *), priCompare);
             for (nTmp = 0; nTmp < pRc->m_pList->m_nFiles && ppSectmp[nTmp]; nTmp++) {
+                /* Conditionally print config section notice in verbal mode */
+                if (configGetval(RC_VRB_VAL)) {
+                    /* Conditionally print config section notice in verbal mode */
+                    nBytes = (strlen(RC_PRN_TEXT) + strlen(RC_DEF_NCF) + \
+                        strlen(sectionGetparent(ppSectmp[nTmp])) + 2) * sizeof (char);
+                    szVerbose = malloc(nBytes);
+                    sprintf(szVerbose, RC_PRN_TEXT, RC_DEF_NCF, sectionGetparent(ppSectmp[nTmp]));
+                    strcat(szVerbose, "\n");
+                    scriptnAppend(pFatscript, szVerbose, strlen(szVerbose));
+                    free(szVerbose);
+                    szVerbose = NULL;
+                }
+                scriptAdd(pFatscript, pRc->m_pScriptcnf);
+
                 /* Conditionally print each section notice in verbal mode */
                 if (configGetval(RC_VRB_VAL)) {
                     szTmp = (char *)sectionGetname(ppSectmp[nTmp]);
@@ -240,8 +243,10 @@
                 if ((szTmp = (char *)sectionGetlogin(ppSectmp[nTmp])) != NULL) {
                     scriptnAppend(pFatscript, "#su ", strlen("#su "));
                     scriptnAppend(pFatscript, szTmp, strlen(szTmp));
-                    scriptnAppend(pFatscript, "\n", strlen("\n"));
                 }
+                else
+                    scriptnAppend(pFatscript, "#exit ", strlen("#exit "));
+                scriptnAppend(pFatscript, "\n", strlen("\n"));
                 scriptAdd(pFatscript, sectionGetscript(ppSectmp[nTmp]));
             }
         }

CVSTrac 2.0.1