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

Re: dpkg-statoverride question



Brian May <bam@debian.org> wrote:
> 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?

s/policy/explanation in policy/

| This section is not intended as policy, but as a description of the
| use of `dpkg-statoverride'.

>     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
[...]

Wouldn't it be better and nicer to generate the user in preinst if it
does not exist (getent passwd sysuser > /dev/null || code to add user)
and set permissions and owner in the deb-file?
                    cu andreas



Reply to: