ssh-host-config doesn't chown /var/empty properly from setup.exe

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

ssh-host-config doesn't chown /var/empty properly from setup.exe

Thrall, Bryan

I've created a package which does some automatic configuration in its
postinstall script, including running `ssh-host-config -y < /dev/null`.
When setup.exe runs this postinstall script, ssh-host-install works
almost perfectly, except that it doesn't chown /var/empty properly:
/var/empty ends up owned by the user who is running setup.exe and group
"none" when it should be SYSTEM.root. It also ends up with 700
permissions instead of 755.

ssh-host-config has no problems when run from an xterm or tty; I've only
noticed it happening when executed from a postinstall script. I'm trying
to install on a WinXP machine, the user has administrative privileges,
and I tested the latest setup snapshot (2.529) but no luck. I didn't
notice any obvious clues from the setup source, either.

Any suggestions? Cygcheck output from the target machine is attached, in
case it helps.

Thanks,
--
Bryan Thrall
FlightSafety International
[hidden email]

.


cygcheck.txt (39K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ssh-host-config doesn't chown /var/empty properly from setup.exe

Igor Peshansky
On Mon, 19 Jun 2006, Thrall, Bryan wrote:

> I've created a package which does some automatic configuration in its
> postinstall script, including running `ssh-host-config -y < /dev/null`.
> When setup.exe runs this postinstall script, ssh-host-install works
> almost perfectly, except that it doesn't chown /var/empty properly:
> /var/empty ends up owned by the user who is running setup.exe and group
> "none" when it should be SYSTEM.root. It also ends up with 700
> permissions instead of 755.
>
> ssh-host-config has no problems when run from an xterm or tty; I've only
> noticed it happening when executed from a postinstall script. I'm trying
> to install on a WinXP machine, the user has administrative privileges,
> and I tested the latest setup snapshot (2.529) but no luck. I didn't
> notice any obvious clues from the setup source, either.
>
> Any suggestions? Cygcheck output from the target machine is attached, in
> case it helps.

At a guess, your package is not dependent on the "base-passwd" package,
and thus setup is free to run your postinstall script before /etc/passwd
is created (which would result in chown not knowing who SYSTEM or root
is).  Add base-passwd to the "requires:" line of your setup.hint, and see
if it helps.

You can check that by looking at the order of script execution in
setup.log.full.
        Igor
--
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_    [hidden email] | [hidden email]
ZZZzz /,`.-'`'    -.  ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-' old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"
Reply | Threaded
Open this post in threaded view
|

RE: ssh-host-config doesn't chown /var/empty properly from setup.exe

Thrall, Bryan
In reply to this post by Thrall, Bryan
Igor Peshansky wrote on Monday, June 19, 2006 4:41 PM:

> On Mon, 19 Jun 2006, Thrall, Bryan wrote:
>
>> I've created a package which does some automatic configuration in its
>> postinstall script, including running `ssh-host-config -y <
>> /dev/null`. When setup.exe runs this postinstall script,
>> ssh-host-install works almost perfectly, except that it doesn't
>> chown /var/empty properly: /var/empty ends up owned by the user who
>> is running setup.exe and group "none" when it should be SYSTEM.root.
>> It also ends up with 700 permissions instead of 755.
>>
>> ssh-host-config has no problems when run from an xterm or tty; I've
>> only noticed it happening when executed from a postinstall script.
>> I'm trying to install on a WinXP machine, the user has
>> administrative privileges, and I tested the latest setup snapshot
>> (2.529) but no luck. I didn't notice any obvious clues from the
>> setup source, either.
>>
>> Any suggestions? Cygcheck output from the target machine is
>> attached, in case it helps.
>
> At a guess, your package is not dependent on the "base-passwd"
> package, and thus setup is free to run your postinstall script before
> /etc/passwd is created (which would result in chown not knowing who
> SYSTEM or root is).  Add base-passwd to the "requires:" line of your
> setup.hint, and see if it helps.
>
> You can check that by looking at the order of script execution in
> setup.log.full.
> Igor

Actually, I get the same results even if I try to install my package as
a separate step, after completely installing all the standard Cygwin
packages I need (Sorry I didn't make that clear). I'm testing on a
machine with a working Cygwin installation and just reinstalling my
package (I delete /var/empty and cygrunsrv -R sshd before each attempt,
so ssh-host-config has something to do). Running ssh-host-config in the
same context (working Cygwin, no /var/empty, sshd not installed as a
service), but from an xterm or tty sets up /var/empty just fine.

I just confirmed that /etc/passwd has the user, SYSTEM, and sshd in it,
and /etc/group has root (just in case that could've still been the
problem).

--
Bryan Thrall
FlightSafety International
[hidden email]

.

Reply | Threaded
Open this post in threaded view
|

RE: ssh-host-config doesn't chown /var/empty properly from setup.exe

Igor Peshansky
On Mon, 19 Jun 2006, Thrall, Bryan wrote:

> Igor Peshansky wrote on Monday, June 19, 2006 4:41 PM:
> > On Mon, 19 Jun 2006, Thrall, Bryan wrote:
> >
> >> I've created a package which does some automatic configuration in its
> >> postinstall script, including running `ssh-host-config -y <
> >> /dev/null`. When setup.exe runs this postinstall script,
> >> ssh-host-install works almost perfectly, except that it doesn't
> >> chown /var/empty properly: /var/empty ends up owned by the user who
> >> is running setup.exe and group "none" when it should be SYSTEM.root.
> >> It also ends up with 700 permissions instead of 755.
> >>
> >> ssh-host-config has no problems when run from an xterm or tty; I've
> >> only noticed it happening when executed from a postinstall script.
> >> I'm trying to install on a WinXP machine, the user has
> >> administrative privileges, and I tested the latest setup snapshot
> >> (2.529) but no luck. I didn't notice any obvious clues from the
> >> setup source, either.
> >>
> >> Any suggestions? Cygcheck output from the target machine is
> >> attached, in case it helps.
> >
> > At a guess, your package is not dependent on the "base-passwd"
> > package, and thus setup is free to run your postinstall script before
> > /etc/passwd is created (which would result in chown not knowing who
> > SYSTEM or root is).  Add base-passwd to the "requires:" line of your
> > setup.hint, and see if it helps.
> >
> > You can check that by looking at the order of script execution in
> > setup.log.full.
> > Igor
>
> Actually, I get the same results even if I try to install my package as
> a separate step, after completely installing all the standard Cygwin
> packages I need (Sorry I didn't make that clear). I'm testing on a
> machine with a working Cygwin installation and just reinstalling my
> package (I delete /var/empty and cygrunsrv -R sshd before each attempt,
> so ssh-host-config has something to do). Running ssh-host-config in the
> same context (working Cygwin, no /var/empty, sshd not installed as a
> service), but from an xterm or tty sets up /var/empty just fine.
>
> I just confirmed that /etc/passwd has the user, SYSTEM, and sshd in it,
> and /etc/group has root (just in case that could've still been the
> problem).

Hmm, ok, the next thing to check is the fact that PATH and other
environment variables may not be set the same.  Try adding some debugging
information to the postinstall script (or even change the shebang line to
"bash -x"), and see what's different in setup.exe and the command line.
        Igor
--
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_    [hidden email] | [hidden email]
ZZZzz /,`.-'`'    -.  ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-' old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"
Reply | Threaded
Open this post in threaded view
|

Re: ssh-host-config doesn't chown /var/empty properly from setup.exe

Christopher Faylor-2
On Mon, Jun 19, 2006 at 08:04:13PM -0400, Igor Peshansky wrote:
>Hmm, ok, the next thing to check is the fact that PATH and other
>environment variables may not be set the same.  Try adding some debugging
>information to the postinstall script (or even change the shebang line to
>"bash -x"), and see what's different in setup.exe and the command line.

This seems to be debugging of an application problem rather than
package-related issues.  As such, I think this thread belongs in the
cygwin mailing list.

cgf
Reply | Threaded
Open this post in threaded view
|

Re: ssh-host-config doesn't chown /var/empty properly from setup.exe

Igor Peshansky
On Tue, 20 Jun 2006, Christopher Faylor wrote:

> On Mon, Jun 19, 2006 at 08:04:13PM -0400, Igor Peshansky wrote:
> >Hmm, ok, the next thing to check is the fact that PATH and other
> >environment variables may not be set the same.  Try adding some debugging
> >information to the postinstall script (or even change the shebang line to
> >"bash -x"), and see what's different in setup.exe and the command line.
>
> This seems to be debugging of an application problem rather than
> package-related issues.  As such, I think this thread belongs in the
> cygwin mailing list.

This was my first impulse too, but then I realized that we were really
debugging the environment that setup presents to the postinstall scripts.
As such, it's a setup issue, and specifically belongs here, IMHO.

If it turns out to be an ssh-host-config issue instead, it'll definitely
get moved.
        Igor
--
                                http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_    [hidden email] | [hidden email]
ZZZzz /,`.-'`'    -.  ;-;;,_ Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-' old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"
Reply | Threaded
Open this post in threaded view
|

RE: ssh-host-config doesn't chown /var/empty properly from setup.exe

Thrall, Bryan
In reply to this post by Thrall, Bryan
Igor Peshansky wrote on Tuesday, June 20, 2006 9:43 AM:

> On Tue, 20 Jun 2006, Christopher Faylor wrote:
>
>> On Mon, Jun 19, 2006 at 08:04:13PM -0400, Igor Peshansky wrote:
>>> Hmm, ok, the next thing to check is the fact that PATH and other
>>> environment variables may not be set the same.  Try adding some
>>> debugging information to the postinstall script (or even change the
>>> shebang line to "bash -x"), and see what's different in setup.exe
>>> and the command line.
>>
>> This seems to be debugging of an application problem rather than
>> package-related issues.  As such, I think this thread belongs in the
>> cygwin mailing list.
>
> This was my first impulse too, but then I realized that we were really
> debugging the environment that setup presents to the postinstall
> scripts. As such, it's a setup issue, and specifically belongs here,
> IMHO.
>
> If it turns out to be an ssh-host-config issue instead, it'll
> definitely get moved.
> Igor

Yep, setup is setting CYGWIN=nontsec, so of course chmod and chown
aren't doing what I expected. I set CYGWIN=ntsec before running
ssh-host-config, now, and /var/empty is created properly.

Thanks for pointing me in the right direction, Igor :)

--
Bryan Thrall
FlightSafety International
[hidden email]

.