help-cfengine
[Top][All Lists]
Advanced

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

Re: how do I create home subdirs with correct owner?


From: Frank Ranner
Subject: Re: how do I create home subdirs with correct owner?
Date: Fri, 30 Jan 2004 00:36:05 +1100
User-agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

Tom Schutter wrote:

I am running cfengine as root, and trying to create a special directory in everyone's home directory. But what I cannot figure out is how to get the ownership correct. Here is my config:

control:
  mountpattern = ( / )
  HomePattern = ( home )
  actionsequence = ( directories )

directories:
  home/.baz
    mode=700

So if my directory tree looks like this:
/home
/home/foo (owned by foo)
/home/bar (owned by bar)

I get:
/home
/home/foo (owned by foo)
/home/foo/.baz (owned by root)
/home/bar (owned by bar)
/home/bar/.baz (owned by root)

What I want is /home/foo/.razor to be owned by foo, not root.

Thanks,

I don't think you can. I wanted to do something similar but couldn't do it using homes. I ended up putting some commands in the master profile, so the users (unwittingly) performed the operation on login.

The way to do it would be to have a cfengine variable that contains the owner of the directories being iterated over. Then you could do

directories:
   home/.baz
     mode=700 owner=$(homes_current)

A more general solution would be a variable containing the owner of the immediate parent.

copy:
$(master)/src/proj.c
   dest=/export/home/fred/proj.c
   owner=$(o_inherit)
   group=$(g_inherit)

The problem is, variables are evaluated at parse time, not at the time the action fires.

Still, it might be worth looking at.

Regards,
Frank Ranner



reply via email to

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