コード例 #1
0
static int SelectBSDMatch(struct stat *lstatptr,struct Rlist *bsdflags,struct Promise *pp)

{
#if defined HAVE_CHFLAGS
  u_long newflags,plus,minus;
  struct Rlist *rp;

if (!ParseFlagString(bsdflags,&plus,&minus))
   {
   CfOut(cf_error,""," !! Problem validating a BSD flag string");
   PromiseRef(cf_error,pp);
   }

newflags = (lstatptr->st_flags & CHFLAGS_MASK) ;
newflags |= plus;
newflags &= ~minus;

if ((newflags & CHFLAGS_MASK) == (lstatptr->st_flags & CHFLAGS_MASK))    /* file okay */
   {
   return true;
   }
#endif
  
return false;
} 
コード例 #2
0
ファイル: files_select.c プロジェクト: nperron/core
static int SelectBSDMatch(struct stat *lstatptr, Rlist *bsdflags)
{
    u_long newflags, plus, minus;

    if (!ParseFlagString(bsdflags, &plus, &minus))
    {
        Log(LOG_LEVEL_ERR, "Problem validating a BSD flag string");
    }

    newflags = (lstatptr->st_flags & CHFLAGS_MASK);
    newflags |= plus;
    newflags &= ~minus;

    if ((newflags & CHFLAGS_MASK) == (lstatptr->st_flags & CHFLAGS_MASK))       /* file okay */
    {
        return true;
    }

    return false;
}