Skip to content

Commit 0ec59cf

Browse files
committed
-
1 parent c8770ec commit 0ec59cf

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,18 @@ IF(BUILD_SHARED)
4141
LIST(APPEND LINKTYPES "SHARED")
4242
ENDIF()
4343

44+
IF(WIN32)
45+
SET(WIN32_LIBS -lmpr -lshlwapi)
46+
ENDIF()
47+
4448
FOREACH(LINKTYPE ${LINKTYPES})
4549
ADD_LIBRARY(dirtrav_${LINKTYPE} ${LINKTYPE} src/dirtrav.c)
4650
SET_TARGET_PROPERTIES(dirtrav_${LINKTYPE} PROPERTIES DEFINE_SYMBOL "BUILD_DIRTRAV_DLL")
4751
SET_TARGET_PROPERTIES(dirtrav_${LINKTYPE} PROPERTIES COMPILE_DEFINITIONS "DIRTRAV_GENERATE;${LINKTYPE};${FORCE_OPENDIR_DEF}")
4852
SET_TARGET_PROPERTIES(dirtrav_${LINKTYPE} PROPERTIES OUTPUT_NAME dirtrav)
4953
TARGET_INCLUDE_DIRECTORIES(dirtrav_${LINKTYPE} PRIVATE lib)
5054
IF(WIN32 AND "${LINKTYPE}" STREQUAL "SHARED")
51-
TARGET_LINK_LIBRARIES(dirtrav_${LINKTYPE} -lmpr -lshlwapi)
55+
TARGET_LINK_LIBRARIES(dirtrav_${LINKTYPE} ${WIN32_LIBS})
5256
ENDIF()
5357
SET(ALLTARGETS ${ALLTARGETS} dirtrav_${LINKTYPE})
5458

@@ -59,7 +63,7 @@ FOREACH(LINKTYPE ${LINKTYPES})
5963
SET_TARGET_PROPERTIES(dirtravw_${LINKTYPE} PROPERTIES OUTPUT_NAME dirtravw)
6064
TARGET_INCLUDE_DIRECTORIES(dirtravw_${LINKTYPE} PRIVATE lib)
6165
IF(WIN32 AND "${LINKTYPE}" STREQUAL "SHARED")
62-
TARGET_LINK_LIBRARIES(dirtravw_${LINKTYPE} -lmpr -lshlwapi)
66+
TARGET_LINK_LIBRARIES(dirtravw_${LINKTYPE} ${WIN32_LIBS})
6367
ENDIF()
6468
SET(ALLTARGETS ${ALLTARGETS} dirtravw_${LINKTYPE})
6569
ENDIF()
@@ -69,7 +73,7 @@ ENDFOREACH()
6973

7074
IF(BUILD_TOOLS)
7175
IF(WIN32 AND "${EXELINKTYPE}" STREQUAL "STATIC")
72-
SET(TOOLS_LIBS -lmpr -lshlwapi)
76+
SET(TOOLS_LIBS ${WIN32_LIBS})
7377
ELSE()
7478
SET(TOOLS_LIBS)
7579
ENDIF()

Changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
0.2.24
2+
13
0.2.23
24

35
2025-11-04 Brecht Sanders https://github.com/brechtsanders/

include/dirtrav_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ THE SOFTWARE.
4747
/*! \brief minor version number */
4848
#define DIRTRAV_VERSION_MINOR 2
4949
/*! \brief micro version number */
50-
#define DIRTRAV_VERSION_MICRO 23
50+
#define DIRTRAV_VERSION_MICRO 24
5151
/*! @} */
5252

5353
/*! \cond PRIVATE */

src/dirtrav.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,9 @@ DLL_EXPORT_DIRTRAV DIRCHAR* DIRTRAVFN(prop_get_owner) (DIRTRAVFN(entry) entry)
846846
}
847847
}
848848
if (GetSecurityDescriptorOwner(secdes, &sid, &ownerdefaulted)) {
849-
result = sid_to_username(sid, NULL);
849+
if (((struct DIRTRAVFN(entry_internal_struct)*)entry)->topinfo->remotehost == DIRTRAV_REMOTE_HOST_NOT_SET)
850+
((struct DIRTRAVFN(entry_internal_struct)*)entry)->topinfo->remotehost = DIRTRAVFN(get_remote_server_from_path)(((struct DIRTRAVFN(entry_internal_struct)*)entry)->topinfo->fullpath);
851+
result = sid_to_username(sid, ((struct DIRTRAVFN(entry_internal_struct)*)entry)->topinfo->remotehost);
850852
}
851853
free(secdes);
852854
/////TO DO: GROUP_SECURITY_INFORMATION
@@ -862,9 +864,8 @@ DLL_EXPORT_DIRTRAV DIRCHAR* DIRTRAVFN(prop_get_owner) (DIRTRAVFN(entry) entry)
862864

863865
DLL_EXPORT_DIRTRAV DIRCHAR* DIRTRAVFN(prop_get_remote_server) (DIRTRAVFN(entry) entry)
864866
{
865-
if (((struct DIRTRAVFN(entry_internal_struct)*)entry)->topinfo->remotehost == DIRTRAV_REMOTE_HOST_NOT_SET) {
867+
if (((struct DIRTRAVFN(entry_internal_struct)*)entry)->topinfo->remotehost == DIRTRAV_REMOTE_HOST_NOT_SET)
866868
((struct DIRTRAVFN(entry_internal_struct)*)entry)->topinfo->remotehost = DIRTRAVFN(get_remote_server_from_path)(((struct DIRTRAVFN(entry_internal_struct)*)entry)->topinfo->fullpath);
867-
}
868869
return ((struct DIRTRAVFN(entry_internal_struct)*)entry)->topinfo->remotehost;
869870
}
870871

0 commit comments

Comments
 (0)