Re: The C locale

2009-09-22 Thread Lapo Luchini
Andy Koppe wrote:
> No, it isn't. UTF-16 filename characters that can't be represented in
> the current charset are encoded by a ^N followed by the character's
> UTF-8 representation.

OK, right.

> For example, a Windows filename "bäh" turns into "bŤh" in the C locale,
> while it shows up correctly with explicitly set ISO-8859-1 or CP1252.

Uh? Doesn't seem so to me: if I create "bäh" in WindowsExplorer, then
open up an UTF-8 mintty console I have a consistent output with both
LANG=C and LANG=it_IT.UTF-8 (of course, since right now C is UTF-8):

% LANG=C ls -l|egrep b.h
-rw-r--r-- 1 lapo None 0 Sep 22 09:53 bäh
% LANG=it_IT.UTF-8 ls -l|egrep b.h
-rw-r--r-- 1 lapo None 0 22 Sep 09:53 bäh

So I'm not sure what do you mean with 'a Windows filename "bäh" turns
into "bŤh" in the C locale'... you mean that a script sees it as
62C3A468 as opposed as 62E468? Or that actual "bŤh" is shown somewhere?

As "bŤh" is just a representation, and it depends on the charset the
console expects (and in fact in this UTF-8-encoded message, it will be
probably represented with 62C385C2A468)... if the console is UTF-8,
what's currently shown is what I'd expect.
If OTOH we're talking what it is in raw form and not of what is shown
(i.e. about "3 bytes" vs a "4 bytes" string) well, that's a different
issue, and I'm not sure why a program should prefer a 3-byte
representations as opposed to a 4-byte one...?

But OTOH as far as "not caring" goes, it sure can be a nice feature to
be retro-compatible in that single case, since the behavior is not
well-defined anyways...
But again, if a script creates a filename that happens to contain
Japanese characters (or even umlauts or r-quotes/l-quotes) I would
expect to see that on the filesystem too, and not some random-looking
escaped-sequence...

> Btw, are you actually using the C locale?

Not usually, but it happens from time to time (mostly in script, or in
cases such as the monotone "make check" unit tests; one which tries to
create UTF-8 filenames and then ISO-8859-1 filenames currently fail).

-- 
Lapo Luchini - http://lapo.it/

“Endure. In enduring, grow strong.” (Dak'kon, videogame "Torment", 1999)


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



Re: cygdrive prefix

2009-09-22 Thread Thomas Plank
Linda Walsh (cyg...@tlinx.org) wrote:

> OTOH, at least the defaults are pretty sensible (I can just hit ENTER),
> through the setup -- EXCEPT...at the end -- how many times do I
> have to tell setup that I *STILL* don't want the icon on my desktop??!

I'm using cygwin on two different computers (home and work).
The one at home always wants to create the desktop symbol after calling
setup.exe, the other one never asks again for it since I deactivated the
checkbox ...

I have no idea why it is working and not.
The only difference is that cygwin is once in c:\cygwin and once in
d:\cygwin installed.

-- 
mfg Thomas

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



Re: [1.7] symlink regression

2009-09-22 Thread Corinna Vinschen
On Sep 21 15:06, Eric Blake wrote:
> In cygwin 1.5, symlink("a",d) correctly failed with EEXIST regardless of 
> whether d was "dir", "dir/", or "dir/.".  But in 1.7, it is failing with 
> ENOENT 
> for just "dir/", and failing a gnulib test as a result.  STC:
> 
> $ mkdir dir
> $ ln -sT nowhere dir/.
> ln: creating symbolic link `dir/.': File exists
> $ ln -sT nowhere dir/ 
> ln: creating symbolic link `dir/': No such file or directory

I reworked symlink's error handling so that in my testing I now get
the exact same error messages as on Linux:

  $ rm wqwqwq
  $ ln -sT nowhere wqwqwq/
  ln: creating symbolic link `wqwqwq/': No such file or directory
  $ ln -sT nowhere wqwqwq/.
  ln: creating symbolic link `wqwqwq/.': No such file or directory
  $ ln -sT nowhere wqwqwq
  $ ln -sT nowhere wqwqwq/
  ln: creating symbolic link `wqwqwq/': File exists
  $ ln -sT nowhere wqwqwq/.
  ln: creating symbolic link `wqwqwq/.': No such file or directory
  $ touch nowhere
  $ ln -sT nowhere wqwqwq
  ln: creating symbolic link `wqwqwq': File exists
  $ ln -sT nowhere wqwqwq/
  ln: creating symbolic link `wqwqwq/': File exists
  $ ln -sT nowhere wqwqwq/.
  ln: creating symbolic link `wqwqwq/.': Not a directory
  $ rm nowhere
  $ mkdir nowhere
  $ ln -sT nowhere wqwqwq
  ln: creating symbolic link `wqwqwq': File exists
  $ ln -sT nowhere wqwqwq/.
  ln: creating symbolic link `wqwqwq/.': File exists
  $ ln -sT nowhere wqwqwq/
  ln: creating symbolic link `wqwqwq/': File exists

Can you please check against your testsuite?


Thanks,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat

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



Re: [1.7] Invalid UTF8 while creating a file -> cannot delete?

2009-09-22 Thread Corinna Vinschen
On Sep 21 19:54, Andy Koppe wrote:
> 2009/9/21 Corinna Vinschen:
> > As you might know, invalid bytes >= 0x80 are translated to UTF-16 by
> > transposing them into the 0xdc00 - 0xdcff range by just or'ing 0xdc00.
> > The problem now is that readdir() will return the transposed characters
> > as if they are the original characters.
> 
> Yep, that's where the bug is. Those 0xDC?? words represent invalid
> UTF-8 bytes. They do not represent CP1252 or ISO-8859-1 characters.
> 
> Therefore, when converting a UTF-16 Windows filename to the current
> charset, 0xDC?? words should be treated like any other UTF-16 word
> that can't be represented in the current charset: it should be encoded
> as a ^N sequence.

How?  Just like the incoming multibyte character didn't represent a valid
UTF-8 char, a single U+DCxx value does not represent a valid UTF-16 char.
Therefore, the ^N conversion will fail since U+DCxx can't be converted
to valid UTF-8.

> > So it looks like the current mechanism to handle invalid multibyte
> > sequences is too complicated for us.  As far as I can see, it would be
> > much simpler and less error prone to translate the invalid bytes simply
> > to the equivalent UTF-16 value.  That creates filenames with UTF-16
> > values from the ISO-8859-1 range.
> 
> This won't work correctly, because different POSIX filenames will map
> to the same Windows filename. For example, the filenames "\xC3\xA4"
> (valid UTF-8 for a-umlaut) and "\xC4" (invalid UTF-8 sequence that
> represents a-umlaut in 8859-1), will both map to Windows filename
> "U+00C4", i.e a-umlaut in UTF-16. Furthermore, after creating a file
> called "\xC4", a readdir() would show that file as "\xC3\xA4".

Right, but using your above suggestion will also lead to another filename
in readdir, it would just be \x0e\xsome\xthing.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat

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



Re: non-BMP character width

2009-09-22 Thread Corinna Vinschen
On Sep 22 06:57, Lapo Luchini wrote:
> Corinna Vinschen wrote:
> > Sure.  I was specificially asking for a testcase, preferrably in
> > plain C, which allows to reproduce this under a debugger.
> 
> Actually, I can't reproduce that, but I guess it's a problem of the
> specific console he's using (Thomas, which one is that?): on mintty it
> works ok (I'm not really sure it outputs U+10001, but it surely shows a
> single box) and on rxvt it just shows as four ISO-8859-1 chars:
> (es expected, as native rxvt doesn't support Unicode)
> 
> mintty% echo "-\xF0\x90\x80\x81-"
> -???-
> rxvt% echo "-\xF0\x90\x80\x81-"
> -ð???-
> 
> Also ok on `ls`:
> 
> % cat s.c
> int main() {
> fopen("a-\xF0\x90\x80\x81", "w");
> return 0;
> }
> % ./s
> % ls -l|fgrep a-
> -rw-r--r-- 1 lapo None 0 22 Sep 06:50 a-???

Uh, I see.  That occurs in the normal Windows console.  This is not
Cygwin's fault.  Cygwin's console code converts the multibyte string to
the WCHAR representation and prints it to the console using the
WriteConsoleW function.  That function prints two blocks/question marks
for a surrogate pair.  Look at the file in a cmd shell, it will also
print two blocks/question marks for the surrogate pair.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat

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



[ANNOUNCEMENT] [1.7] Updated: {octave,octave-devel,octave-doc}-3.2.3-1

2009-09-22 Thread Marco Atzeri
New versions of

{octave,octave-devel,octave-doc}-3.2.3-1

for cygwin-1.7

are available in the Cygwin distribution:

This is a minor bug fix release

For all the main changes
http://www.gnu.org/software/octave/NEWS-3.2.html

DESCRIPTION
The GNU Octave language for numerical computations
Octave is a (mostly Matlab (R) compatible)
high-level language, primarily intended for
numerical computations.  It provides a convenient
command-line interface for solving linear and
nonlinear problems numerically.

HOMEPAGE
http://www.gnu.org/software/octave/

Marco Atzeri

If you have questions or comments, please send them to the
cygwin mailing list at: cygwin (at) cygwin (dot) com .

  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list,
look at the "List-Unsubscribe: " tag in the email header of this
message. Send email to the address specified there. It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain@cygwin.com

If you need more information on unsubscribing, start reading here:

http://sourceware.org/lists.html#unsubscribe-simple

Please read *all* of the information on unsubscribing that
is available starting at this URL.







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



[ANNOUNCEMENT] [1.7] Updated: GraphicsMagick-1.3.7-1

2009-09-22 Thread Marco Atzeri
Version 1.3.7-1 of
   GraphicsMagick
   libGraphicsMagick-devel
   libGraphicsMagick3
   perl-Graphics-Magick

have been uploaded for cygwin-1.7

DESCRIPTION
GraphicsMagick is the swiss army knife of image processing.
It provides a robust and efficient collection of tools and
libraries which support reading, writing, and manipulating an
image in over 88 major formats including important formats like
DPX, GIF, JPEG, JPEG-2000, PNG, PDF, PNM, and TIFF.

HOMEPAGE
http://www.graphicsmagick.org/

CHANGES
This is a new security, bugfix and performance improvement upstream relase.

Security Fixes:
* PCX: Detect improper rows, columns, or depth. Fixes CVE-2008-1097 
"Memory corruption in ImageMagick's PCX coder".
* DrawDashPolygon: Avoid a crash which sometimes occured with tiny 
polygons.

For the full changes:

http://www.graphicsmagick.org/1.3/NEWS.html


Regards
Marco Atzeri


If you have questions or comments, please send them to the
cygwin mailing list at: cygwin (at) cygwin (dot) com .

  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list,
look at the "List-Unsubscribe: " tag in the email header of this
message. Send email to the address specified there. It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain@cygwin.com

If you need more information on unsubscribing, start reading here:

http://sourceware.org/lists.html#unsubscribe-simple

Please read *all* of the information on unsubscribing that
is available starting at this URL.






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



[ANNOUNCEMENT] [1.7] Updated: {libhdf5_0,libhdf5-devel,hdf5}-1.6.9-2

2009-09-22 Thread Marco Atzeri
Version {libhdf5_0,libhdf5-devel,hdf5}-1.6.9-2
for cygwin-1.7 have been uploaded.

DESCRIPTION
HDF5 is a suite/library that makes possible the
management of extremely large and complex data collections.

HOMEPAGE
http://www.hdfgroup.org/HDF5/

CHANGES
This is a cygwin fix release.
Programs were missing the .exe suffixes


Regards
Marco Atzeri

If you have questions or comments, please send them to the
cygwin mailing list at: cygwin (at) cygwin (dot) com .

  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list,
look at the "List-Unsubscribe: " tag in the email header of this
message. Send email to the address specified there. It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain@cygwin.com

If you need more information on unsubscribing, start reading here:

http://sourceware.org/lists.html#unsubscribe-simple

Please read *all* of the information on unsubscribing that
is available starting at this URL.





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



[ANNOUNCEMENT] [1.7] Updated: SuiteSparse-3.4.0-3

2009-09-22 Thread Marco Atzeri
New versions of

SuiteSparse / libSuiteSparse-devel 3.4.0-3

for cygwin-1.7 are available in the Cygwin distribution:

CHANGES
These is a cygwin header fix release.

DESCRIPTION
SuiteSparse is library for sparse matrix.
It is used to compile Octave

HOMEPAGE
http://www.cise.ufl.edu/research/sparse/SuiteSparse/


Marco Atzeri

If you have questions or comments, please send them to the
cygwin mailing list at: cygwin (at) cygwin (dot) com .

  *** CYGWIN-ANNOUNCE UNSUBSCRIBE INFO ***

If you want to unsubscribe from the cygwin-announce mailing list,
look at the "List-Unsubscribe: " tag in the email header of this
message. Send email to the address specified there. It will be in the format:

cygwin-announce-unsubscribe-you=yourdomain@cygwin.com

If you need more information on unsubscribing, start reading here:

http://sourceware.org/lists.html#unsubscribe-simple

Please read *all* of the information on unsubscribing that
is available starting at this URL.





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



Re: [1.7] symlink regression

2009-09-22 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Corinna Vinschen on 9/22/2009 3:27 AM:
> I reworked symlink's error handling so that in my testing I now get
> the exact same error messages as on Linux:
> 
>   $ rm wqwqwq
>   $ ln -sT nowhere wqwqwq/
>   ln: creating symbolic link `wqwqwq/': No such file or directory

One oddity left:

$ touch a
$ ln -sT nowhere a/ => EEXIST
$ ln -sT nowhere a// => ENOTDIR

On Linux, both fail with EEXIST (but this violates POSIX, since a/ does
not exist).  On Solaris, both fail with ENOTDIR (which makes more sense).

The reason that cygwin is inconsistent is that you created newpath but
only truncated the final /, rather than checking for multiple /.  Here's
once case where I think it might be smarter to match Solaris and fail with
ENOTDIR regardless of how many trailing slashes, rather than matching
Linux and failing with EEXIST, particularly since it is faster (we don't
have to even bother with creating newpath); but if we want to match Linux,
then we have to handle all trailing when creating newpath.

But at least the testsuite where I originally found the issue now passes
(since it accepts either EEXIST or ENOTDIR).  So I could also live with
inaction, making no further changes to your patch.

- --
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkq4tukACgkQ84KuGfSFAYC6EQCfVw0pmvmTPiVDHvqer00mP6Me
7vgAn3yFprWCkfvelPJtYLL+FIO8+RUt
=qOce
-END PGP SIGNATURE-

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



Re: The C locale

2009-09-22 Thread Andy Koppe
2009/9/22 Lapo Luchini:
>> For example, a Windows filename "bäh" turns into "bŤh" in the C locale,
>> while it shows up correctly with explicitly set ISO-8859-1 or CP1252.
>
> Uh? Doesn't seem so to me: if I create "bäh" in WindowsExplorer, then
> open up an UTF-8 mintty console I have a consistent output with both
> LANG=C and LANG=it_IT.UTF-8 (of course, since right now C is UTF-8):
>
> % LANG=C ls -l|egrep b.h
> -rw-r--r-- 1 lapo None     0 Sep 22 09:53 bäh
> % LANG=it_IT.UTF-8 ls -l|egrep b.h
> -rw-r--r-- 1 lapo None     0 22 Sep 09:53 bäh

You've presumably got mintty set to UTF-8, hence mintty's output
conversion turned ls's ISO-8859-1 "Ť" (i.e. "\xC3\xA4") into "ä".


> So I'm not sure what do you mean with 'a Windows filename "bäh" turns
> into "bŤh" in the C locale'... you mean that a script sees it as
> 62C3A468 as opposed as 62E468? Or that actual "bŤh" is shown somewhere?

Both. For the latter, try it in the default Cygwin console, without
any locale variables set.


> But OTOH as far as "not caring" goes, it sure can be a nice feature to
> be retro-compatible in that single case

Thanks. Unfortunately the "C" locale is rather important though,
because that's what people will be using unless they go to the effort
of finding out how to set a different locale.

Andy

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



Re: Can't get SSHD started after successfully runnin g sshd-host-configâ

2009-09-22 Thread Kyle Stanek

Huang Bambo wrote:
   Try run /usr/sbin/sshd  and tell me the output.

/usr/sbin/sshd outputs nothing and returns immediately

2009/9/22 Kyle Stanek 
>
>
> Hello,
>
> I'm having trouble getting the sshd service running under
> cygwin. ?I am running Cygwin on Windows XP SP3. ?I have successfully
> run ssh-host-config, however I get errors when I try and start the
> service using cygrunsrv or net:
>
>
> [fido ~]$ cygrunsrv --start sshd
> cygrunsrv: Error starting a service: QueryServiceStatus: ?Win32 error 1062:
> The service has not been started.
> [fido ~]$
> [fido ~]$ net start sshd
> The CYGWIN sshd service is starting.
>
> The CYGWIN sshd service could not be started.
>
> The service did not report an error.
>
> More help is available by typing NET HELPMSG 3534.
>
> [fido ~]$
>
> Also, the sshd log is empty:
> [fido ~]$ cat /var/log/sshd.log
>
> [fido ~]$
>
> Another
> piece of information that may be helpful is that I can't even get the
> sshd executable to output any debug information, as it simply returns
> silently. ?i.e.
>
> [fido ~]$ /usr/sbin/sshd -d -d -d -D
>
> [fido ~]$ /usr/sbin/sshd -d
> [fido ~]$
>
> Here is my best attempt at an accounting of the settings that I have used:
> 1. ?I installed cygwin packages for all users, Unix / binary file types
> 2. ?I have installed the following Cygwin packages:
>
> cygrunsrv 1.34-1
> openssh 5.1p1-8
> 3.
> When running ssh-host-config, I accepted all defaults and chose to run
> sshd under a separate account with limited permissions.
>
> Please let me know if you need any more information. ?I would appreciate any 
> help that could be provided.
>
>
> Thanks,
> Kyle
>
> _
> Hotmail: Powerful Free email with security by Microsoft.
> http://clk.atdmt.com/GBL/go/171222986/direct/01/
>
> --
> Problem reports: ? ? ? http://cygwin.com/problems.html
> FAQ: ? ? ? ? ? ? ? ? ? http://cygwin.com/faq/
> Documentation: ? ? ? ? http://cygwin.com/docs.html
> Unsubscribe info: ? ? ?http://cygwin.com/ml/#unsubscribe-simple
>

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


_
Bing brings you health info from trusted sources.
http://www.bing.com/search?q=pet+allergy&form=MHEINA&publ=WLHMTAG&crea=TXT_MHEINA_Health_Health_PetAllergy_1x1

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



Re: Problem with GCC4[1.7]

2009-09-22 Thread Angelo Graziosi

Dave Korn wrote:

Here's one I just regenerated


Now it WORKS!!

(I suspected something was wrong with the old gnat.bsdiff...)


Thanks,
Angelo.

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



Re: Can't get SSHD started after successfully running sshd-host-configâ

2009-09-22 Thread Kyle Stanek

> On 09/21/2009 08:27 PM, Kyle Stanek wrote:
>
> Hello,
>
> I'm having trouble getting the sshd service running under
> cygwin. I am running Cygwin on Windows XP SP3. I have successfully
> run ssh-host-config, however I get errors when I try and start the
> service using cygrunsrv or net:
>
> [fido ~]$ cygrunsrv --start sshd
> cygrunsrv: Error starting a service: QueryServiceStatus: Win32 error 1062:
> The service has not been started.
> [fido ~]$
> [fido ~]$ net start sshd
> The CYGWIN sshd service is starting.
>
> The CYGWIN sshd service could not be started.
>
>
>
> The service did not report an error.
>
>
>
> More help is available by typing NET HELPMSG 3534.
>
>
>
> [fido ~]$
>
>
>
> Also, the sshd log is empty:
> [fido ~]$ cat /var/log/sshd.log
>
> [fido ~]$
>
>
>
> Another
> piece of information that may be helpful is that I can't even get the
> sshd executable to output any debug information, as it simply returns
> silently. i.e.
>
> [fido ~]$ /usr/sbin/sshd -d -d -d -D
>
>
>
> [fido ~]$ /usr/sbin/sshd -d
>
> Ugh! I wish there was some way we could stop folks from trying to do this like
>
> they can on Linux and other Unix. :-( You've very likely just messed up your
>
> permissions on a bunch of files and directories that 'sshd' uses. These
> will need
>
> to be reset for things to work properly. If you've just installed Cygwin,
> take the
>
> simple route out and remove Cygwin (see the FAQ for pointers on how) and
>
> reinstall.
> _Don't_run_'sshd'_or_any_Cygwin_service_from_the_shell_unless_the_shell_
>
> _is_owned_by_the_privileged_user_that_will_run_the_service_. If you don't
> know what
>
> the preceding means, then don't run sshd from a shell, period.
>
I am hesitant to do this, as I have spent a good amount of time customizing my 
Cygwin environment.  However, if you think this is the only way to go I can do 
it.
>
>
> Here is my best attempt at an accounting of the settings that I have used:
> 1. I installed cygwin packages for all users, Unix / binary file types
> 2. I have installed the following Cygwin packages:
>
> cygrunsrv 1.34-1
> openssh 5.1p1-8
> 3.
> When running ssh-host-config, I accepted all defaults and chose to run
> sshd under a separate account with limited permissions.
>
> Please let me know if you need any more information. I would appreciate
> any help that could be provided.
>
> Sounds to me like something is missing from the install. What does
> 'cygcheck sshd' say?
>

[fido ~]$ cygcheck sshd
Error: could not find sshd
[fido ~]$


_
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/171222986/direct/01/

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



Re: Can't get SSHD started after successfully running sshd-host-configâ

2009-09-22 Thread Marco Atzeri
--- Mar 22/9/09, Kyle Stanek  ha scritto:

> Da: Kyle Stanek 
> Oggetto: Re: Can't get SSHD started after successfully running 
> sshd-host-configâ
> A: cygwin@cygwin.com
> Data: Martedì 22 settembre 2009, 15:50
> 
> > On 09/21/2009 08:27 PM, Kyle Stanek wrote:
> >
> > Hello,
> >
> > I'm having trouble getting the sshd service running
> under
> > cygwin. I am running Cygwin on Windows XP SP3. I have
> successfully

[cut]
> >
> > Sounds to me like something is missing from the
> install. What does
> > 'cygcheck sshd' say?
> >
> 
> [fido ~]$ cygcheck sshd
> Error: could not find sshd
> [fido ~]$

try
cygcheck /usr/sbin/sshd

it should give you (or similar)

$ cygcheck /usr/sbin/sshd
C:\cygwin2\usr\sbin\sshd.exe
  C:\cygwin2\bin\cygcrypt-0.dll
C:\cygwin2\bin\cygwin1.dll
  C:\WINDOWS\system32\ADVAPI32.DLL
C:\WINDOWS\system32\KERNEL32.dll
  C:\WINDOWS\system32\ntdll.dll
C:\WINDOWS\system32\RPCRT4.dll
  C:\WINDOWS\system32\Secur32.dll
  C:\cygwin2\bin\cygcrypto-0.9.8.dll
  C:\cygwin2\bin\cygwrap-0.dll
  C:\cygwin2\bin\cygz.dll

Marco





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



Re: Opening a socket connection in a fork ?

2009-09-22 Thread Corinna Vinschen
On Sep 16 22:16, Gu1ll4um3r0m41n wrote:
> Hello,
> I'm trying to run a program on cygwin that forks, opens a socket
> connection and sends the status of the connection to the parent
> process using pipes. The parent process then sends data through the
> opened socket.
> The program works well on linux but on cygwin, i cannot use recv on a
> socket opened in a fork. The recv function always return -1, errno 22
> ("EINVAL").
> The weird thing is that the socket stays open and send still works...
> 
> I attached a short example.
> I don't know if this is a bug or a limitation due to the fork()
> implementation in cygwin... I searched on google but couldn't find
> anything really useful.

It looks like a really weird problem in WinSock.  Cygwin doesn't do
anything special in this case.

The socket handle gets duplicated into the child process on fork.  The
child calls connect on the duplicated socket handle which apparently
succeeds.

In this scenario, calls to WinSock's recvfrom and WSARecvFrom in the
parent will fail with WSAEINVAL, regardless whether both address
parameters, name and namelen, are NULL or point to valid storage.
However, calls to recv and WSARecv succeed as expected.

Per MSDN, WSAEINVAL in the context of recv means  "The socket has not
been bound".  It is as if the recvfrom functions test if the socket is
bound locally, but in the parent process, WinSock doesn't know about
that and fails, while the same test is omitted in the recv functions.

The same problem does not exist for sendto/WSASendTo apparently.

I'm going to apply a patch which calls WSARecv rather than WSARecvFrom
if the name parameter is NULL.  This fixes the above problem and, given
that the `!wsamsg->name' check has to be called anyway to workaround
another WinSock problem, has no performance hit.

I also created a native Win32 testcase which proves that this isn't a
Cygwin problem, but a WinSock problem.


Thanks for the report,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat

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



Re: Problem with GCC4[1.7]

2009-09-22 Thread Dave Korn
Angelo Graziosi wrote:
> Dave Korn wrote:
>> Here's one I just regenerated
> 
> Now it WORKS!!

  I hacked out a duplicate call to __main and updated the checksum in the PE
file header.

  Also, this version gives you infinite lives :-P

cheers,
  DaveK

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



how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread tianlijian
how to let cygwin does not mount /bin /usr/bin automaticlly?

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



Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread Dave Korn
tianlijian wrote:
> how to let cygwin does not mount /bin /usr/bin automaticlly?

  Lots of things won't work without that mount.  I advise not to tamper with it.

cheers,
  DaveK


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



Re: Can't get SSHD started after successfully running sshd-host-configâ

2009-09-22 Thread Larry Hall (Cygwin)

On 09/22/2009 09:50 AM, Kyle Stanek wrote:

take the simple route out and remove Cygwin (see the FAQ for pointers on how) 
and
reinstall.

I am hesitant to do this, as I have spent a good amount of time
customizing my Cygwin environment.  However, if you think this is the
only way to go I can do it.


No, it's not.  You can reset all the permissions to be the way they should 
be to
run as the privileged user.  See '/bin/ssh-host-config' and the related 
scripts it calls.
Look for spots where it's changing ownerships and permissions and make sure 
yours
match what's there for the privileged user on your system (SYSTEM for XP, 
cyg_server

for later O/S versions).

Thanks Marco for picking up on my cygcheck sshd typo,

--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
216 Dalton Rd.  (508) 893-9889 - FAX
Holliston, MA 01746

_

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

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



Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread tianlijian
I use a older version of 1.7, which do not mount `/bin', `/usr/bin'
automatically. It works well.

On Tue, Sep 22, 2009 at 11:04 PM, Dave Korn
 wrote:
> tianlijian wrote:
>> how to let cygwin does not mount /bin /usr/bin automaticlly?
>
>  Lots of things won't work without that mount.  I advise not to tamper with 
> it.
>
>    cheers,
>      DaveK
>
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>

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



RE: Can't get SSHD started after successfully running sshd-host-configâ

2009-09-22 Thread Kyle Stanek

Ahh...Thanks for the pointer.  Here's the output now:

[fido ~]$ cygcheck /usr/sbin/sshd
C:\cygwin\usr/sbin/sshd.exe
  C:\cygwin\bin\cygcrypt-0.dll
C:\cygwin\bin\cygwin1.dll
  C:\WINDOWS\system32\ADVAPI32.DLL
C:\WINDOWS\system32\KERNEL32.dll
  C:\WINDOWS\system32\ntdll.dll
C:\WINDOWS\system32\RPCRT4.dll
  C:\WINDOWS\system32\Secur32.dll
  C:\cygwin\bin\cygcrypto-0.9.8.dll
Error: could not find cygwrap-0.dll
  C:\cygwin\bin\cygz.dll
[fido ~]$

Seems suspicious, know where I can get that missing driver?

Kyle


> Date: Tue, 22 Sep 2009 14:19:41 +
> From: marco_atz...@yahoo.it
> Subject: Re: Can't get SSHD started after successfully running 
> sshd-host-configâ
> To: cygwin@cygwin.com
>
> --- Mar 22/9/09, Kyle Stanek ha scritto:
>
>> Da: Kyle Stanek
>> Oggetto: Re: Can't get SSHD started after successfully running 
>> sshd-host-configâ
>> A: cygwin@cygwin.com
>> Data: Martedì 22 settembre 2009, 15:50
>>
>>> On 09/21/2009 08:27 PM, Kyle Stanek wrote:
>>>
>>> Hello,
>>>
>>> I'm having trouble getting the sshd service running
>> under
>>> cygwin. I am running Cygwin on Windows XP SP3. I have
>> successfully
>
> [cut]
>>>
>>> Sounds to me like something is missing from the
>> install. What does
>>> 'cygcheck sshd' say?
>>>
>>
>> [fido ~]$ cygcheck sshd
>> Error: could not find sshd
>> [fido ~]$
>
> try
> cygcheck /usr/sbin/sshd
>
> it should give you (or similar)
>
> $ cygcheck /usr/sbin/sshd
> C:\cygwin2\usr\sbin\sshd.exe
> C:\cygwin2\bin\cygcrypt-0.dll
> C:\cygwin2\bin\cygwin1.dll
> C:\WINDOWS\system32\ADVAPI32.DLL
> C:\WINDOWS\system32\KERNEL32.dll
> C:\WINDOWS\system32\ntdll.dll
> C:\WINDOWS\system32\RPCRT4.dll
> C:\WINDOWS\system32\Secur32.dll
> C:\cygwin2\bin\cygcrypto-0.9.8.dll
> C:\cygwin2\bin\cygwrap-0.dll
> C:\cygwin2\bin\cygz.dll
>
> Marco
>
>
>
>
>
> --
> Problem reports: http://cygwin.com/problems.html
> FAQ: http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
>

_
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
http://clk.atdmt.com/GBL/go/171222985/direct/01/

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



Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread Larry Hall (Cygwin)

On 09/22/2009 11:01 AM, tianlijian wrote:

I use a older version of 1.7, which do not mount `/bin', `/usr/bin'
automatically. It works well.


Why do you care what Cygwin requires here?  Are you having a
problem?

--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
216 Dalton Rd.  (508) 893-9889 - FAX
Holliston, MA 01746

_

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

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



Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread Dave Korn
tianlijian wrote:
> I use a older version of 1.7, which do not mount `/bin', `/usr/bin'
> automatically. 

  Something must have gone wrong with creating fstab during the upgrade I
guess, it should have been done.

> It works well.

  What happens when a shell script begins "#!/bin/sh"?  Alternatively, what
happens when a shell script begins "#!/usr/bin/sh"?  I would expect one of
those two to fail.

cheers,
  DaveK

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



Re: Can't get SSHD started after successfully running sshd-host-configâ

2009-09-22 Thread Larry Hall (Cygwin)

On 09/22/2009 11:07 AM, Kyle Stanek wrote:


Ahh...Thanks for the pointer.  Here's the output now:

[fido ~]$ cygcheck /usr/sbin/sshd
C:\cygwin\usr/sbin/sshd.exe
   C:\cygwin\bin\cygcrypt-0.dll
 C:\cygwin\bin\cygwin1.dll
   C:\WINDOWS\system32\ADVAPI32.DLL
 C:\WINDOWS\system32\KERNEL32.dll
   C:\WINDOWS\system32\ntdll.dll
 C:\WINDOWS\system32\RPCRT4.dll
   C:\WINDOWS\system32\Secur32.dll
   C:\cygwin\bin\cygcrypto-0.9.8.dll
Error: could not find cygwrap-0.dll
   C:\cygwin\bin\cygz.dll
[fido ~]$

Seems suspicious, know where I can get that missing driver?




Install 'libwrap0' using 'setup.exe'.  If it says it's already installed, 
try re-installing

it.

--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
216 Dalton Rd.  (508) 893-9889 - FAX
Holliston, MA 01746

_

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

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



Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread ︶ㄣ無名氏
I want to put thd command according to filesytem hierarchy standard,
that is putting the cmd such as sh in /bin, and env in /usr/bin/.

On Tue, Sep 22, 2009 at 23:06, Larry Hall (Cygwin)
 wrote:
>
> On 09/22/2009 11:01 AM, tianlijian wrote:
>>
>> I use a older version of 1.7, which do not mount `/bin', `/usr/bin'
>> automatically. It works well.
>
> Why do you care what Cygwin requires here?  Are you having a
> problem?
>
> --
> Larry Hall                              http://www.rfk.com
> RFK Partners, Inc.                      (508) 893-9779 - RFK Office
> 216 Dalton Rd.                          (508) 893-9889 - FAX
> Holliston, MA 01746
>
> _
>
> A: Yes.
> > Q: Are you sure?
> >> A: Because it reverses the logical flow of conversation.
> >>> Q: Why is top posting annoying in email?
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

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



Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread Larry Hall (Cygwin)

On 09/22/2009 11:30 AM, ︶ㄣ無名氏 wrote:

On Tue, Sep 22, 2009 at 23:06, Larry Hall (Cygwin)   
wrote:

  ^
.  Thanks.



On 09/22/2009 11:01 AM, tianlijian wrote:


I use a older version of 1.7, which do not mount `/bin', `/usr/bin'
automatically. It works well.


Why do you care what Cygwin requires here?  Are you having a
problem?

I want to put thd command according to filesytem hierarchy standard,
that is putting the cmd such as sh in /bin, and env in /usr/bin/.


Ah, OK.  I understand your goal.  However, with Cygwin, there is really
no difference in the two directories, which is why one is mounted to
the other.  While you are free to change this, it will be a non-standard
configuration and any problem you encounter as a result won't be
supported by this list.

--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
216 Dalton Rd.  (508) 893-9889 - FAX
Holliston, MA 01746

_

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

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



RE: Can't get SSHD started after successfully running sshd-host-configâ

2009-09-22 Thread Kyle Stanek

Thanks a lot for the help.  I did the following and sshd now runs successfully:

0.  I did some grepping to try and find permissions to reset after my erroneous 
direct call to /usr/sbin/sshd.  I saved these permissions in a script which I 
ran.  I'm not sure if this contributed to the fix or not.  However, I have 
attached the script.
1.  I clicked "Keep" until it showed "Reinstall" next to OpenSSH using 
setup.exe.
2.  I ran ssh-host-config
3.  I ran cygrunsrv --start sshd
4.  Got the same error as before, but checked /var/logs/sshd.log and saw:

[fido ~]$ cat /var/log/sshd.log
/var/empty must be owned by root and not group or world-writable.
/var/empty must be owned by root and not group or world-writable.
[fido ~]$ ls -ld /var/empty
drwxr-xr-x+ 2 sshd Administrators 0 Sep 21 14:20 /var/empty/

5.  So I changed the owner of /var/empty to SYSTEM

[fido ~]$ chown SYSTEM /var/empty
[fido ~]$ 

6.  Then I ran cygrunsrv --start sshd again and sshd started successfully



> Date: Tue, 22 Sep 2009 11:09:44 -0400
> From: reply-to-list-only...@cygwin.com
> To: cygwin@cygwin.com
> Subject: Re: Can't get SSHD started after successfully running 
> sshd-host-configâ
>
> On 09/22/2009 11:07 AM, Kyle Stanek wrote:
>>
>> Ahh...Thanks for the pointer. Here's the output now:
>>
>> [fido ~]$ cygcheck /usr/sbin/sshd
>> C:\cygwin\usr/sbin/sshd.exe
>> C:\cygwin\bin\cygcrypt-0.dll
>> C:\cygwin\bin\cygwin1.dll
>> C:\WINDOWS\system32\ADVAPI32.DLL
>> C:\WINDOWS\system32\KERNEL32.dll
>> C:\WINDOWS\system32\ntdll.dll
>> C:\WINDOWS\system32\RPCRT4.dll
>> C:\WINDOWS\system32\Secur32.dll
>> C:\cygwin\bin\cygcrypto-0.9.8.dll
>> Error: could not find cygwrap-0.dll
>> C:\cygwin\bin\cygz.dll
>> [fido ~]$
>>
>> Seems suspicious, know where I can get that missing driver?
>
> 
>
> Install 'libwrap0' using 'setup.exe'. If it says it's already installed,
> try re-installing
> it.
>
> --
> Larry Hall http://www.rfk.com
> RFK Partners, Inc. (508) 893-9779 - RFK Office
> 216 Dalton Rd. (508) 893-9889 - FAX
> Holliston, MA 01746
>
> _
>
> A: Yes.
>> Q: Are you sure?
>>> A: Because it reverses the logical flow of conversation.
 Q: Why is top posting annoying in email?
>
> --
> Problem reports: http://cygwin.com/problems.html
> FAQ: http://cygwin.com/faq/
> Documentation: http://cygwin.com/docs.html
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
>

_
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
http://clk.atdmt.com/GBL/go/171222985/direct/01/

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

Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread ︶ㄣ無名氏
Thanks. I want to know how to change this configuration.

I do as follows:

bash-3.2$ /bin/umount /usr/bin
umount: /usr/bin: Operation not permitted

but i does not work. Any idea?

On Tue, Sep 22, 2009 at 23:40, Larry Hall (Cygwin)
 wrote:
> On 09/22/2009 11:30 AM, ︶ㄣ無名氏 wrote:
>>
>> On Tue, Sep 22, 2009 at 23:06, Larry Hall (Cygwin)
>>   wrote:
>
>                                                  ^
> .  Thanks.
>
>>>
>>> On 09/22/2009 11:01 AM, tianlijian wrote:

 I use a older version of 1.7, which do not mount `/bin', `/usr/bin'
 automatically. It works well.
>>>
>>> Why do you care what Cygwin requires here?  Are you having a
>>> problem?
>>
>> I want to put thd command according to filesytem hierarchy standard,
>> that is putting the cmd such as sh in /bin, and env in /usr/bin/.
>
> Ah, OK.  I understand your goal.  However, with Cygwin, there is really
> no difference in the two directories, which is why one is mounted to
> the other.  While you are free to change this, it will be a non-standard
> configuration and any problem you encounter as a result won't be
> supported by this list.
>
> --
> Larry Hall                              http://www.rfk.com
> RFK Partners, Inc.                      (508) 893-9779 - RFK Office
> 216 Dalton Rd.                          (508) 893-9889 - FAX
> Holliston, MA 01746
>
> _
>
> A: Yes.
>> Q: Are you sure?
>>> A: Because it reverses the logical flow of conversation.
 Q: Why is top posting annoying in email?
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>

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



Re: [1.7] Invalid UTF8 while creating a file -> cannot delete?

2009-09-22 Thread Andy Koppe
2009/9/22 Corinna Vinschen:
>> > As you might know, invalid bytes >= 0x80 are translated to UTF-16 by
>> > transposing them into the 0xdc00 - 0xdcff range by just or'ing 0xdc00.
>> > The problem now is that readdir() will return the transposed characters
>> > as if they are the original characters.
>>
>> Yep, that's where the bug is. Those 0xDC?? words represent invalid
>> UTF-8 bytes. They do not represent CP1252 or ISO-8859-1 characters.
>>
>> Therefore, when converting a UTF-16 Windows filename to the current
>> charset, 0xDC?? words should be treated like any other UTF-16 word
>> that can't be represented in the current charset: it should be encoded
>> as a ^N sequence.
>
> How?  Just like the incoming multibyte character didn't represent a valid
> UTF-8 char, a single U+DCxx value does not represent a valid UTF-16 char.
> Therefore, the ^N conversion will fail since U+DCxx can't be converted
> to valid UTF-8.

True, but that's an implementation issue rather than a design issue,
i.e. the ^N conversion needs to do the UTF-8 conversion itself rather
than invoke the __utf8 functions. Shall I look into creating a patch?


>> > So it looks like the current mechanism to handle invalid multibyte
>> > sequences is too complicated for us.  As far as I can see, it would be
>> > much simpler and less error prone to translate the invalid bytes simply
>> > to the equivalent UTF-16 value.  That creates filenames with UTF-16
>> > values from the ISO-8859-1 range.
>>
>> This won't work correctly, because different POSIX filenames will map
>> to the same Windows filename. For example, the filenames "\xC3\xA4"
>> (valid UTF-8 for a-umlaut) and "\xC4" (invalid UTF-8 sequence that
>> represents a-umlaut in 8859-1), will both map to Windows filename
>> "U+00C4", i.e a-umlaut in UTF-16. Furthermore, after creating a file
>> called "\xC4", a readdir() would show that file as "\xC3\xA4".
>
> Right, but using your above suggestion will also lead to another filename
> in readdir, it would just be \x0e\xsome\xthing.

I don't think the suggestion above is directly relevant to the problem
I tried to highlight here.

Currently, with UTF-8 filename encodings, "\xC3xA4" turns into U+00C4
on disk, while "\xC4" turns into U+DCC4, and converting back yields
the original separate filenames. If I understand your proposal
correctly, both "\xC3\xA4" and "\xC4" would turn into U+00C4, hence
converting back would yield "\xC3\xA4" for both. This is wrong. Those
filenames shouldn't be clobbering each other, and a filename shouldn't
change between open() and readdir(), certainly not without switching
charset inbetween.

Having said that, if you did switch charset from UTF-8 e.g. to
ISO-8859-1, the on-disk U+DCC4 would indeed turn into
"\x0E\xsome\xthing". However, that issue applies to any UTF-16
character not in the target charset, not just those funny U+DC?? codes
for representing invalid UTF-8 bytes.

The only way to avoid the POSIX filenames changing depending on locale
would be to assume UTF-8 for filenames no matter the locale charset.
That's an entirely different can of worms though, extending the
compatibility problems discussed on the "The C locale" thread to all
non-UTF-8 locales, and putting the onus for converting filenames on
applications.

Andy

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



Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread Andy Koppe
2009/9/22 ︶ㄣ無名氏:
> Thanks. I want to know how to change this configuration.
>
> I do as follows:
>
> bash-3.2$ /bin/umount /usr/bin
> umount: /usr/bin: Operation not permitted
>
> but i does not work. Any idea?

/etc/fstab

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



Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread Larry Hall (Cygwin)
Again, I'd ask that you .  I 
don't need the

spam and others that respond to you also are likely to not want to see more.

On 09/22/2009 12:11 PM, ︶ㄣ無名氏 wrote:

Thanks. I want to know how to change this configuration.

I do as follows:

bash-3.2$ /bin/umount /usr/bin
umount: /usr/bin: Operation not permitted

but i does not work. Any idea?


You won't be able to do this without changing some code internally.  Cygwin 1.7
tries very hard to keep your installation consistent and valid.  If you want 
something
different, you'll need to undo the code that works to accomplish this. 
Off-hand, I don't

recall where that code is.  But since you can also look at the code (and recent
changelogs :-) ), I expect you can locate it at least as quickly as I could.


--
Larry Hall  http://www.rfk.com
RFK Partners, Inc.  (508) 893-9779 - RFK Office
216 Dalton Rd.  (508) 893-9889 - FAX
Holliston, MA 01746

_

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?

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



Re: The C locale

2009-09-22 Thread Lapo Luchini
Andy Koppe wrote:
> You've presumably got mintty set to UTF-8, hence mintty's output
> conversion turned ls's ISO-8859-1 "Ť" (i.e. "\xC3\xA4") into "ä".

There never was any ISO-8859-1 "Ť" in the first place, only one
a-umlaut entered in WindowsExplorer (in the expected way) and correctly
interpreted by a UTF8-capable terminal which is doing his job.

Nobody ever intended to write a Latin1 string with the meaning of
"A-ring + currency symbol" which has been translated by chance in a
a-umlaut...

>> you mean that a script sees it as 62C3A468 as opposed as 62E468?
>> Or that actual "bŤh" is shown somewhere?
> 
> Both. For the latter, try it in the default Cygwin console, without
> any locale variables set.

OK, if you consider "what is shown in cmd.exe" as "the real stuff" then
I agree with you.

But cmd.exe isn't even capable of printing the Euro sign (no cygwin
involved, I mean the plain Windows Prompt), I guess there's no hope to
ever seeing in there anything but a very limited output...
(which surprises me a bit: Euro sign is present in CP1252)

I agree with you that the "default console" installed by the default
installation SHOULD be able to show the more common accents at the very
least (àèéìòù in Italy, umaluts and ß in Germany and so on,), but
wouldn't it be possible to offer the user *something better* than plain
limited cmd.exe, in the default installation?

-- 
Lapo Luchini - http://lapo.it/

“There is no reason anyone would want a computer in their home.” (Ken
Olson, founder of DEC, 1977)


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



Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread Christopher Faylor
On Wed, Sep 23, 2009 at 12:11:23AM +0800, "???" wrote:
>Thanks. I want to know how to change this configuration.
>
>I do as follows:
>
>bash-3.2$ /bin/umount /usr/bin
>umount: /usr/bin: Operation not permitted
>
>but i does not work. Any idea?

If you want /usr/bin to point someplace nonstandard, try using the -f -o
override options to mount.  Note that, in Cygwin 1.7 mount is not
permanent.  You'll have to change /etc/fstab if you want permanent
mounts.

I can't think of any way to keep /usr/bin permanently unmounted.

cgf

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



Re: The C locale

2009-09-22 Thread Mark J. Reed
On Tue, Sep 22, 2009 at 12:26 PM, Lapo Luchini wrote:
> There never was any ISO-8859-1 "Ť" in the first place, only one
> a-umlaut entered in WindowsExplorer (in the expected way) and correctly
> interpreted by a UTF8-capable terminal which is doing his job.
>
> Nobody ever intended to write a Latin1 string with the meaning of
> "A-ring + currency symbol" which has been translated by chance in a
> a-umlaut...

Yes, but it's working because you (1) lied about your locale (using C
when your terminal is set to UTF-8) and (2) happen to have your
terminal set to UTF-8, which is how Cygwin happens to be encoding the
character.   It's a big accident and stops working if you were
actually using a non-UTF-8 terminal and locale (hopefully matching
ones).

-- 
Mark J. Reed 

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



Re: The C locale

2009-09-22 Thread Lapo Luchini
Mark J. Reed wrote:
> Yes, but it's working because you (1) lied about your locale (using C
> when your terminal is set to UTF-8) and (2) happen to have your
> terminal set to UTF-8, which is how Cygwin happens to be encoding the
> character.   It's a big accident and stops working if you were
> actually using a non-UTF-8 terminal and locale (hopefully matching
> ones).

I'm very sorry, but I still can't see your point... =(

It's true, "by accident" my terminal is using the more general
ASCII-compatible charset possible (that is, UTF-8) and Cygwin is
currently using that as a default as well, ok.
So LANG=C works essentially because my terminal uses THE SAME charset as
Cygwin uses by default (and not specifically because that's UTF-8).

But OTOH if LANG=C used CP1252 it would only work only if my terminal
"by accident" was using the very same CP1252 and would stop working if I
were using a non-CP1252 terminal and matching locale.
How is this a fundamentally different case?

In the first case I have to match my terminal, but I can see *any*
character really and never get any "surprise".
In the second case I can use default cmd.exe, but I get a crippled
output in many possible usecases.

The main reason I see for using CP1252 (or anything that's the default
CP, CP1252 is just an example) is that cygwin-in-cmd.exe would show the
*same* crippledness shown by the default native WindowsPrompt, so even
if very limited, the user would get the least surprise. And as far a
traffic on cygwin@cygwin.com goes, I see that's a VERY valid issue.

-- 
Lapo Luchini - http://lapo.it/

“Premature optimisation is the root of all evil in programming.” (C. A.
R. Hoare)


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



Re: [1.7] Invalid UTF8 while creating a file -> cannot delete?

2009-09-22 Thread Corinna Vinschen
On Sep 22 17:12, Andy Koppe wrote:
> 2009/9/22 Corinna Vinschen:
> >> Therefore, when converting a UTF-16 Windows filename to the current
> >> charset, 0xDC?? words should be treated like any other UTF-16 word
> >> that can't be represented in the current charset: it should be encoded
> >> as a ^N sequence.
> >
> > How?  Just like the incoming multibyte character didn't represent a valid
> > UTF-8 char, a single U+DCxx value does not represent a valid UTF-16 char.
> > Therefore, the ^N conversion will fail since U+DCxx can't be converted
> > to valid UTF-8.
> 
> True, but that's an implementation issue rather than a design issue,
> i.e. the ^N conversion needs to do the UTF-8 conversion itself rather
> than invoke the __utf8 functions. Shall I look into creating a patch?

Well, sure I'm interested to see that patch (lazy me), but please note
that we need a snail mailed copyright assignment per
http://cygwin.com/assign.txt from you before we can apply any significant
patches.  Sorry for the hassle.

Hmm... maybe it's not that complicated.  The ^N case checks for a valid
UTF-8 lead byte right now.  The U+DCxx case could be handled by
generating (in sys_cp_wcstombs) and recognizing (in sys_cp_mbstowcs) a
non-valid lead byte, like 0xff.

> >> This won't work correctly, because different POSIX filenames will map
> >> to the same Windows filename. For example, the filenames "\xC3\xA4"
> >> (valid UTF-8 for a-umlaut) and "\xC4" (invalid UTF-8 sequence that
> >> represents a-umlaut in 8859-1), will both map to Windows filename
> >> "U+00C4", i.e a-umlaut in UTF-16. Furthermore, after creating a file
> >> called "\xC4", a readdir() would show that file as "\xC3\xA4".
> >
> > Right, but using your above suggestion will also lead to another filename
> > in readdir, it would just be \x0e\xsome\xthing.
> 
> I don't think the suggestion above is directly relevant to the problem
> I tried to highlight here.
> 
> Currently, with UTF-8 filename encodings, "\xC3xA4" turns into U+00C4
> on disk, while "\xC4" turns into U+DCC4, and converting back yields
> the original separate filenames.

Well, right now it doesn't exactly.

> If I understand your proposal
> correctly, both "\xC3\xA4" and "\xC4" would turn into U+00C4, hence
> converting back would yield "\xC3\xA4" for both. This is wrong. Those
> filenames shouldn't be clobbering each other, and a filename shouldn't
> change between open() and readdir(), certainly not without switching
> charset inbetween.

I see your point.  I was more thinking along the lines of how likely
that clobbering is, apart from pathological testcases.

> Having said that, if you did switch charset from UTF-8 e.g. to
> ISO-8859-1, the on-disk U+DCC4 would indeed turn into
> "\x0E\xsome\xthing". However, that issue applies to any UTF-16

You don't have to switch the charset.  Assume you're using any
non-singlebyte charset in which \xC4 is the start of a double- or
multibyte sequence.  open ("\xC4"); close; readdir(); will return
"\x0E\xsome\xthing" on readdir.

Only singlebyte charsets are off the hook.  So, your proposal to switch
to the default ANSI codepage for the C locale would be good for most
western languages, but it would still leave the eastern language users
with double-byte charsets behind.

Note that I'm not as opposed to your proposal to use the ANSI codepage
as before this discussion.  But I would like to see that the solution
works for most eastern language users as well.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat

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



Re: syntax for Cygwin bash invoking Win apps

2009-09-22 Thread Ziser, Jesse
More strange behavior when running Cygwin apps from a Windows prompt.  The 
quoting seems not to follow any rules that I can manage to track down:

The following are normal and expected, given that we discovered that all Cygwin 
apps do some kind of as-yet-undefined partial bash preprocessing on their 
arguments:

C:\> d:\cygwin\bin\echo \
\

C:\> d:\cygwin\bin\echo \\
\\

C:\> d:\cygwin\bin\echo 'a'
a

C:\> d:\cygwin\bin\echo '\a'
\a

The following don't seem to make any sense, even given that Cygwin apps do some 
kind of preprocessing on their arguments:

C:\> d:\cygwin\bin\echo '\'
'

C:\> d:\cygwin\bin\echo '\\'
\

C:\> d:\cygwin\bin\echo '\\\n'
[*** 15-second pause, every time! ***]
\\n

I have now given up on directly invoking Cygwin apps from Windows.  It seems it 
just can't be done with any consistency at all.  Instead, I'm going to try 
generating temporary shell scripts and executing them another way.  However, 
since the above may reveal a bug (especially the 15-second pause), I thought I 
should mention it to you folks.

Thanks,
Jesse



  

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



Re: [1.7] rename/renameat error

2009-09-22 Thread Eric Blake
Eric Blake  byu.net> writes:

> > > > Cygwin 1.7 is
> > > > detecting this situation (which is a step up from 1.5 which did the 
rename
> > > > anyways), but sets errno to EBUSY instead of EINVAL.
> > > 
> > > Thanks for catching.  Feel free to fix the rename function accordingly.
> > 
> > OK, I'll look into it (I don't know how large the patch will be, yet).
> 
> And link("a","f/.") should not create "f" as a regular file, either.  I'm 
still 
> looking at where to patch things.

I've got a patch in testing for both of these issues.  But while looking at 
path.cc, I've noticed a couple of things:

The code doesn't do a very good job of remembering lengths it has already 
seen.  For example, with relative paths, the code in normalize_posix_path does 
cwd.get, then strchr; it seems like since cwd.get already knows how many bytes 
it copied, that a simple API modification would pass that information back to 
the caller so that the caller doesn't have to use strchr to find the end of the 
string.  Anything we can do to avoid rescanning strings of known length will 
provide speedups in path handling.

I'm also wondering whether it is time to finally emulate Linux by requiring 
that when doing pathname resolution of 'a/..', that 'a' actually exist (either 
as a directory or a symlink to directory), instead of silently ignoring that 
part of the string.  Should I go ahead and spend time working up a patch for 
this?

-- 
Eric Blake



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



Re: 1.7 beta vs MSSE-- breaks 'cvs co', apparently on rename()

2009-09-22 Thread Dave Korn
John Hood wrote:
> I'm having a problem with 1.7 beta on Windows XP with the Microsoft
> Security Essentials public beta installed.
> 
> Microsoft Security Essentials Version: 1.0.1500.0
> 
> If I try 'cvs co ' or 'cvs up', CVS will run for a while but
> eventually exit with
> 
> cvs [checkout aborted]: cannot rename file CVS/Entries.Backup to
> CVS/Entries: Permission denied
> 
> (and this is somewhat heinous if you're updating, because if you run an
> update again in this state, CVS loses any usable CVS/Entries file, and
> neither you nor it can tell what you've got in the working dir.  So
> don't try and reproduce this problem on a valuable CVS work dir.)
> 
> If I uncheck "Turn on real-time protection" in the MSSE Settings tab,
> things work OK.
>
> strace indicates that rename() is failing on a Windows error.  There
> seems to be some variation in how far it gets before failing.  Sometimes
> strace makes the problem much rarer and cvs gets much further.  It does
> look more like an MSSE bug than a Cygwin bug, but this seems like the
> best first place to report it.

  This is a well known bug in antivirus scanners etc., and MSSE isn't the only
one.  The problem is that after the original file ("Entries.Backup" in the
above example) has been written the application closes it and then attempts to
rename it in place to its final name.  Unfortunately, the buggy AV scanner has
kept open a handle to the file - after the application believes the file to be
closed - and because there is still an open handle on the file, the rename
operation fails.

  There's not much we can do except add MSSE to the BLODA, and advise people
that disabling the real-time protection is the only known workaround.

cheers,
  DaveK



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



RE: Permission denied (publickey,password,keyboard-interactive).

2009-09-22 Thread Dave M
Hi!

  I am following this:
http://pigtail.net/LRP/printsrv/cygwin-sshd.html
  And I am to the part where I am testing ssh with the following command:
$ ssh localhost -l t...@localhost
Test is a local account and a member of the local admin group.

  I am using the following:
Windows 2003 Server Standard Edition SP2
cygwin DLL v1005.25.0.0

The sshd.log file is empty.
  I am not sure what else you need to help me troubleshoot this.
  I have re-installed this multiple times, this is the closest I got to getting 
this to work.
  My goal is to setup sftp between my Mailgate appliance and this server. 
Mailgate is going to use the following info (and no other):
Server Name:
Server Port:
Server Path:
User Name:
Key:
Key Password:
(optional)
  So, I am not even sure if I need to get this password to work, but I don't 
know any other way to test this.
  Any help would be greatly appreciated.
Dave M

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

Re: The C locale

2009-09-22 Thread Thorsten Kampe
* Lapo Luchini (Tue, 22 Sep 2009 18:26:32 +0200)
> But cmd.exe isn't even capable of printing the Euro sign (no cygwin
> involved, I mean the plain Windows Prompt), I guess there's no hope to
> ever seeing in there anything but a very limited output... (which
> surprises me a bit: Euro sign is present in CP1252)

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

thors...@hombre[c:\Users\thorsten]> echo €
€

thors...@hombre[c:\Users\thorsten]> chcp
Active code page: 437


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



Re: Permission denied (publickey,password,keyboard-interactive).

2009-09-22 Thread Dave Korn
Dave M wrote:
> Hi!
> 
>   I am following this:
> http://pigtail.net/LRP/printsrv/cygwin-sshd.html

  All but the part about not asking questions here if their non-standard
instructions don't work for you!  Heh, moving swiftly along there ...

>   And I am to the part where I am testing ssh with the following command:
> $ ssh localhost -l t...@localhost
> Test is a local account and a member of the local admin group.

  I think the one localhost is enough and the -l option should have the name
only shouldn't it?  So try either

ssh localhost -l test

or

ssh t...@localhost

but don't try adding a host part to the -l argument.  I think that'll do it.

cheers,
  DaveK

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



Re: Permission denied (publickey,password,keyboard-interactive).

2009-09-22 Thread Dave Korn
{ Cc'ing the list back in. ]

Dave M wrote:
> Dave,
>   Where are the standard instructions?
> Dave M

  Ah, now there's a question that's entirely on-topic for the list!  The
standard instructions for any cygwin package are in
/usr/share/doc/; but these are just the standard docs that come
with whichever package it is, and there are notes specific to the Cygwin port
of any given package in /usr/share/doc/Cygwin/.README.

  So the "standard instructions" is to read
/usr/share/doc/Cygwin/openssh.README, and to follow the step-by-step
instructions found there (which more-or-less amounts to "Run the
ssh-host-config script and let it take care of everything for you").  I think
the "Important note for Windows 2003 Server users" right near the start might
be relevant to your problem.

cheers,
  DaveK

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



Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread ︶ㄣ無名氏
I have try the command:
$ mount -f -o binary,user 'f:\cygwin_1.7\usr\bin\' /usr/bin
mount: /usr/bin: Operation not permitted

The -f option does not work well.

I have alse add this line to fstab:
ntfs f:\cygwin_1.7\usr\bin\ /usr/bin binary,user 0 0
It fails, too.

On Wed, Sep 23, 2009 at 00:34, Christopher Faylor <.> wrote:
> On Wed, Sep 23, 2009 at 12:11:23AM +0800, "???" wrote:
>>Thanks. I want to know how to change this configuration.
>>
>>I do as follows:
>>
>>bash-3.2$ /bin/umount /usr/bin
>>umount: /usr/bin: Operation not permitted
>>
>>but i does not work. Any idea?
>
> If you want /usr/bin to point someplace nonstandard, try using the -f -o
> override options to mount.  Note that, in Cygwin 1.7 mount is not
> permanent.  You'll have to change /etc/fstab if you want permanent
> mounts.
>
> I can't think of any way to keep /usr/bin permanently unmounted.
>
> cgf
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>

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



Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread Christopher Faylor
On Wed, Sep 23, 2009 at 11:09:06AM +0800, "???" wrote:
>I have try the command:
>$ mount -f -o binary,user 'f:\cygwin_1.7\usr\bin\' /usr/bin
>mount: /usr/bin: Operation not permitted
>
>The -f option does not work well.

You really do need the -o override option that I mentioned.

See: http://cygwin.com/1.7/cygwin-ug-net/using-utils.html#mount

cgf

>On Wed, Sep 23, 2009 at 00:34, Christopher Faylor <.> wrote:
>>If you want /usr/bin to point someplace nonstandard, try using the -f
>>-o override options to mount.  ??Note that, in Cygwin 1.7 mount is not
>>permanent.  You'll have to change /etc/fstab if you want permanent
>>mounts.

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



Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread ︶ㄣ無名氏
$ mount -f -o override 'f:\cygwin_1.7\usr\bin\' /usr/bin
mount: /usr/bin: Operation not permitted


I have used the `override' option, but the error occurs again.


On Wed, Sep 23, 2009 at 11:21, Christopher Faylor
 wrote:
> On Wed, Sep 23, 2009 at 11:09:06AM +0800, "???" wrote:
>>I have try the command:
>>$ mount -f -o binary,user 'f:\cygwin_1.7\usr\bin\' /usr/bin
>>mount: /usr/bin: Operation not permitted
>>
>>The -f option does not work well.
>
> You really do need the -o override option that I mentioned.
>
> See: http://cygwin.com/1.7/cygwin-ug-net/using-utils.html#mount
>
> cgf
>
>>On Wed, Sep 23, 2009 at 00:34, Christopher Faylor <.> wrote:
>>>If you want /usr/bin to point someplace nonstandard, try using the -f
>>>-o override options to mount.  ??Note that, in Cygwin 1.7 mount is not
>>>permanent.  You'll have to change /etc/fstab if you want permanent
>>>mounts.
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>
>

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



Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread Christopher Faylor
On Wed, Sep 23, 2009 at 11:36:13AM +0800, "???" wrote:
>$ mount -f -o override 'f:\cygwin_1.7\usr\bin\' /usr/bin
>mount: /usr/bin: Operation not permitted
>
>
>I have used the `override' option, but the error occurs again.

Sorry for the misinformation.  You need to add an entry for /usr/bin
to /etc/fstab if you want to override it.  And, on checking the code
that I wrote and didn't remember, you don't have to use the override
option.

The entry that you used in your previous mail was not correctly formatted.

It should be something like:

f:/cygwin_1.7/usr/bin /usr/bin ntfs binary 0 0

cgf

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



Re: how to let cygwin does not mount /bin /usr/bin automaticlly?

2009-09-22 Thread ︶ㄣ無名氏
> The entry that you used in your previous mail was not correctly formatted.
>
> It should be something like:
>
> f:/cygwin_1.7/usr/bin /usr/bin ntfs binary 0 0

That is great. Thanks for your patient.
I have another question. Can the first field of fstab use relative
path. I expect to make the cygwin portable, that is, i need to move it
to somewhere esle without changing the fstab every time.

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



Re: The C locale

2009-09-22 Thread Lapo Luchini
Thorsten Kampe wrote:
> * Lapo Luchini (Tue, 22 Sep 2009 18:26:32 +0200)
>> But cmd.exe isn't even capable of printing the Euro sign (no cygwin
>> involved, I mean the plain Windows Prompt), I guess there's no hope to
>> ever seeing in there anything but a very limited output... (which
>> surprises me a bit: Euro sign is present in CP1252)
> 
> Microsoft Windows [Version 6.1.7600]
> Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
> 
> thors...@hombre[c:\Users\thorsten]> echo €
> €
> 
> thors...@hombre[c:\Users\thorsten]> chcp
> Active code page: 437

OK, so it *can* display it.
But why it does not, when showing a filename?
(which was what I did in the previous message to check)

http://img223.imageshack.us/img223/7821/winprompt.png

I created a file "aà€私.txt" in WinExplorer, and then:

C:\>dir *.txt
 Volume in drive C is Primary
 Volume Serial Number is 8437-B5FC

 Directory of C:\

23/09/2009  06.58 0 aà??.txt
   1 File(s)  0 bytes


Errr actually I can't even reproduce your example.
If I write "echo €" at the prompt I get this:

C:\>echo ?
?

C:\>chcp
Active code page: 437

-- 
Lapo Luchini - http://lapo.it/

“I think, therefore I am… I think.” (Nordom, videogame "Torment", 1999)


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



Re: Write access for BUILTIN\USERS - cygwin privilege escalation vulnerability for Windows 2008 default installation

2009-09-22 Thread Andrew McGill
On Monday 21 September 2009 18:19:35 Dave Korn wrote:
> Andrew McGill wrote:
> >   I can pwn the box from IIS by writing content to
> > these files -- and not much creativity is needed to think of many more:
> 
>   Waittaminnit, are you saying IIS by default lets you write any file you
>  like anywhere on the server and relies on ACLs to save it?  I think you
>  have a bigger problem than the perms on your Cygwin folder!  (Or are you
>  just assuming that a directory traversal attack is likely to be possible
>  anywhere webdav or ftp are turned on?)
You don't get to write quite anywhere -- I'll get to that in a moment.  
However, we do not have the luxury of running only trusted code, so we need 
the box to be locked down.   If you have IIS, install aspshell.asp from 
aspshell.sourceforge.net -- it is really quite entertaining.  pwn ur own box.

> > Feature request: The cygwin installer should set permissions on c:\cygwin
> > to be the same as %windir%, and not trust the operating system to do the
> > "right thing".
> 
>   Seems sensible to me.  I thought MS had gone and locked down the perms on
> the root drives in every OS since XP, in order to defeat the
>  "C:\Program.exe" attack?  I'm really surprised that a default unprivileged
>  user on a server 2k8 system is permitted write access to the drive root,
>  that's just bizarre.
MS did the bare minimum, it seems, and stopped write access to only c:\.  The 
ACL for write permission is defined in c:\ and applies to new directories 
created without due care in c:\ (and d:\ too, as far as I can tell).  This 
means that while you cannot create c:\Program.exe and pwn the desktop, you can 
create 
c:\cygwin\Program.exe
just for fun, and something like 
c:\cygwin\home\Administrator\.ssh\authorised_keys
or
c:\cygwin\usr\local\bin\ls.exe 
to pwn the whole machine.  The permissions in effect are similar to what you 
would have after ... find 'c:\newdir' -type d | xargs -0 chmod 1777 

> Also, this should be emphasised: Cygwin is fundamentally insecure versus
> cross-user privilege/process stealing attacks.
> 
>  Not being part of the OS, we can't prevent user processes from attacking
> each other via manipulating the shared cygheap state.  Effectively this
>  means different users' processes are not isolated from each other, so if
>  for example you're running a service under one of the nt_authority
>  accounts, an unprivileged user logged on to the same box could escalate
>  their privileges to its level.
> 
>   Therefore Cygwin should never be deployed to provide services to
>  untrusted users on a 'net-facing server.  It's just not a real OS(*).
So on the net facing box with untrusted code from hell, is it sufficient to 
deny the default write access to BUILTIN\Users, or is it also necessary to 
deny read access to BUILTIN\Users?  Or is denying read access also 
insufficient, and running cygwin and sshd is a security "fail"?

&:-)

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