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 <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
Jeffrey Altman 2012-06-22 16:51:00 -04:00
parent 349c1f5338
commit d95d4fcca9
2 changed files with 6 additions and 1 deletions

View File

@ -1824,6 +1824,11 @@ MakeSymbolicLink(const CString& strName, const CString& strTarget)
CString strParent = Parent(strName); CString strParent = Parent(strName);
FixNetbiosPath(strParent); 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() ) { if ( IsFreelanceRoot(strParent) && !IsAdmin() ) {
ShowMessageBox(IDS_NOT_AFS_CLIENT_ADMIN_ERROR, MB_ICONERROR, IDS_NOT_AFS_CLIENT_ADMIN_ERROR); ShowMessageBox(IDS_NOT_AFS_CLIENT_ADMIN_ERROR, MB_ICONERROR, IDS_NOT_AFS_CLIENT_ADMIN_ERROR);
return FALSE; return FALSE;

View File

@ -770,7 +770,7 @@ BEGIN
IDS_UNABLE_TO_SET_CURRENT_DIRECTORY "Unable to set current directory." IDS_UNABLE_TO_SET_CURRENT_DIRECTORY "Unable to set current directory."
IDS_CURRENT_DIRECTORY_PATH_TOO_LONG "Current directory pathname is too long." IDS_CURRENT_DIRECTORY_PATH_TOO_LONG "Current directory pathname is too long."
IDS_CLEANACL_ERROR "Error Cleaning ACL(s)." 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_NOT_AFS_CLIENT_ADMIN_ERROR "Must be AFS Client Administrators to modify the root.afs volume."
IDS_WARNING "Warning" IDS_WARNING "Warning"
IDS_VOLUME_NOT_IN_CELL_WARNING "Volume %s does not exist in cell %s.\n" IDS_VOLUME_NOT_IN_CELL_WARNING "Volume %s does not exist in cell %s.\n"