Re: [CVS] OpenPKG: openpkg-src/op/ op.conf op.spec

2007-10-25 Thread Christoph Schug
On Thu, Oct 25, 2007, Ralf S. Engelschall wrote:

> Hmmm... now it gets really complicated, yes. Perhaps we should just use
> other examples in the default "op.conf"? I wanted to add "shutdown"
> and "reboot" as samples as those are the "usual" ones one often needs.
> But if it becomes such nasty to provide the right values it perhaps is
> better to now provide anything. Sometimes it is better not to play at
> all. Hmmm.. I actually don't know what is best here...

Never under-estimate the trivial things ;-)

-cs
__
OpenPKG http://openpkg.org
Developer Communication List   openpkg-dev@openpkg.org


Re: [CVS] OpenPKG: openpkg-src/op/ op.conf op.spec

2007-10-25 Thread Ralf S. Engelschall
On Thu, Oct 25, 2007, Christoph Schug wrote:

> On Thu, Oct 25, 2007, Ralf S. Engelschall wrote:
>
> > On Thu, Oct 25, 2007, Christoph Schug wrote:
> >
> > > [...]
> > > Ralf, I don't think it's a good idea to shutdown paths here, in
> > > general they are not correct. At least on my FreeBSD boxes, it's
> > > "/sbin/shutdown", and well, under Linux, which distribution flavor do
> > > you like? On Debian, it is "/sbin/shutdown". I would suggest, just
> > > to hardcode the shutdown parameters for each platform and let
> > > "shtool path" do the rest on all platforms.
> >
> > Yes, good idea. Now implemented.
> > Thanks for the feedback, Christoph.
>
> Argh, seems that "shtool path" is not (yet?) suitable for the job.
> First, the non-privileged build user might lack /sbin and /usr/sbin in
> it PATH. This one is solvable using the "-p" option. But second, "shtool
> path" searches for executables only (yes, of course). The problem is,
> that the shutdown binary might not be executable by non-privileged users
> (e.g., on FreeBSD, NetBSD) and therefore it cannot be found by "shtool
> path".
>
> So, hard code everything? Improve GNU shtool?

Hmmm... now it gets really complicated, yes. Perhaps we should just use
other examples in the default "op.conf"? I wanted to add "shutdown"
and "reboot" as samples as those are the "usual" ones one often needs.
But if it becomes such nasty to provide the right values it perhaps is
better to now provide anything. Sometimes it is better not to play at
all. Hmmm.. I actually don't know what is best here...

   Ralf S. Engelschall
   [EMAIL PROTECTED]
   www.engelschall.com

__
OpenPKG http://openpkg.org
Developer Communication List   openpkg-dev@openpkg.org


Re: [CVS] OpenPKG: openpkg-src/op/ op.conf op.spec

2007-10-25 Thread Christoph Schug
On Thu, Oct 25, 2007, Ralf S. Engelschall wrote:

> On Thu, Oct 25, 2007, Christoph Schug wrote:
> 
> > [...]
> > Ralf, I don't think it's a good idea to shutdown paths here, in
> > general they are not correct. At least on my FreeBSD boxes, it's
> > "/sbin/shutdown", and well, under Linux, which distribution flavor do
> > you like? On Debian, it is "/sbin/shutdown". I would suggest, just
> > to hardcode the shutdown parameters for each platform and let
> > "shtool path" do the rest on all platforms.
> 
> Yes, good idea. Now implemented.
> Thanks for the feedback, Christoph.

Argh, seems that "shtool path" is not (yet?) suitable for the job.
First, the non-privileged build user might lack /sbin and /usr/sbin in
it PATH. This one is solvable using the "-p" option. But second, "shtool
path" searches for executables only (yes, of course). The problem is,
that the shutdown binary might not be executable by non-privileged users
(e.g., on FreeBSD, NetBSD) and therefore it cannot be found by "shtool
path".

So, hard code everything? Improve GNU shtool?

-cs

__
OpenPKG http://openpkg.org
Developer Communication List   openpkg-dev@openpkg.org


Re: [CVS] OpenPKG: openpkg-src/op/ op.conf op.spec

2007-10-25 Thread Ralf S. Engelschall
On Thu, Oct 25, 2007, Christoph Schug wrote:

> [...]
> Ralf, I don't think it's a good idea to shutdown paths here, in
> general they are not correct. At least on my FreeBSD boxes, it's
> "/sbin/shutdown", and well, under Linux, which distribution flavor do
> you like? On Debian, it is "/sbin/shutdown". I would suggest, just
> to hardcode the shutdown parameters for each platform and let
> "shtool path" do the rest on all platforms.

Yes, good idea. Now implemented.
Thanks for the feedback, Christoph.

   Ralf S. Engelschall
   [EMAIL PROTECTED]
   www.engelschall.com

__
OpenPKG http://openpkg.org
Developer Communication List   openpkg-dev@openpkg.org


Re: [CVS] OpenPKG: openpkg-src/op/ op.conf op.spec

2007-10-25 Thread Christoph Schug
On Thu, Oct 25, 2007, Ralf S. Engelschall wrote:

>   OpenPKG CVS Repository
>   http://cvs.openpkg.org/
>   
> 
>   Server: cvs.openpkg.org  Name:   Ralf S. Engelschall
>   Root:   /v/openpkg/cvs   Email:  [EMAIL PROTECTED]
>   Module: openpkg-src  Date:   25-Oct-2007 19:04:06
>   Branch: HEAD Handle: 2007102518040400
> 
>   Added files:
> openpkg-src/op  op.conf op.spec
> 
>   Log:
> new package: op 1.32 (Controlled Operator Privilege Escalation)
[...]
>   +case "%{l_platform -t}" in
>   +*-freebsd* )
>   +l_su="/bin/su"
>   +l_shutdown="/usr/bin/shutdown -h now"
>   +l_reboot="/usr/bin/shutdown -r now"
>   +;;
>   +*-linux* )
>   +l_su="/bin/su"
>   +l_shutdown="/bin/shutdown -h now"
>   +l_reboot="/bin/shutdown -r now"
>   +;;
>   +*-sunos* )
>   +l_su="/usr/bin/su"
>   +l_shutdown="/usr/bin/shutdown -i0 -g0 -y"
>   +l_reboot="/usr/bin/shutdown -i6 -g0 -y"
>   +;;
>   +* )
>   +l_su="`%{l_shtool} path su`"
>   +l_shutdown="`%{l_shtool} path shutdown` -h now"
>   +l_reboot="`%{l_shtool} path shutdown` -r now"
>   +;;
>   +esac
[...]

Ralf, I don't think it's a good idea to shutdown paths here, in
general they are not correct. At least on my FreeBSD boxes, it's
"/sbin/shutdown", and well, under Linux, which distribution flavor do
you like? On Debian, it is "/sbin/shutdown". I would suggest, just
to hardcode the shutdown parameters for each platform and let
"shtool path" do the rest on all platforms.

-cs
__
OpenPKG http://openpkg.org
Developer Communication List   openpkg-dev@openpkg.org