Re: enlarge MAXSYMLINKS

2009-03-10 Thread Denis Excoffier


Again about symbolic links, here is some new inputs:

1) MAXSYMLINKS is no longer used in modern Cygwin's;
   indeed, cygwin-1.5.25-15 uses MAX_LINK_DEPTH and
   cygwin-1.7.0-42 uses SYMLOOP_MAX; both are set to 10
   (in ./winsup/cygwin/path.h for 1.5 and in
   ./winsup/cygwin/include/limits.h for 1.7)

2) whether the filesystem is NTFS or not makes no difference;
   whether the symlinks are created using winsymlinks or nowinsymlinks
   makes no difference

3) the only clean way to make cygwin1.dll accept a chain of 32 symlinks
   (instead of 10) is through recompilation

4) for those interested in not-so-clean items, the following may also  
work

   - for 1.5.25-15 (this one i have tested)
 - cd /usr/bin
 - cat cygwin1.dll | perl -pi -e 's|\203\275\224\371\377\377\012| 
\203\275\224\371\377\377\040|'  cygwin1.dll.new

 - check that cksum before is 3685478250
 - check that cksum after is 3302069714
 - set the appropriate permissions/owners/groups etc. on  
cygwin1.dll.new

 - from outside Cygwin (eg. from Windows):
   - rename cygwin1.dll into cygwin1.dll.old
   - rename cygwin1.dll.new into cygwin1.dll
   - for 1.7.0-42 (this one i have not tested, please report if fails)
 - same as before, with the -e expression replaced by
   -e 's|\203\275\344\355\377\377\013| 
\203\275\344\355\377\377\041|'

   - how you can find these strings yourself:
 1) either
- objdump -d cygwin1.dll
- look for path_conv::check(...)
- search into those 1000 lines, trying to make the names to  
match

- try
 2) or
- recompile with SYMLOOP_MAX set to 10 (result1)
- recompile with SYMLOOP_MAX set to 10 (result2)
- recompile with SYMLOOP_MAX set to 32 (result3)
- compare result1 and result2 to discover the impact of current
  time in the result
- compare result1 and result3 and eliminate the impact of
  current time
- (make sure that compilation options are the same as  
originally)


5) i would also make the following suggestions:

   1) to enhance cygcheck to report whether a given symlink is
  implemented as a Windows'shortcut or as an adhoc Cygwin symlink
  (although this can be seen easily from outside Windows)

   2) to use #define SYMLOOP_MAX 32 in future Cygwin-1.7


Hope this helps,

Denis Excoffier.


--
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: enlarge MAXSYMLINKS

2009-03-10 Thread Corinna Vinschen
On Mar 10 19:05, Denis Excoffier wrote:

 Again about symbolic links, here is some new inputs:

 1) MAXSYMLINKS is no longer used in modern Cygwin's;
indeed, cygwin-1.5.25-15 uses MAX_LINK_DEPTH and
cygwin-1.7.0-42 uses SYMLOOP_MAX; both are set to 10
(in ./winsup/cygwin/path.h for 1.5 and in
./winsup/cygwin/include/limits.h for 1.7)

 2) whether the filesystem is NTFS or not makes no difference;
whether the symlinks are created using winsymlinks or nowinsymlinks
makes no difference

 3) the only clean way to make cygwin1.dll accept a chain of 32 symlinks
(instead of 10) is through recompilation

You know that _POSIX_SYMLOOP_MAX is 8 and using everything beyond that
value is non-portable and just curtesy, right?  Setting SYMLOOP_MAX to
10 is setting it to some arbitrary value = _POSIX_SYMLOOP_MAX which
should be sufficient in all cases.

The MAXSYMLINKS value you're referring to in your original mail has
nothing to do with Cygwin.  You found it in newlib/libc/sys/rtems which
is, no surprise I hope, RTEMS specific.


Corinna

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

--
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/



enlarge MAXSYMLINKS

2009-03-03 Thread Denis Excoffier

Hello,


I use Cygwin 1.5.25-15 (with all packages installed), especially i'm  
currently creating symbolic links. My filesystem is NTFS, my symlinks  
are
created as Windows shortcuts (see winsymlinks in the CYGWIN  
environment variable, though i don't use the variable, but this is the  
default).


I've created 36 links: 0-1, 1-2 ... 8-9, 9-a, a-b, b-c, c-d, up  
to y-z and z-/etc/passwd (a plain file).


Now, `wc q` works as expected (i.e. counts the number of lines/words/ 
chars in /etc/passwd), but `wc p` produces Too many levels of  
symbolic links.
Well it may be that MAXSYMLINKS is defined to be 10 in cygwin kernel.  
But, cygwin-1.5.25-15/newlib/libc/sys/rtems/sys/params.h

indicates #define MAXSYMLINKS 32, a reasonable value.

Where does this value 10 come from? Is there any possibility to  
enlarge the value of 10 in order to reach e.g. 32 as expected?
The value 10 is definitely too low for me, a value 20 (like in  
Solaris) would be better.


Thank in advance for your help,

Denis Excoffier.

--
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/