From d95d4fcca997ea3f8bfbf4a2c1f22c402446aad8 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 22 Jun 2012 16:51:00 -0400 Subject: [PATCH] Windows: ShellExt display error if symlink not AFS If the path in which a Symlink is to be created is not located within AFS, display an error dialog. Change-Id: I8e4cc6840d56184da7d842cc552d11624cdef89d Reviewed-on: http://gerrit.openafs.org/7643 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/client_exp/gui2fs.cpp | 5 +++++ src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/WINNT/client_exp/gui2fs.cpp b/src/WINNT/client_exp/gui2fs.cpp index 6ba5c531f7..769594aaa7 100644 --- a/src/WINNT/client_exp/gui2fs.cpp +++ b/src/WINNT/client_exp/gui2fs.cpp @@ -1824,6 +1824,11 @@ MakeSymbolicLink(const CString& strName, const CString& strTarget) CString strParent = Parent(strName); FixNetbiosPath(strParent); + if (!IsPathInAfs(strParent)) { + ShowMessageBox(IDS_MAKE_LNK_NOT_AFS_ERROR, MB_ICONERROR, IDS_MAKE_MP_NOT_AFS_ERROR); + return FALSE; + } + if ( IsFreelanceRoot(strParent) && !IsAdmin() ) { ShowMessageBox(IDS_NOT_AFS_CLIENT_ADMIN_ERROR, MB_ICONERROR, IDS_NOT_AFS_CLIENT_ADMIN_ERROR); return FALSE; diff --git a/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc b/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc index a19fd33b75..a7aee11178 100644 --- a/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc +++ b/src/WINNT/client_exp/lang/en_US/afs_shl_ext.rc @@ -770,7 +770,7 @@ BEGIN IDS_UNABLE_TO_SET_CURRENT_DIRECTORY "Unable to set current directory." IDS_CURRENT_DIRECTORY_PATH_TOO_LONG "Current directory pathname is too long." IDS_CLEANACL_ERROR "Error Cleaning ACL(s)." - IDS_MAKE_LNK_NOT_AFS_ERROR "Symlinks must be created within the AFS file system." + IDS_MAKE_LNK_NOT_AFS_ERROR "Symbolic Links must be created within the AFS file system." IDS_NOT_AFS_CLIENT_ADMIN_ERROR "Must be AFS Client Administrators to modify the root.afs volume." IDS_WARNING "Warning" IDS_VOLUME_NOT_IN_CELL_WARNING "Volume %s does not exist in cell %s.\n"