Skip to content

Commit

Permalink
don't create gufi_client_jail
Browse files Browse the repository at this point in the history
gufi_jail should only exist on the server side
  • Loading branch information
calccrypto committed Nov 2, 2023
1 parent 4cfba13 commit 3aaf2af
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions scripts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ set(TOOLS
ls
stat
stats

jail # gufi_jail is used by sshd_config to prevent commands other than gufi_* from running
)

# python libraries installed into bin for convenience
Expand All @@ -82,32 +80,37 @@ set(LIBRARIES
if (CLIENT)
# add the paramiko source for installing
# keep the trailing / to rename the directory
install(DIRECTORY ${DEP_BUILD_PREFIX}/paramiko-master/ DESTINATION lib/GUFI/paramiko COMPONENT Client)
install(DIRECTORY "${DEP_BUILD_PREFIX}/paramiko-master/" DESTINATION lib/GUFI/paramiko COMPONENT Client)
endif()

foreach(TOOL ${TOOLS})
configure_file(gufi_${TOOL} gufi_${TOOL} @ONLY)
configure_file("gufi_${TOOL}" "gufi_${TOOL}" @ONLY)

install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/gufi_${TOOL} DESTINATION bin COMPONENT Server)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/gufi_${TOOL}" DESTINATION bin COMPONENT Server)

# when running make install, client files will not overwrite server files
# when building, client files WILL NOT overwrite server files
# when installing, client files WILL overwrite server files
if (CLIENT)
configure_file(gufi_client gufi_client_${TOOL} @ONLY)
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/gufi_client_${TOOL}
RENAME gufi_${TOOL}
configure_file("gufi_client" "gufi_client_${TOOL}" @ONLY)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/gufi_client_${TOOL}"
RENAME "gufi_${TOOL}"
DESTINATION bin
COMPONENT Client)
endif()
endforeach()

# gufi_jail is used by sshd_config to prevent commands other than gufi_* from running
configure_file(gufi_jail gufi_jail @ONLY)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/gufi_jail" DESTINATION bin COMPONENT Server)

foreach(LIB ${LIBRARIES})
configure_file(${LIB} ${LIB} @ONLY)
configure_file("${LIB}" "${LIB}" @ONLY)

install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${LIB} DESTINATION bin COMPONENT Server)
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${LIB}" DESTINATION bin COMPONENT Server)

# when running make install, client files will not overwrite server files
if (CLIENT)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LIB} DESTINATION bin COMPONENT Client)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LIB}" DESTINATION bin COMPONENT Client)
endif()
endforeach()

Expand Down

0 comments on commit 3aaf2af

Please sign in to comment.