regtool - 1.8 - Core dump

2005-02-24 Thread Alexander Joerg Herrmann
It dosn't feel like a feature so it must be a Bug for
sure :)
Don't worry it's easy to reproduce:
bash-2.05b$ ./regtool -K
Segmentation fault (core dumped)
crashes with a core dump insteed of printing the usage
information while 
regtool --key-seperator and regtool --key-seperator= 
does the right thing.
BTW: Why does CygWin use something evil like the
Window$ Registry anyway for mount points?
My Problem was that I have a X11 CygWin Installation
on my USB Stick so when traveling I can access my
Internet Host from almost any Internet Cafe running M$
on the planet. Unfortunatly some places do not allow
to import Registry Keys which imo makes sense. I tried
a workaround by using mount which gave me a headache
mounting the root partition. So I made a script with
regtool tumbling over the above error. 
bash-2.05b$ ./regtool -V
regtool (cygwin) 1.8
Registry Tool
Copyright 2000, 2001, 2002 Red Hat, Inc.
Compiled on Nov 10 2004
It's supposed the latest release as I just did
download it. 
As written in the Documentation:
"Note that modifying the Windows registry is
dangerous, and carelessness here can result in an
unusable system. Be careful."
Who would let a buggy programm do it?
So I ended up writing a small GUI programm with BC6
which allows me to edit all these mount points has
anybody out there any idea what the values in
"cygdrive flags" and flags have as a meaning. I'am
sure it's documented in the sourcecode but if anybody
out there knows please let me know so that I can
donate my CygWin Mount Point editor to the free Source
comunity without getting flamed for using wrong flag
values. 
My email is webmaster at felixfrisch dot de
For those interested the script which gave me a
serious headache with all these for and backward
slashes is here:
< Snip here if you would like to use 
#!/cygdrive/e/aIEngine/cygwin/bin/bash
./regtool add /HKEY_CURRENT_USER/Software/Cygnus\
Solutions
./regtool add /HKEY_CURRENT_USER/Software/Cygnus\
Solutions/Cygwin
./regtool add /HKEY_CURRENT_USER/Software/Cygnus\
Solutions/Cygwin/mounts\ v2
./regtool -i set '\HKEY_CURRENT_USER\Software\Cygnus
Solutions\Cygwin\mounts v2\cygdrive flags' 34
./regtool -s set '\HKEY_CURRENT_USER\Software\Cygnus
Solutions\Cygwin\mounts v2\cygdrive prefix' /hallo
./regtool add '\HKEY_CURRENT_USER\Software\Cygnus
Solutions\Cygwin\mounts v2\/'
./regtool -i set '\HKEY_CURRENT_USER\Software\Cygnus
Solutions\Cygwin\mounts v2\/\flags' 2
./regtool -s set '\HKEY_CURRENT_USER\Software\Cygnus
Solutions\Cygwin\mounts v2\/\native'
e:/aIEngine/cygwin
./regtool add '\HKEY_CURRENT_USER\Software\Cygnus
Solutions\Cygwin\mounts v2\/usr/bin'
./regtool -i set '\HKEY_CURRENT_USER\Software\Cygnus
Solutions\Cygwin\mounts v2\/usr/bin\flags' 2
./regtool -s set '\HKEY_CURRENT_USER\Software\Cygnus
Solutions\Cygwin\mounts v2\/usr/bin\native'
e:/aIEngine/cygwin/bin
./regtool add '\HKEY_CURRENT_USER\Software\Cygnus
Solutions\Cygwin\mounts v2\/usr/lib'
./regtool -i set '\HKEY_CURRENT_USER\Software\Cygnus
Solutions\Cygwin\mounts v2\/usr/lib\flags' 2
./regtool -s set '\HKEY_CURRENT_USER\Software\Cygnus
Solutions\Cygwin\mounts v2\/usr/lib\native'
e:/aIEngine/cygwin/lib
-> EOF
Line 2 and 3 are not really needed and as you can see
I used the Subdirectory aIEngine of my own Software so
you may have to delete all the /aIEngine stuff. 
It works fine for me and the Cygwin installation on my
USB Stick. On a Windows$ machine without any mount
points in the registry I start cygwin.bat run this
script close the shell and start cygwin.bat again
having all the necessary mount points without running
Regedit or any other Script which may exist but is
unknown to me. 
Thanks for taking the time to read this message all
the way thru.
Alexander 


=
___
http://tahi4x4.felixfrisch.deTake a look :)
[EMAIL PROTECTED]


Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: regtool - 1.8 - Core dump

2005-02-26 Thread Arturus Magi
Alexander Joerg Herrmann wrote:
BTW: Why does CygWin use something evil like the
Window$ Registry anyway for mount points?
Because a bootstrap is needed on startup.  Cygwin can't tell where to 
look for the mount table until after it already has the Windows path to 
/, and it can't get that until it's found the mount table.

My Problem was that I have a X11 CygWin Installation
on my USB Stick so when traveling I can access my
Internet Host from almost any Internet Cafe running M$
on the planet. Unfortunatly some places do not allow
to import Registry Keys which imo makes sense. I tried
a workaround by using mount which gave me a headache
mounting the root partition. So I made a script with
regtool tumbling over the above error.
Well, for starters, you may want to check the man page again:
>Don't worry it's easy to reproduce:
>bash-2.05b$ ./regtool -K
Your command line is missing the argument for the -K switch.  Programs 
tend to work better when you don't give them broken arguments.  It 
probably shouldn't throw a SEGV, but it wouldn't have worked anyway 
because you haven't given it enough information to do anything.

Every combination of complete arguments I've passed the tool allows the 
program to run without a segmentation fault, even if the arguments 
aren't valid in combination or the key location is incomplete (in the 
former case you get the output of -h, in the latter a list of valid key 
root identifiers).

> Who would let a buggy programm do it?
Because it's not as buggy as it seems.  If you can't import into the 
registry, then you can't import into the registry.  Your program should 
be just as useless for those systems where writing into the registry is 
disabled.  If it does work, there's a flaw in the system settings you're 
exploiting (which most Internet Cafés will ban you from returning for).

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/


Re: regtool - 1.8 - Core dump

2005-02-26 Thread Alexander Joerg Herrmann
Dear Arturus,
regtool dosn't dpend on the Cygwin environment as it
can also run from the Windows command line without any
Cygwin souroundings.
What I was mentioning is that 
rgetool -K 
causes a core fault and something similar under
windows because the argument is broken. I know that
the argument is missing and so should regtool. It
should produce a usage message insteed of a crash imo.
Regards,
Alex

=
___
http://tahi4x4.felixfrisch.deTake a look :)
[EMAIL PROTECTED]


Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: regtool - 1.8 - Core dump

2005-02-26 Thread Brian Dessent
Alexander Joerg Herrmann wrote:

> regtool dosn't dpend on the Cygwin environment as it
> can also run from the Windows command line without any
> Cygwin souroundings.
> What I was mentioning is that
> rgetool -K
> causes a core fault and something similar under
> windows because the argument is broken. I know that
> the argument is missing and so should regtool. It
> should produce a usage message insteed of a crash imo.

False.  regtool is a cygwin app and depends on the cygwin DLL:

$ cygcheck regtool
Found: C:\cygwin\bin\regtool.exe
C:/cygwin/bin/regtool.exe
  C:\cygwin\bin\cygwin1.dll
C:\WINXP\System32\ADVAPI32.DLL
  C:\WINXP\System32\ntdll.dll
  C:\WINXP\System32\KERNEL32.dll
  C:\WINXP\System32\RPCRT4.dll

Just because you can run it from CMD.EXE doesn't mean it's not a Cygwin
app.  You can run any Cygwin app from CMD.EXE (aka "Command Prompt") as
long as cygwin1.dll and any other necessary DLLs are in your path.

The program should not core dump on invalid arguments.  That I agree
with, and it's a bug that should be fixed.

Brian

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: regtool - 1.8 - Core dump

2005-02-26 Thread Alexander Joerg Herrmann
> False.  regtool is a cygwin app and depends on the
> cygwin DLL:
Was my mistake as I run it within the Cygwin startup
bat as 
E:\aIEngine\CYGWIN>bin\regtool
in order to set all the moutn points on computers
without CygWin installed.
Alex


=
___
http://tahi4x4.felixfrisch.deTake a look :)
[EMAIL PROTECTED]


Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: regtool - 1.8 - Core dump

2005-02-26 Thread Brian Dessent
Alexander Joerg Herrmann wrote:

> > False.  regtool is a cygwin app and depends on the
> > cygwin DLL:
> Was my mistake as I run it within the Cygwin startup
> bat as
> E:\aIEngine\CYGWIN>bin\regtool
> in order to set all the moutn points on computers
> without CygWin installed.

That doesn't change the fact that it's still a Cygwin application,
because it's linked against cygwin1.dll.  Because you have cygwin1.dll
on the system and in the same directory as regtool.exe means it will be
found when you run regtool.

Why aren't you using 'mount' and/or 'umount' to manipulate the mounts? 
There should be no need to modify the registry directly to add or remove
mounts and doing so may break in the future.  Regtool is not the proper
program to use to modify mounts.

Brian

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: regtool - 1.8 - Core dump

2005-02-26 Thread Alexander Joerg Herrmann
> That doesn't change the fact that it's still a
> Cygwin application,
> because it's linked against cygwin1.dll.  Because
> you have cygwin1.dll
> on the system and in the same directory as
> regtool.exe means it will be
> found when you run regtool.
I got that. I just didn't check.
> Why aren't you using 'mount' and/or 'umount' to
> manipulate the mounts? 
> There should be no need to modify the registry
> directly to add or remove
> mounts and doing so may break in the future. 
> Regtool is not the proper
> program to use to modify mounts.
I'am currently traveling to Thailand accessing the
Host computer www.felixfrisch.de thru Internet mainly
thru a CygWin installed on my USB Stick. They allow
you here to do a lot of stuff in the Internet Cafe on
there computer but sometimes regedit is blocked. Same
is true for the mount command. Dunno why but it's
blocked in some places. regtool does the job quite
well. I just plug in the USB Stick in the nearest
Internet cafe and start cygwin.bat where I included
all the regtool entry's. After startup I use 
ssh -Y -l myname felixfrisch.de 
and then I'am able to work just as the computer would
be here.
So much to the explenation. 
Alex

=
___
http://tahi4x4.felixfrisch.deTake a look :)
[EMAIL PROTECTED]


Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: regtool - 1.8 - Core dump

2005-02-27 Thread Igor Pechtchanski
On Sun, 27 Feb 2005, Alexander Joerg Herrmann wrote:

> > Why aren't you using 'mount' and/or 'umount' to manipulate the mounts?
> > There should be no need to modify the registry directly to add or
> > remove mounts and doing so may break in the future. Regtool is not the
> > proper program to use to modify mounts.
>
> I'am currently traveling to Thailand accessing the Host computer
> www.felixfrisch.de thru Internet mainly thru a CygWin installed on my
> USB Stick. They allow you here to do a lot of stuff in the Internet Cafe
> on there computer but sometimes regedit is blocked. Same is true for the
> mount command. Dunno why but it's blocked in some places. regtool does
> the job quite well.

That's probably because mount is trying to create system mounts by
default, and the HKLM key has restricted access (as it should).  Try using
"mount -u" instead, i.e.,

mount -u -b "E:/aIEngine/CYGWIN" "/"
mount -u -b "E:/aIEngine/CYGWIN/bin" "/usr/bin"
mount -u -b "E:/aIEngine/CYGWIN/lib" "/usr/lib"

HTH,
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: regtool - 1.8 - Core dump

2005-02-27 Thread Christopher Faylor
On Sun, Feb 27, 2005 at 11:04:49AM -0500, Igor Pechtchanski wrote:
>On Sun, 27 Feb 2005, Alexander Joerg Herrmann wrote:
>
>> > Why aren't you using 'mount' and/or 'umount' to manipulate the mounts?
>> > There should be no need to modify the registry directly to add or
>> > remove mounts and doing so may break in the future. Regtool is not the
>> > proper program to use to modify mounts.
>>
>> I'am currently traveling to Thailand accessing the Host computer
>> www.felixfrisch.de thru Internet mainly thru a CygWin installed on my
>> USB Stick. They allow you here to do a lot of stuff in the Internet Cafe
>> on there computer but sometimes regedit is blocked. Same is true for the
>> mount command. Dunno why but it's blocked in some places. regtool does
>> the job quite well.
>
>That's probably because mount is trying to create system mounts by
>default, and the HKLM key has restricted access (as it should).  Try using
>"mount -u" instead, i.e.,
>
>mount -u -b "E:/aIEngine/CYGWIN" "/"
>mount -u -b "E:/aIEngine/CYGWIN/bin" "/usr/bin"
>mount -u -b "E:/aIEngine/CYGWIN/lib" "/usr/lib"

Use the right tool for the right job?  Understand how the tool works?

No, no.  This is all too confusing.

I'm going to stick with editing the registry with notepad.  That's the
safest way to do things.

cgf

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



getopt required_argument (Was Re: regtool - 1.8 - Core dump)

2005-02-27 Thread Igor Pechtchanski
On Sat, 26 Feb 2005, Brian Dessent wrote:

> Alexander Joerg Herrmann wrote:
>
> > What I was mentioning is that
> > regtool -K
> > causes a core fault and something similar under windows because the
> > argument is broken. I know that the argument is missing and so should
> > regtool. It should produce a usage message insteed of a crash imo.
>
> The program should not core dump on invalid arguments.  That I agree
> with, and it's a bug that should be fixed.

Well, it's just a matter of adding a check for optarg being NULL and
printing an appropriate message (e.g.,
  if (optarg == NULL) {
fprintf(stderr, "Missing key-value separator\n");
usage();
  }
).

However, the question is what should getopt's behavior be if something
specified as a "required_argument" is missing?  Should it simply set
optarg to NULL, just like it does with "optional_argument", or should it
return an error code of some sort?  Any getopt experts out there?
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: getopt required_argument (Was Re: regtool - 1.8 - Core dump)

2005-02-27 Thread Igor Pechtchanski
On Sun, 27 Feb 2005, Igor Pechtchanski wrote:

> On Sat, 26 Feb 2005, Brian Dessent wrote:
>
> > Alexander Joerg Herrmann wrote:
> >
> > > What I was mentioning is that
> > > regtool -K
> > > causes a core fault and something similar under windows because the
> > > argument is broken. I know that the argument is missing and so should
> > > regtool. It should produce a usage message insteed of a crash imo.
> >
> > The program should not core dump on invalid arguments.  That I agree
> > with, and it's a bug that should be fixed.
>
> Well, it's just a matter of adding a check for optarg being NULL and
> printing an appropriate message (e.g.,
>   if (optarg == NULL) {
> fprintf(stderr, "Missing key-value separator\n");
> usage();
>   }
> ).
>
> However, the question is what should getopt's behavior be if something
> specified as a "required_argument" is missing?  Should it simply set
> optarg to NULL, just like it does with "optional_argument", or should it
> return an error code of some sort?  Any getopt experts out there?

Whoops, never mind.  It's a bug, pure and simple.  According to
,
two colons after a character indicate an *optional* argument, and for a
required argument one needs to use only one colon.  The only change needed
is that opts[] needs to only have one colon after "K".
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: getopt required_argument (Was Re: regtool - 1.8 - Core dump)

2005-03-01 Thread Alexander Joerg Herrmann
> Well, it's just a matter of adding a check for
> optarg being NULL and
> printing an appropriate message (e.g.,
>   if (optarg == NULL) {
> fprintf(stderr, "Missing key-value
> separator\n");
> usage();
>   }
> ).
Yup looks easy but I may better patch the DLL to use
some kind of fstab file which would it make complete
portable as now I'am sitting in front of a computer
which let's me run bash but not cmd - a. 

> However, the question is what should getopt's
> behavior be if something
> specified as a "required_argument" is missing? 
It sould do the same thing as the long parameter
arguments imo.
Alex

=
___
http://tahi4x4.felixfrisch.deTake a look :)
[EMAIL PROTECTED]


Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: getopt required_argument (Was Re: regtool - 1.8 - Core dump)

2005-03-01 Thread Igor Pechtchanski
On Tue, 1 Mar 2005, Alexander Joerg Herrmann wrote:

> > Well, it's just a matter of adding a check for
> > optarg being NULL and
> > printing an appropriate message (e.g.,
> >   if (optarg == NULL) {
> > fprintf(stderr, "Missing key-value
> > separator\n");
> > usage();
> >   }
> > ).
> Yup looks easy but I may better patch the DLL to use

FYI, this has been fixed in the snapshots by Christopher Faylor (which
happened between the time I did a "cvs update" and the time I prepared a
patch -- go figure).

> some kind of fstab file which would it make complete
> portable as now I'am sitting in front of a computer
> which let's me run bash but not cmd - a.

This has been discussed, and, in fact, is a plan for the future.  That was
one of the reasons using "mount" was suggested -- no matter where the
mounts are stored, "mount" will be guaranteed to do the right thing.

> > However, the question is what should getopt's
> > behavior be if something
> > specified as a "required_argument" is missing?
> It sould do the same thing as the long parameter
> arguments imo.

This was my bug -- the long options specified the argument as required,
but the short ones specified it as optional (two colons).  Thanks to CGF
for fixing it.
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/