Skip to content

Commit

Permalink
add port to host
Browse files Browse the repository at this point in the history
  • Loading branch information
marevol committed May 23, 2024
1 parent 3425bca commit c11f0e7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/jcifs/smb/SmbFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -2219,6 +2219,9 @@ private void processAces ( ACE[] aces, boolean resolveSids ) throws IOException
int ai;

if ( resolveSids ) {
if (this.fileLocator.getDfsPath() == null && this.fileLocator.getPort() != -1) {
server = server + ":" + this.fileLocator.getPort();
}
SID[] sids = new SID[aces.length];
for ( ai = 0; ai < aces.length; ai++ ) {
sids[ ai ] = aces[ ai ].getSID();
Expand Down Expand Up @@ -2333,6 +2336,9 @@ public SID getOwnerUser ( boolean resolve ) throws IOException {

String server = this.fileLocator.getServerWithDfs();
if ( resolve ) {
if (this.fileLocator.getDfsPath() == null && this.fileLocator.getPort() != -1) {
server = server + ":" + this.fileLocator.getPort();
}
try {
ownerUser.resolve(server, getContext());
}
Expand Down Expand Up @@ -2365,6 +2371,9 @@ public SID getOwnerGroup ( boolean resolve ) throws IOException {

String server = this.fileLocator.getServerWithDfs();
if ( resolve ) {
if (this.fileLocator.getDfsPath() == null && this.fileLocator.getPort() != -1) {
server = server + ":" + this.fileLocator.getPort();
}
try {
ownerGroup.resolve(server, getContext());
}
Expand All @@ -2386,6 +2395,9 @@ public ACE[] getShareSecurity ( boolean resolveSids ) throws IOException {
String server = this.fileLocator.getServerWithDfs();
ACE[] aces;
MsrpcShareGetInfo rpc = new MsrpcShareGetInfo(server, th.getConnectedShare());
if (this.fileLocator.getDfsPath() == null && this.fileLocator.getPort() != -1) {
server = server + ":" + this.fileLocator.getPort();
}
try ( DcerpcHandle handle = DcerpcHandle.getHandle("ncacn_np:" + server + "[\\PIPE\\srvsvc]", getContext()) ) {
handle.sendrecv(rpc);
if ( rpc.retval != 0 ) {
Expand Down

0 comments on commit c11f0e7

Please sign in to comment.