help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "files" question


From: Tim Nelson
Subject: Re: "files" question
Date: Wed, 24 Mar 2004 10:44:18 +1100 (EST)

On Tue, 23 Mar 2004 Mark.Burgess@iu.hio.no wrote:

> It will then be fixed on next iteration.

        Actually, looking at the source, I found the CheckOwner function.
I have a few questions about it:
1.      If we evaluated the usernames at this point, wouldn't it be just
        as effective
2.      I see one part where we have this code:
-----------------------------------------------------
      for (ulp = uidlist; ulp != NULL; ulp=ulp->next)
         {
         if (uidlist->uid != unknown_owner)
            {
            uid = uidlist->uid;    /* default is first (not unknown) item in 
list */
            break;
            }
         }
      }
-----------------------------------------------------
        ...shouldn't the bits *inside* the loop where it says "uidlist"
actually say "ulp"?  My suggested replacement code would read something
like:
-----------------------------------------------------
      for (ulp = uidlist; ulp != NULL; ulp=ulp->next)
         {
         if (ulp->uid == unknown_owner) /* means not found while parsing */
            {
            unknownulp = MakeUidList (ulp->uidname);  /* Will only match one */
            if (unknownulp != NULL && statbuf->st_uid == unknownulp->uid)
               {
               uid = unknownulp->uid;
               break;
               }
            }
         if (ulp->uid != unknown_owner)
            {
            uid = ulp->uid;    /* default is first (not unknown) item in list */
            break;
            }
         }
      }
-----------------------------------------------------
        ...which would, fix both my problem and the problem I thought I
saw with the uidlist/ulp.

        Just incidentally, I'm using 2.1.0p1.

        :)

--
Tim Nelson
Systems Administrator
Sunet Internet
Tel: +61 3 5241 1155
Fax: +61 3 5241 6187
Web: http://www.sunet.com.au/
Email: sysadmin@sunet.com.au






reply via email to

[Prev in Thread] Current Thread [Next in Thread]