Ejemplo n.º 1
0
static int PushDirState(char *name, struct stat *sb)
{
    if (chdir(name) == -1)
    {
        CfOut(cf_inform, "chdir", "Could not change to directory %s, mode %o in tidy", name, sb->st_mode & 07777);
        return false;
    }
    else
    {
        CfDebug("Changed directory to %s\n", name);
    }

    CheckLinkSecurity(sb, name);
    return true;
}
Ejemplo n.º 2
0
int DirPush(char *name,struct stat *sb)          /* Enter dir and check for race exploits */

{
if (chdir(name) == -1)
   {
   snprintf(OUTPUT,CF_BUFSIZE,"Could not change to directory %s, mode %o in tidy",name,sb->st_mode & 07777);
   CfLog(cfinform,OUTPUT,"chdir");
   return false;
   }
else
   {
   Debug("Changed directory to %s\n",name);
   }

CheckLinkSecurity(sb,name);
return true; 
}
Ejemplo n.º 3
0
static void PopDirState(int goback, char *name, struct stat *sb, Recursion r)
{
    if (goback && r.travlinks)
    {
        if (chdir(name) == -1)
        {
            CfOut(cf_error, "chdir", "Error in backing out of recursive travlink descent securely to %s", name);
            HandleSignals(SIGTERM);
        }

        CheckLinkSecurity(sb, name);
    }
    else if (goback)
    {
        if (chdir("..") == -1)
        {
            CfOut(cf_error, "chdir", "Error in backing out of recursive descent securely to %s", name);
            HandleSignals(SIGTERM);
        }
    }
}
Ejemplo n.º 4
0
void DirPop(int goback,char * name,struct stat *sb)      /* Exit dir and check for race exploits */

{
if (goback && TRAVLINKS)
   {
   if (chdir(name) == -1)
      {
      snprintf(OUTPUT,CF_BUFSIZE,"Error in backing out of recursive descent securely to %s",name);
      CfLog(cferror,OUTPUT,"chdir");
      HandleSignal(SIGTERM);
      }
   
   CheckLinkSecurity(sb,name); 
   }
else if (goback)
   {
   if (chdir("..") == -1)
      {
      snprintf(OUTPUT,CF_BUFSIZE,"Error in backing out of recursive descent securely to %s",name);
      CfLog(cferror,OUTPUT,"chdir");
      HandleSignal(SIGTERM);
      }
   }
}