Skip to content

Commit 4fd3264

Browse files
committed
Use long to avoid issues with large group IDs
Fixes #10
1 parent c7eafd9 commit 4fd3264

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sshfs/SSHFS.Lib/SftpFilesystem.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public sealed class SftpFilesystem : SftpClient, IDokanOperations
6666
private int _userId;
6767
private string _idCommand = "id";
6868
private string _dfCommand = "df";
69-
private HashSet<int> _userGroups;
69+
private HashSet<long> _userGroups;
7070

7171
private readonly int _attributeCacheTimeout;
7272
private readonly int _directoryCacheTimeout;
@@ -107,7 +107,7 @@ protected override void OnConnected()
107107

108108
_userId = GetUserId();
109109
if (_userId != -1)
110-
_userGroups = new HashSet<int>(GetUserGroupsIds());
110+
_userGroups = new HashSet<long>(GetUserGroupsIds());
111111

112112

113113
if (String.IsNullOrWhiteSpace(_rootpath))
@@ -262,12 +262,12 @@ private void CheckAndroid()
262262
}
263263
}
264264
}
265-
private IEnumerable<int> GetUserGroupsIds()
265+
private IEnumerable<long> GetUserGroupsIds()
266266
{
267267
using (var cmd = _sshClient.CreateCommand(_idCommand + " -G ", Encoding.UTF8))
268268
{
269269
cmd.Execute();
270-
return cmd.Result.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(Int32.Parse);
270+
return cmd.Result.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse);
271271
}
272272
}
273273

0 commit comments

Comments
 (0)