From: Jeffrey Altman Date: Thu, 7 May 2009 15:53:14 +0000 (+0000) Subject: windows-shellext-path-in-afs-20090507 X-Git-Tag: openafs-devel-1_5_61~345 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=621719905806a5883be5a17ca1af0d1929b874e3 windows-shellext-path-in-afs-20090507 LICENSE MIT FIXES 124742 Change the PathInAfs test to use VIOCGETFID instead of VIOC_GET_CELL_NAME. VIOCGETFID permits a literal test of the specified object. This is needed for testing the validity of a symlink to a msdfs: or non-existent path. Otherwise, the AFS Shell Extension context menu will not be displayed. --- diff --git a/src/WINNT/client_exp/gui2fs.cpp b/src/WINNT/client_exp/gui2fs.cpp index 40ada97..c0c01f3 100644 --- a/src/WINNT/client_exp/gui2fs.cpp +++ b/src/WINNT/client_exp/gui2fs.cpp @@ -39,6 +39,11 @@ extern "C" { #include #include #include +#include +#include +#include +#include +#include } #define STRSAFE_NO_DEPRECATE @@ -1154,6 +1159,8 @@ CString ParseSymlink(const CString strFile, CString strSymlink) BOOL IsPathInAfs(const CString & strPath) { struct ViceIoctl blob; + cm_ioctlQueryOptions_t options; + cm_fid_t fid; int code; HOURGLASS hourglass; @@ -1163,13 +1170,18 @@ BOOL IsPathInAfs(const CString & strPath) debugBuf.Format(_T("IsPathInAfs(%s)"), strPath); OutputDebugString(debugBuf); - blob.in_size = 0; - blob.out_size = MAXSIZE; - blob.out = space; + memset(&options, 0, sizeof(options)); + options.size = sizeof(options); + options.field_flags |= CM_IOCTL_QOPTS_FIELD_LITERAL; + options.literal = 1; + blob.in_size = options.size; /* no variable length data */ + blob.in = &options; + blob.out_size = sizeof(cm_fid_t); + blob.out = (char *) &fid; - code = pioctl_T(strPath, VIOC_FILE_CELL_NAME, &blob, 1); + code = pioctl_T(strPath, VIOCGETFID, &blob, 1); - debugBuf.Format(_T("VIOC_FILE_CELL_NAME=%d"), code); + debugBuf.Format(_T("VIOCGETFID=%d"), code); OutputDebugString(debugBuf); if (code) { @@ -1627,7 +1639,7 @@ BOOL IsSymlink(const CString& strName) HOURGLASS hourglass; - { + { CString str; str.Format(_T("IsSymlink(%s)"), strName); OutputDebugString(str);