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

Re: dpkg-statoverride question



On Fri, Sep 27, 2002 at 09:15:37PM -0400, Joey Hess wrote:
> I hope you mean dpkg-statoverride --list in the config script, and not
> actually trying to change an override there, which would violate config
> script policy.

So I take it you consider the following policy is wrong?

     Given the above, `dpkg-statoverride' is essentially a tool for system
     administrators and would not normally be needed in the maintainer
     scripts.  There is one type of situation, though, where calls to
     `dpkg-statoverride' would be needed in the maintainer scripts, and
     that involves packages which use dynamically allocated user or group
     ids.  In such a situation, something like the following idiom can be
     very helpful in the package's `postinst', where `sysuser' is a
     dynamically allocated id:

          for i in /usr/bin/foo /usr/sbin/bar
          do
            if ! dpkg-statoverride --list $i >/dev/null
            then
              dpkg-statoverride --update --add sysuser root 4755 $i
            fi
          done

Personally, I don't see what the problem is, it should only update
the details if it hasn't been set yet.

Maybe this would be better?

          for i in /usr/bin/foo /usr/sbin/bar
          do
            if ! dpkg-statoverride --list $i >/dev/null
            then
	      chown sysuser $i
            fi
          done

As long as it is always done after every update...
-- 
Brian May <bam@debian.org>



Reply to: