Re: Too many level of symbolic links (still have problem with sbmfs network drives)

2022-03-14 Thread Corinna Vinschen
Hi Takashi,

On Mar 12 11:36, Takashi Yano wrote:
> The problem was that GetDosDeviceW() returns unexpected string such as
> "\Device\Mup\DfsClient\;Z:0003fb89\dfsserver\dfs\linkname"
> for the mounted UNC path:
> "\??\UNC\fileserver\share"
> 
> This happens when UNC path for DFS is mounted to a drive with drive letter.
> 
> Therefore, I would like to propose a workaround patch attached.
> I will appreciate any comments for the patch.

> - goto file_not_symlink; /* fallback */
> -   remlen -= 2;
> + goto file_not_symlink; /* fallback (not expected) */

Why do you add this "not expected:?  It doesn't add any info, afaics,
and just makes the patch bigger.

> +   remlen -= 2; /* Two L'\0' */
>  
> if (remote[remlen - 1] == L'\\')
>   remlen--;
> @@ -3535,20 +3535,26 @@ restart:
> UNICODE_STRING rpath;
> RtlInitCountedUnicodeString (, remote,
>  remlen * sizeof (WCHAR));
> +   int uncp_len = wcslen (ro_u_uncp.Buffer) - 1;

You don't have to call wcslen, you already have the length in the
UNICODE_STRING.  I'd also constify this:

  const USHORT uncp_len = ro_u_uncp.Length / sizeof (WCHAR)
  - 1;

Other than that, looks good to me.


Thanks,
Corinna

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


Re: Too many level of symbolic links (still have problem with sbmfs network drives)

2022-03-11 Thread Takashi Yano
On Fri, 11 Mar 2022 18:09:30 +0900
Takashi Yano wrote:
> On Wed, 9 Mar 2022 09:58:40 +0900
> Takashi Yano wrote:
> > On Tue, 8 Mar 2022 19:16:29 -0500
> > Philippe Debanne wrote:
> > > Yes OK, you can send me the DLL, I will test it in the next couple of 
> > > days.
> > 
> > Thanks for your cooperation. I have just sent you cygwin1.dll
> > for the test. Please test it and let me know the resulted
> > debug messages.
> 
> I received the debug messages and understood what is happening.
> I added a workaround for this issue, so could you please test
> the cygwin1.dll with the workaround patch, and let me know the
> test result?
> 
> I will send you the patched cygwin1.dll shortly.

The problem was that GetDosDeviceW() returns unexpected string such as
"\Device\Mup\DfsClient\;Z:0003fb89\dfsserver\dfs\linkname"
for the mounted UNC path:
"\??\UNC\fileserver\share"
.

This happens when UNC path for DFS is mounted to a drive with drive letter.

Therefore, I would like to propose a workaround patch attached.
I will appreciate any comments for the patch.

-- 
Takashi Yano 


0001-Cygwin-path-Add-fallback-for-DFS-mounted-drive.patch
Description: Binary data

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


Re: Too many level of symbolic links (still have problem with sbmfs network drives)

2022-03-11 Thread Takashi Yano
On Wed, 9 Mar 2022 09:58:40 +0900
Takashi Yano wrote:
> On Tue, 8 Mar 2022 19:16:29 -0500
> Philippe Debanne wrote:
> > Yes OK, you can send me the DLL, I will test it in the next couple of days.
> 
> Thanks for your cooperation. I have just sent you cygwin1.dll
> for the test. Please test it and let me know the resulted
> debug messages.

I received the debug messages and understood what is happening.
I added a workaround for this issue, so could you please test
the cygwin1.dll with the workaround patch, and let me know the
test result?

I will send you the patched cygwin1.dll shortly.

-- 
Takashi Yano 

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


Re: Too many level of symbolic links (still have problem with sbmfs network drives)

2022-03-08 Thread Takashi Yano
On Tue, 8 Mar 2022 19:16:29 -0500
Philippe Debanne wrote:
> Yes OK, you can send me the DLL, I will test it in the next couple of days.

Thanks for your cooperation. I have just sent you cygwin1.dll
for the test. Please test it and let me know the resulted
debug messages.

-- 
Takashi Yano 

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


Re: Too many level of symbolic links (still have problem with sbmfs network drives)

2022-03-08 Thread Philippe Debanne via Cygwin

Yes OK, you can send me the DLL, I will test it in the next couple of days.

Le 2022-03-08 à 18:52, Takashi Yano a écrit :

On Mon, 7 Mar 2022 10:32:51 -0500
Philippe Debanne wrote:

sorry for the delay.  I don't manage the server in question, so I can't
call 'smbstatus' directly on it, but if it's any indication of version
there is a path :

/usr/share/doc/samba-4.10.16/

Also, attached is the /etc/smb.conf file, somewhat redacted.

I installed CentOS 7 with samba 4.10.16, and add following
section to /etc/samba/smb.conf which is similar section to
one in smb.conf you had provided.

[share$]
comment = Test share
path = /home/share
valud users = @yano
force group = yano
read only = No
create mask 0660
directory mask = 0770

However, the issue could not be reproduced.

If I provide you with a test cygwin1.dll that outputs debug
messages, can you try it out?



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


Re: Too many level of symbolic links (still have problem with sbmfs network drives)

2022-03-08 Thread Takashi Yano
On Mon, 7 Mar 2022 10:32:51 -0500
Philippe Debanne wrote:
> sorry for the delay.  I don't manage the server in question, so I can't 
> call 'smbstatus' directly on it, but if it's any indication of version 
> there is a path :
> 
> /usr/share/doc/samba-4.10.16/
> 
> Also, attached is the /etc/smb.conf file, somewhat redacted.

I installed CentOS 7 with samba 4.10.16, and add following
section to /etc/samba/smb.conf which is similar section to
one in smb.conf you had provided.

[share$]
comment = Test share
path = /home/share
valud users = @yano
force group = yano
read only = No
create mask 0660
directory mask = 0770

However, the issue could not be reproduced.

If I provide you with a test cygwin1.dll that outputs debug
messages, can you try it out?

-- 
Takashi Yano 

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


Re: Too many level of symbolic links (still have problem with sbmfs network drives)

2022-03-07 Thread Philippe Debanne via Cygwin

Hello Takashi,

sorry for the delay.  I don't manage the server in question, so I can't 
call 'smbstatus' directly on it, but if it's any indication of version 
there is a path :


/usr/share/doc/samba-4.10.16/

Also, attached is the /etc/smb.conf file, somewhat redacted.

Thanks for looking at this.
Philippe

Le 2022-03-07 à 10:14, Takashi Yano a écrit :

On Sat, 5 Mar 2022 11:23:26 +0900
Takashi Yano wrote:

On Fri, 4 Mar 2022 15:43:55 -0500
Philippe Debanne wrote:

Hello Cygwin list,

Since updating my Cygwin installation to the latest version, I am having
the problem of  "Too many levels of symbolic links" on certain network
drives, that was reported in other threads.  I tried replacing the
'cygwin1.dll' with the snapshots from 2022-02-17 and 2022-03-01
(x86_64).  This did fix the link to one of the network drives, but not
others.

The mount command in my case gives :

$ mount
D:/cygwin64/bin on /usr/bin type ntfs (binary,auto)
D:/cygwin64/lib on /usr/lib type ntfs (binary,auto)
D:/cygwin64 on / type ntfs (binary,auto)
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto)
L: on /cygdrive/l type cifs (binary,posix=0,user,noumount,auto)
V: on /cygdrive/v type smbfs (binary,posix=0,user,noumount,auto)
W: on /cygdrive/w type smbfs (binary,posix=0,user,noumount,auto)
X: on /cygdrive/x type smbfs (binary,posix=0,user,noumount,auto)
Y: on /cygdrive/y type smbfs (binary,posix=0,user,noumount,auto)
Z: on /cygdrive/z type smbfs (binary,posix=0,user,noumount,auto)

No problem with the local drives, and I can now go to the X: drive
thanks to the recent snapshot.  But not other 'smbfs' ones :

$ cd Z:
-bash: cd: Z:: Too many levels of symbolic links

Any ideas what could be wrong ?  It seems to be limited to certain SAMBA
shared drives.

Hmm, could you please provide the version of samba
and hopefully smb.conf file if possible?

I cannot reproduce your problem, so more information
is required.

[global]
   workgroup = DEPT
   realm = DEPT.INSTITUTION.CA
   netbios name = groupefs
   security = ADS
   idmap config *:backend = tdb
   idmap config *:range = 200-999
   idmap config DEPT:backend = ad
   idmap config DEPT:schema_mode = rfc2307
   idmap config DEPT:range = 1000-99
   idmap config DEPT : read only = yes
   winbind nss info = rfc2307
   client signing = yes
   client use spnego = yes
   kerberos method = secrets and keytab
   log file = /var/log/samba/%m.log
   log level = 1 auth:5 winbind:5
   host msdfs = Yes
   hosts allow = 127.0.0.1 (...)
   hosts deny = 0.0.0.0/0
   smb ports = 445 139
   acl allow execute always = True

[homes]
comment = homes
read only = No
directory mask = 0700
force directory mode = 0700
create mask = 0600
force create mode = 0600
browseable = No
valid users = %S
follow symlinks = yes

[recherche$]
   comment = Section Groupe Recherche
   path = /store2/share/recherche
   valid users = @recherche
   #force user = root
   force group = recherche
   read only = No
   create mask = 0660
   directory mask = 0770

[recherche2$]
   comment = Section Groupe Recherche2
   path = /store2/share/recherche2
   valid users = @recherche,user1,user2,user3
   #force user = root
   force group = recherche
   read only = No
   create mask = 0660
   directory mask = 0770


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


Re: Too many level of symbolic links (still have problem with sbmfs network drives)

2022-03-07 Thread Takashi Yano
On Sat, 5 Mar 2022 11:23:26 +0900
Takashi Yano wrote:
> On Fri, 4 Mar 2022 15:43:55 -0500
> Philippe Debanne wrote:
> > Hello Cygwin list,
> > 
> > Since updating my Cygwin installation to the latest version, I am having 
> > the problem of  "Too many levels of symbolic links" on certain network 
> > drives, that was reported in other threads.  I tried replacing the  
> > 'cygwin1.dll' with the snapshots from 2022-02-17 and 2022-03-01 
> > (x86_64).  This did fix the link to one of the network drives, but not 
> > others.
> > 
> > The mount command in my case gives :
> > 
> > $ mount
> > D:/cygwin64/bin on /usr/bin type ntfs (binary,auto)
> > D:/cygwin64/lib on /usr/lib type ntfs (binary,auto)
> > D:/cygwin64 on / type ntfs (binary,auto)
> > C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
> > D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto)
> > L: on /cygdrive/l type cifs (binary,posix=0,user,noumount,auto)
> > V: on /cygdrive/v type smbfs (binary,posix=0,user,noumount,auto)
> > W: on /cygdrive/w type smbfs (binary,posix=0,user,noumount,auto)
> > X: on /cygdrive/x type smbfs (binary,posix=0,user,noumount,auto)
> > Y: on /cygdrive/y type smbfs (binary,posix=0,user,noumount,auto)
> > Z: on /cygdrive/z type smbfs (binary,posix=0,user,noumount,auto)
> > 
> > No problem with the local drives, and I can now go to the X: drive 
> > thanks to the recent snapshot.  But not other 'smbfs' ones :
> > 
> > $ cd Z:
> > -bash: cd: Z:: Too many levels of symbolic links
> > 
> > Any ideas what could be wrong ?  It seems to be limited to certain SAMBA 
> > shared drives.
> 
> Hmm, could you please provide the version of samba
> and hopefully smb.conf file if possible?

I cannot reproduce your problem, so more information
is required.

-- 
Takashi Yano 

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


Re: Too many level of symbolic links (still have problem with sbmfs network drives)

2022-03-04 Thread Takashi Yano
On Fri, 4 Mar 2022 15:43:55 -0500
Philippe Debanne wrote:
> Hello Cygwin list,
> 
> Since updating my Cygwin installation to the latest version, I am having 
> the problem of  "Too many levels of symbolic links" on certain network 
> drives, that was reported in other threads.  I tried replacing the  
> 'cygwin1.dll' with the snapshots from 2022-02-17 and 2022-03-01 
> (x86_64).  This did fix the link to one of the network drives, but not 
> others.
> 
> The mount command in my case gives :
> 
> $ mount
> D:/cygwin64/bin on /usr/bin type ntfs (binary,auto)
> D:/cygwin64/lib on /usr/lib type ntfs (binary,auto)
> D:/cygwin64 on / type ntfs (binary,auto)
> C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)
> D: on /cygdrive/d type ntfs (binary,posix=0,user,noumount,auto)
> L: on /cygdrive/l type cifs (binary,posix=0,user,noumount,auto)
> V: on /cygdrive/v type smbfs (binary,posix=0,user,noumount,auto)
> W: on /cygdrive/w type smbfs (binary,posix=0,user,noumount,auto)
> X: on /cygdrive/x type smbfs (binary,posix=0,user,noumount,auto)
> Y: on /cygdrive/y type smbfs (binary,posix=0,user,noumount,auto)
> Z: on /cygdrive/z type smbfs (binary,posix=0,user,noumount,auto)
> 
> No problem with the local drives, and I can now go to the X: drive 
> thanks to the recent snapshot.  But not other 'smbfs' ones :
> 
> $ cd Z:
> -bash: cd: Z:: Too many levels of symbolic links
> 
> Any ideas what could be wrong ?  It seems to be limited to certain SAMBA 
> shared drives.

Hmm, could you please provide the version of samba
and hopefully smb.conf file if possible?

-- 
Takashi Yano 

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


RE: too many level of symbolic links

2022-02-17 Thread Andreas Heckel
> Of Corinna Vinschen
> Sent: Thursday, February 17, 2022 1:00 PM
> To: cygwin@cygwin.com
> Subject: Re: too many level of symbolic links
> 
> On Feb 17 11:41, Andreas Heckel wrote:
> >
> >
> > > Of Oskar Skog
> > > Sent: Thursday, February 17, 2022 11:05 AM
> > > Subject: Re: too many level of symbolic links
> > >
> > > On 2022-02-17 10:46, Andreas Heckel wrote:
> > > > I have a network drive mapped like
> > > > //hostname/share --> p:
> > > >
> > > > When trying to access the network drive via cygwin I get:
> > > >
> > > > $ ls /cygdrive/p
> > > > ls: cannot open directory '/cygdrive/p': Too many levels of symbolic
> > > links
> > > >
> > > > Accessing the network share directly via //hostname/share works as
> > > normal.
> > > >
> > > > I have been using cygwin a long time but this is the first time this
> > > happens. My machine and our servers got recently updated, so I can't
> > > really pinpoint the reason for this behaviour now.
> > > >
> > > > Any hints / advice how to resolve this?
> > > >
> > > > Cheers, Andreas
> > > >
> > > >
> > >
> > >
> > >
> > > Are you running the newest version of Cygwin (3.3.4)?, there have been
> > > a similar issue to yours in the previous version that should have been
> > > fixed.
> > >
> >
> > Just to be certain, I ran setup again. There are currently no pending
> updates.
> >
> > 3472k 2022/01/31 C:\cygwin64\bin\cygwin1.dll
> > Cygwin DLL version info:
> > DLL version: 3.3.4
> 
> There was YA patch necessary to fix this regression
> https://sourceware.org/git/?p=newlib-
> cygwin.git;a=commitdiff;h=71d5490a3a2d
> and that patch isn't in 3.3.4.  Please test the latest (2022-02-17)
> Cygwin snapshot DLL from https://cygwin.com/snapshots/

Confirmed, snapshot version of cygwin1.dll solves the issue. :)

Thanks,
Andreas




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


Re: too many level of symbolic links

2022-02-17 Thread Corinna Vinschen
On Feb 17 11:41, Andreas Heckel wrote:
> 
> 
> > Of Oskar Skog
> > Sent: Thursday, February 17, 2022 11:05 AM
> > Subject: Re: too many level of symbolic links
> > 
> > On 2022-02-17 10:46, Andreas Heckel wrote:
> > > I have a network drive mapped like
> > > //hostname/share --> p:
> > >
> > > When trying to access the network drive via cygwin I get:
> > >
> > > $ ls /cygdrive/p
> > > ls: cannot open directory '/cygdrive/p': Too many levels of symbolic
> > links
> > >
> > > Accessing the network share directly via //hostname/share works as
> > normal.
> > >
> > > I have been using cygwin a long time but this is the first time this
> > happens. My machine and our servers got recently updated, so I can't
> > really pinpoint the reason for this behaviour now.
> > >
> > > Any hints / advice how to resolve this?
> > >
> > > Cheers, Andreas
> > >
> > >
> > 
> > 
> > 
> > Are you running the newest version of Cygwin (3.3.4)?, there have been
> > a similar issue to yours in the previous version that should have been
> > fixed.
> > 
> 
> Just to be certain, I ran setup again. There are currently no pending updates.
> 
> 3472k 2022/01/31 C:\cygwin64\bin\cygwin1.dll
> Cygwin DLL version info:
> DLL version: 3.3.4

There was YA patch necessary to fix this regression
https://sourceware.org/git/?p=newlib-cygwin.git;a=commitdiff;h=71d5490a3a2d
and that patch isn't in 3.3.4.  Please test the latest (2022-02-17)
Cygwin snapshot DLL from https://cygwin.com/snapshots/


Thanks,
Corinna

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


RE: too many level of symbolic links

2022-02-17 Thread Andreas Heckel



> Of Oskar Skog
> Sent: Thursday, February 17, 2022 11:05 AM
> Subject: Re: too many level of symbolic links
> 
> On 2022-02-17 10:46, Andreas Heckel wrote:
> > I have a network drive mapped like
> > //hostname/share --> p:
> >
> > When trying to access the network drive via cygwin I get:
> >
> > $ ls /cygdrive/p
> > ls: cannot open directory '/cygdrive/p': Too many levels of symbolic
> links
> >
> > Accessing the network share directly via //hostname/share works as
> normal.
> >
> > I have been using cygwin a long time but this is the first time this
> happens. My machine and our servers got recently updated, so I can't
> really pinpoint the reason for this behaviour now.
> >
> > Any hints / advice how to resolve this?
> >
> > Cheers, Andreas
> >
> >
> 
> 
> 
> Are you running the newest version of Cygwin (3.3.4)?, there have been
> a similar issue to yours in the previous version that should have been
> fixed.
> 

Just to be certain, I ran setup again. There are currently no pending updates.

3472k 2022/01/31 C:\cygwin64\bin\cygwin1.dll
Cygwin DLL version info:
DLL version: 3.3.4




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


Re: too many level of symbolic links

2022-02-17 Thread Oskar Skog

On 2022-02-17 10:46, Andreas Heckel wrote:

I have a network drive mapped like
//hostname/share --> p:

When trying to access the network drive via cygwin I get:

$ ls /cygdrive/p
ls: cannot open directory '/cygdrive/p': Too many levels of symbolic links

Accessing the network share directly via //hostname/share works as normal.

I have been using cygwin a long time but this is the first time this happens. 
My machine and our servers got recently updated, so I can't really pinpoint the 
reason for this behaviour now.

Any hints / advice how to resolve this?

Cheers, Andreas






Are you running the newest version of Cygwin (3.3.4)?, there have been
a similar issue to yours in the previous version that should have been
fixed.

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