mirror of
https://git.openafs.org/openafs.git
synced 2025-01-22 17:00:15 +00:00
Windows: Explorer Shell Extension enhancements
Redesign the AFS Volume Tab to report: . Volume name . Volume ID . Cell . Server . Availability . Quota . Partition Info . Replica Server List Properly handle multiple selections to report the volume info of the parent object and not the actively selected object. When a mount point is selected, display the volume information for the target volume. Remove file server from AFS tab. Modify the AFS tab to better handle multiple selections including mount points. Extend many gui2fs functions to implement a poor man's "follow" option. This really should be done with the pioctl 'literal' capability but this is an improvement. The pioctl modifications will require a major redesign of gui2fs.c and all of the dialogs. Change-Id: Ib009beb81d841fb3bbbd35b1eb0faec2c40eaf4e Reviewed-on: http://gerrit.openafs.org/5531 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
parent
0ca1d92952
commit
59169e0ac7
@ -40,6 +40,8 @@ BOOL CPropACL::PropPageProc( HWND hwnd, UINT uMessage, WPARAM wParam, LPARAM lPa
|
||||
EnablePermChanges(FALSE);
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_ADD), FALSE);
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_COPY), FALSE);
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_CLEAN), FALSE);
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_REMOVE), FALSE);
|
||||
} else {
|
||||
SetDlgItemText(hwnd, IDC_PROP_FILENAME, filenames.GetAt(0));
|
||||
|
||||
|
@ -34,54 +34,72 @@ BOOL CPropFile::PropPageProc( HWND hwnd, UINT uMessage, WPARAM wParam, LPARAM lP
|
||||
|
||||
CString sText;
|
||||
|
||||
if(filenames.GetCount() > 1) {
|
||||
if (filenames.GetCount() <= 0) {
|
||||
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_REMOVEMOUNTPOINT), SW_HIDE);
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_SYMLINK_LABEL), SW_HIDE);
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_MOUNTPOINT_LABEL), SW_HIDE);
|
||||
EnableUnixMode(FALSE);
|
||||
|
||||
}
|
||||
else if(filenames.GetCount() > 1) {
|
||||
// multiple items selected
|
||||
LoadString(sText, IDS_PROP_MULTIPLEITEMS);
|
||||
SetDlgItemText(hwnd, IDC_PROP_TYPE, sText);
|
||||
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_REMOVEMOUNTPOINT), SW_HIDE);
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_SYMLINK_LABEL), SW_HIDE);
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_MOUNTPOINT_LABEL), SW_HIDE);
|
||||
EnableUnixMode(FALSE);
|
||||
|
||||
sText = GetCellName(filenames.GetAt(0), FALSE);
|
||||
m_cellName = sText;
|
||||
SetDlgItemText(hwnd, IDC_PROP_CELL, sText);
|
||||
|
||||
} else {
|
||||
if (m_bIsDir)
|
||||
if (m_bIsMountpoint)
|
||||
LoadString(sText, IDS_PROP_TYPEMOUNTPOINT);
|
||||
else if (m_bIsSymlink)
|
||||
LoadString(sText, IDS_PROP_TYPESYMLINK);
|
||||
else if (m_bIsDir)
|
||||
LoadString(sText, IDS_PROP_TYPEDIRECTORY);
|
||||
else
|
||||
LoadString(sText, IDS_PROP_TYPEFILE);
|
||||
if (m_bIsMountpoint)
|
||||
LoadString(sText, IDS_PROP_TYPEMOUNTPOINT);
|
||||
if (m_bIsSymlink)
|
||||
LoadString(sText, IDS_PROP_TYPESYMLINK);
|
||||
SetDlgItemText(hwnd, IDC_PROP_TYPE, sText);
|
||||
}
|
||||
if (m_bIsMountpoint) {
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_REMOVEMOUNTPOINT), SW_SHOW);
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_SYMLINK_LABEL), SW_HIDE);
|
||||
}
|
||||
if (m_bIsSymlink) {
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_MOUNTPOINT_LABEL), SW_HIDE);
|
||||
}
|
||||
CString user, group, other, suid;
|
||||
GetUnixModeBits(filenames.GetAt(0), user, group, other, suid);
|
||||
ShowUnixMode(user, group, other, suid);
|
||||
|
||||
if (filenames.GetCount() == 1) {
|
||||
SetDlgItemText(hwnd, IDC_PROP_TYPE, sText);
|
||||
|
||||
if (m_bIsMountpoint) {
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_REMOVEMOUNTPOINT), SW_SHOW);
|
||||
}
|
||||
if (!m_bIsSymlink) {
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_SYMLINK_LABEL), SW_HIDE);
|
||||
}
|
||||
if (!m_bIsMountpoint) {
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_MOUNTPOINT_LABEL), SW_HIDE);
|
||||
}
|
||||
|
||||
if (!m_bIsMountpoint && !m_bIsSymlink) {
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_EDIT), SW_HIDE);
|
||||
}
|
||||
|
||||
if (m_bIsSymlink) {
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_REMOVESYMLINK), SW_SHOW);
|
||||
}
|
||||
|
||||
CString user, group, other, suid;
|
||||
EnableUnixMode(TRUE);
|
||||
GetUnixModeBits(filenames.GetAt(0), user, group, other, suid);
|
||||
ShowUnixMode(user, group, other, suid);
|
||||
|
||||
SetDlgItemText(hwnd, IDC_PROP_FILENAME, filenames.GetAt(0));
|
||||
if (!GetFID(filenames.GetAt(0), sText, TRUE))
|
||||
sText = _T("(unknown)");
|
||||
SetDlgItemText(hwnd, IDC_PROP_FID, sText);
|
||||
sText = GetCellName(filenames.GetAt(0));
|
||||
m_cellName = sText;
|
||||
SetDlgItemText(hwnd, IDC_PROP_CELL, sText);
|
||||
sText = GetServer(filenames.GetAt(0));
|
||||
m_volName = sText;
|
||||
SetDlgItemText(hwnd, IDC_PROP_FILESERVER, sText);
|
||||
sText = GetOwner(filenames.GetAt(0));
|
||||
SetDlgItemText(hwnd, IDC_PROP_OWNER, sText);
|
||||
sText = GetGroup(filenames.GetAt(0));
|
||||
SetDlgItemText(hwnd, IDC_PROP_GROUP, sText);
|
||||
|
||||
if (!m_bIsMountpoint && !m_bIsSymlink)
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_EDIT), SW_HIDE);
|
||||
|
||||
if (!m_bIsMountpoint && m_bIsSymlink)
|
||||
ShowWindow(GetDlgItem(m_hwnd, IDC_REMOVESYMLINK), SW_SHOW);
|
||||
|
||||
if (m_bIsMountpoint){
|
||||
sText = GetMountpoint(filenames.GetAt(0));
|
||||
sText = sText.Mid(sText.Find('\t')+1);
|
||||
@ -92,6 +110,10 @@ BOOL CPropFile::PropPageProc( HWND hwnd, UINT uMessage, WPARAM wParam, LPARAM lP
|
||||
sText = sText.Mid(sText.Find('\t')+1);
|
||||
SetDlgItemText(hwnd, IDC_PROP_SMINFO, sText);
|
||||
}
|
||||
|
||||
sText = GetCellName(filenames.GetAt(0));
|
||||
m_cellName = sText;
|
||||
SetDlgItemText(hwnd, IDC_PROP_CELL, sText);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -202,6 +224,25 @@ void CPropFile::ShowUnixMode(const CString& strUserRights, const CString& strGro
|
||||
SendDlgItemMessage(m_hwnd, IDC_ATTR_SUID_VTX, BM_SETCHECK, (strSuidRights.Find(_T("v")) == -1) ? UNCHECKED : CHECKED, 0);
|
||||
}
|
||||
|
||||
void CPropFile::EnableUnixMode(BOOL bEnable)
|
||||
{
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_ATTR_USER_READ), bEnable);
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_ATTR_USER_WRITE), bEnable);
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_ATTR_USER_EXECUTE), bEnable);
|
||||
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_ATTR_GROUP_READ), bEnable);
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_ATTR_GROUP_WRITE), bEnable);
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_ATTR_GROUP_EXECUTE), bEnable);
|
||||
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_ATTR_OTHER_READ), bEnable);
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_ATTR_OTHER_WRITE), bEnable);
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_ATTR_OTHER_EXECUTE), bEnable);
|
||||
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_ATTR_SUID_UID), bEnable);
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_ATTR_SUID_GID), bEnable);
|
||||
EnableWindow(GetDlgItem(m_hwnd, IDC_ATTR_SUID_VTX), bEnable);
|
||||
}
|
||||
|
||||
void CPropFile::MakeUnixModeString(CString& userRights, CString& groupRights, CString& otherRights, CString& suidRights)
|
||||
{
|
||||
userRights.Empty();
|
||||
|
@ -10,6 +10,7 @@ public:
|
||||
virtual BOOL PropPageProc(HWND hwnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
private:
|
||||
void EnableUnixMode(BOOL bEnable);
|
||||
void ShowUnixMode(const CString& strUserRights, const CString& strGroupRights, const CString& strOtherRights, const CString& strSuidRights);
|
||||
void EnablePermChanges(BOOL bEnable);
|
||||
void MakeUnixModeString(CString& userRights, CString& groupRights, CString& otherRights, CString& suidRights);
|
||||
|
@ -27,49 +27,58 @@ BOOL CPropVolume::PropPageProc( HWND hwnd, UINT uMessage, WPARAM wParam, LPARAM
|
||||
sheetpage->SetHwnd(hwnd);
|
||||
AfxSetResourceHandle(m_hInst);
|
||||
|
||||
CString sText;
|
||||
BOOL bFollow = (filenames.GetCount() == 1 && m_bIsMountpoint);
|
||||
|
||||
CString user, group, other, suid;
|
||||
GetUnixModeBits(filenames.GetAt(0), user, group, other, suid);
|
||||
if(filenames.GetCount() >= 1) {
|
||||
CString sText;
|
||||
|
||||
if(filenames.GetCount() > 1) {
|
||||
// multiple items selected
|
||||
LoadString(sText, IDS_PROP_MULTIPLEITEMS);
|
||||
SetDlgItemText(hwnd, IDC_PROP_FILENAME, sText);
|
||||
} else {
|
||||
SetDlgItemText(hwnd, IDC_PROP_VOLUMENAME, filenames.GetAt(0));
|
||||
if (!GetFID(filenames.GetAt(0), sText, TRUE))
|
||||
sText = _T("(unknown)");
|
||||
SetDlgItemText(hwnd, IDC_PROP_FID, sText);
|
||||
sText = GetCellName(filenames.GetAt(0));
|
||||
sText = GetCellName(filenames.GetAt(0), bFollow);
|
||||
SetDlgItemText(hwnd, IDC_PROP_CELL, sText);
|
||||
sText = GetServer(filenames.GetAt(0));
|
||||
sText = GetServer(filenames.GetAt(0), bFollow);
|
||||
SetDlgItemText(hwnd, IDC_PROP_FILESERVER, sText);
|
||||
sText = GetOwner(filenames.GetAt(0));
|
||||
SetDlgItemText(hwnd, IDC_PROP_OWNER, sText);
|
||||
sText = GetGroup(filenames.GetAt(0));
|
||||
SetDlgItemText(hwnd, IDC_PROP_GROUP, sText);
|
||||
|
||||
TCHAR buf[100];
|
||||
CVolInfo volInfo;
|
||||
GetVolumeInfo(filenames.GetAt(0), volInfo);
|
||||
SetDlgItemText(hwnd, IDC_PROP_VOLUMENAME, volInfo.m_strName);
|
||||
sText.Format(_T("%ld bytes"), volInfo.m_nPartSize - volInfo.m_nPartFree);
|
||||
SetDlgItemText(hwnd, IDC_USEDBYTES, sText);
|
||||
StrFormatByteSize64(volInfo.m_nPartSize - volInfo.m_nPartFree, buf, 100);
|
||||
SetDlgItemText(hwnd, IDC_USEDBYTES2, buf);
|
||||
sText.Format(_T("%ld bytes"), volInfo.m_nPartFree);
|
||||
SetDlgItemText(hwnd, IDC_FREEBYTES, sText);
|
||||
StrFormatByteSize64(volInfo.m_nPartFree, buf, 100);
|
||||
SetDlgItemText(hwnd, IDC_FREEBYTES2, buf);
|
||||
sText.Format(_T("%ld bytes"), volInfo.m_nPartSize);
|
||||
SetDlgItemText(hwnd, IDC_TOTALBYTES, sText);
|
||||
StrFormatByteSize64(volInfo.m_nPartSize, buf, 100);
|
||||
SetDlgItemText(hwnd, IDC_TOTALBYTES2, buf);
|
||||
|
||||
if (GetVolumeInfo(filenames.GetAt(0), volInfo, bFollow)) {
|
||||
SetDlgItemText(hwnd, IDC_PROP_VOLUMENAME, volInfo.m_strName);
|
||||
|
||||
SetDlgItemText(hwnd, IDC_PROP_VOLUME_STATUS, volInfo.m_strAvail);
|
||||
|
||||
sText.Format(_T("%u"), volInfo.m_nID);
|
||||
SetDlgItemText(hwnd, IDC_PROP_VID, sText);
|
||||
|
||||
if (volInfo.m_nQuota == 0) {
|
||||
SetDlgItemText(hwnd, IDC_QUOTA_MAX, _T("unlimited"));
|
||||
SetDlgItemText(hwnd, IDC_QUOTA_PERCENT, _T("0.00%"));
|
||||
} else {
|
||||
StrFormatByteSize64(volInfo.m_nQuota*1024, buf, 100);
|
||||
SetDlgItemText(hwnd, IDC_QUOTA_MAX, buf);
|
||||
|
||||
sText.Format(_T("%.2f%%"), ((double)volInfo.m_nUsed / (double)volInfo.m_nQuota) * 100);
|
||||
SetDlgItemText(hwnd, IDC_QUOTA_PERCENT, sText);
|
||||
}
|
||||
|
||||
StrFormatByteSize64(volInfo.m_nUsed*1024, buf, 100);
|
||||
SetDlgItemText(hwnd, IDC_QUOTA_USED, buf);
|
||||
|
||||
StrFormatByteSize64(volInfo.m_nPartSize*1024, buf, 100);
|
||||
SetDlgItemText(hwnd, IDC_PARTITION_SIZE, buf);
|
||||
StrFormatByteSize64(volInfo.m_nPartFree*1024, buf, 100);
|
||||
SetDlgItemText(hwnd, IDC_PARTITION_FREE, buf);
|
||||
|
||||
sText.Format(_T("%.2f%%"), ((double)volInfo.m_nPartFree / (double)volInfo.m_nPartSize) * 100);
|
||||
SetDlgItemText(hwnd, IDC_PARTITION_PERCENT, sText);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetDlgItemText(hwnd, IDC_PROP_VOLUMENAME, volInfo.m_strErrorMsg);
|
||||
}
|
||||
|
||||
// "where is" info
|
||||
CStringArray servers;
|
||||
GetServers(filenames.GetAt(0), servers);
|
||||
GetServers(filenames.GetAt(0), servers, bFollow);
|
||||
int tabstops[1] = {118};
|
||||
SendDlgItemMessage(hwnd, IDC_SERVERS, LB_SETTABSTOPS, 1, (LPARAM)&tabstops);
|
||||
for (int i=0;i<servers.GetCount();++i){
|
||||
|
@ -1215,7 +1215,10 @@ LastComponent(const CString& path)
|
||||
}
|
||||
|
||||
static CString
|
||||
GetCell(const CString & path)
|
||||
GetCell(const CString & path, BOOL bFollow = TRUE);
|
||||
|
||||
static CString
|
||||
GetCell(const CString & path, BOOL bFollow)
|
||||
{
|
||||
char cellname[MAXCELLCHARS];
|
||||
afs_int32 code;
|
||||
@ -1518,7 +1521,7 @@ RemoveMount(CStringArray& files)
|
||||
}
|
||||
|
||||
BOOL
|
||||
GetVolumeInfo(CString strFile, CVolInfo& volInfo)
|
||||
GetVolumeInfo(CString strFile, CVolInfo& volInfo, BOOL bFollow)
|
||||
{
|
||||
LONG code;
|
||||
struct ViceIoctl blob;
|
||||
@ -1526,9 +1529,10 @@ GetVolumeInfo(CString strFile, CVolInfo& volInfo)
|
||||
char *name;
|
||||
char space[AFS_PIOCTL_MAXSIZE];
|
||||
HOURGLASS hourglass;
|
||||
CString strTarget = bFollow ? strFile : Parent(strFile);
|
||||
|
||||
volInfo.m_strFilePath = strFile;
|
||||
volInfo.m_strFileName = StripPath(strFile);
|
||||
volInfo.m_strFilePath = strTarget;
|
||||
volInfo.m_strFileName = StripPath(strTarget);
|
||||
|
||||
/*
|
||||
volInfo.m_strName = "VolumeName";
|
||||
@ -1546,9 +1550,9 @@ GetVolumeInfo(CString strFile, CVolInfo& volInfo)
|
||||
blob.in_size = 0;
|
||||
blob.out = space;
|
||||
|
||||
code = pioctl_T(strFile, VIOCGETVOLSTAT, &blob, 1);
|
||||
code = pioctl_T(strTarget, VIOCGETVOLSTAT, &blob, 1);
|
||||
if (code || blob.out_size < sizeof(*status)) {
|
||||
volInfo.m_strErrorMsg = GetAfsError(errno, strFile);
|
||||
volInfo.m_strErrorMsg = GetAfsError(errno, strTarget);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -1564,6 +1568,25 @@ GetVolumeInfo(CString strFile, CVolInfo& volInfo)
|
||||
volInfo.m_nPartFree = status->PartBlocksAvail;
|
||||
volInfo.m_nDup = -1;
|
||||
|
||||
errno = 0;
|
||||
code = pioctl_T(strTarget, VIOC_PATH_AVAILABILITY, &blob, 1);
|
||||
switch (errno) {
|
||||
case 0:
|
||||
volInfo.m_strAvail =_T("Online");
|
||||
break;
|
||||
case ENXIO:
|
||||
volInfo.m_strAvail = _T("Offline");
|
||||
break;
|
||||
case ENOSYS:
|
||||
volInfo.m_strAvail = _T("Unreachable");
|
||||
break;
|
||||
case EBUSY:
|
||||
volInfo.m_strAvail = _T("Busy");
|
||||
break;
|
||||
default:
|
||||
volInfo.m_strAvail = _T("Unknown");
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1951,13 +1974,13 @@ ListSymlink(CStringArray& files)
|
||||
}
|
||||
|
||||
CString
|
||||
GetCellName( const CString& strPath )
|
||||
GetCellName( const CString& strPath, BOOL bFollow )
|
||||
{
|
||||
return GetCell(strPath);
|
||||
return GetCell(bFollow ? strPath : Parent(strPath));
|
||||
}
|
||||
|
||||
CString
|
||||
GetServer( const CString& strPath )
|
||||
GetServer( const CString& strPath, BOOL bFollow )
|
||||
{
|
||||
LONG code;
|
||||
struct ViceIoctl blob;
|
||||
@ -1969,7 +1992,7 @@ GetServer( const CString& strPath )
|
||||
blob.out = space;
|
||||
memset(space, 0, sizeof(space));
|
||||
|
||||
code = pioctl_T(strPath, VIOCWHEREIS, &blob, 1);
|
||||
code = pioctl_T(bFollow ? strPath : Parent(strPath), VIOCWHEREIS, &blob, 1);
|
||||
if (code) {
|
||||
server=GetAfsError(errno);
|
||||
} else {
|
||||
@ -1987,7 +2010,7 @@ GetServer( const CString& strPath )
|
||||
}
|
||||
|
||||
void
|
||||
GetServers( const CString& strPath, CStringArray& servers )
|
||||
GetServers( const CString& strPath, CStringArray& servers, BOOL bFollow )
|
||||
{
|
||||
LONG code;
|
||||
struct ViceIoctl blob;
|
||||
@ -1998,7 +2021,7 @@ GetServers( const CString& strPath, CStringArray& servers )
|
||||
blob.out = space;
|
||||
memset(space, 0, sizeof(space));
|
||||
|
||||
code = pioctl_T(strPath, VIOCWHEREIS, &blob, 1);
|
||||
code = pioctl_T(bFollow ? strPath : Parent(strPath), VIOCWHEREIS, &blob, 1);
|
||||
if (code) {
|
||||
servers.Add(GetAfsError(errno));
|
||||
} else {
|
||||
@ -2014,7 +2037,7 @@ GetServers( const CString& strPath, CStringArray& servers )
|
||||
}
|
||||
|
||||
CString
|
||||
GetOwner( const CString& strPath )
|
||||
GetOwner( const CString& strPath, BOOL bFollow )
|
||||
{
|
||||
LONG code;
|
||||
struct ViceIoctl blob;
|
||||
@ -2025,13 +2048,13 @@ GetOwner( const CString& strPath )
|
||||
blob.out_size = 2 * sizeof(afs_int32);
|
||||
blob.out = (char *) &owner;
|
||||
|
||||
code = pioctl_T(strPath, VIOCGETOWNER, &blob, 1);
|
||||
code = pioctl_T(bFollow ? strPath : Parent(strPath), VIOCGETOWNER, &blob, 1);
|
||||
if (code == 0 && blob.out_size == 2 * sizeof(afs_int32)) {
|
||||
char oname[PR_MAXNAMELEN] = "(unknown)";
|
||||
char confDir[257];
|
||||
CStringUtf8 cell;
|
||||
|
||||
cell = GetCell(strPath);
|
||||
cell = GetCell(strPath, bFollow);
|
||||
|
||||
/* Go to the PRDB and see if this all number username is valid */
|
||||
cm_GetConfigDir(confDir, sizeof(confDir));
|
||||
@ -2047,7 +2070,7 @@ GetOwner( const CString& strPath )
|
||||
}
|
||||
|
||||
CString
|
||||
GetGroup( const CString& strPath )
|
||||
GetGroup( const CString& strPath, BOOL bFollow )
|
||||
{
|
||||
LONG code;
|
||||
struct ViceIoctl blob;
|
||||
@ -2058,13 +2081,13 @@ GetGroup( const CString& strPath )
|
||||
blob.out_size = 2 * sizeof(afs_int32);
|
||||
blob.out = (char *) &owner;
|
||||
|
||||
code = pioctl_T(strPath, VIOCGETOWNER, &blob, 1);
|
||||
code = pioctl_T(bFollow ? strPath : Parent(strPath), VIOCGETOWNER, &blob, 1);
|
||||
if (code == 0 && blob.out_size == 2 * sizeof(afs_int32)) {
|
||||
char gname[PR_MAXNAMELEN] = "(unknown)";
|
||||
char confDir[257];
|
||||
CStringUtf8 cell;
|
||||
|
||||
cell = GetCell(strPath);
|
||||
cell = GetCell(strPath, bFollow);
|
||||
|
||||
/* Go to the PRDB and see if this all number username is valid */
|
||||
cm_GetConfigDir(confDir, sizeof(confDir));
|
||||
|
@ -28,7 +28,7 @@ BOOL ListMount(CStringArray& files);
|
||||
BOOL MakeMount(const CString& strDir, const CString& strVolName, const CString& strCellName, BOOL bRW);
|
||||
BOOL RemoveMount(CStringArray& files);
|
||||
BOOL RemoveSymlink(const CString& symlink);
|
||||
BOOL GetVolumeInfo(CString strFile, CVolInfo& volInfo);
|
||||
BOOL GetVolumeInfo(CString strFile, CVolInfo& volInfo, BOOL bFollow=TRUE);
|
||||
BOOL SetVolInfo(CVolInfo& volInfo);
|
||||
enum WHICH_CELLS { LOCAL_CELL = 0, SPECIFIC_CELL = 1, ALL_CELLS = 2 };
|
||||
BOOL CheckServers(const CString& strCellName, WHICH_CELLS nCellsToCheck, BOOL bFast);
|
||||
@ -40,11 +40,11 @@ BOOL IsMountPoint(const CString& name);
|
||||
UINT MakeSymbolicLink(const CString&,const CString&);
|
||||
void ListSymbolicLinkPath(CString&,CString&,UINT nlenPath);
|
||||
BOOL ListSymlink(CStringArray& files);
|
||||
CString GetCellName(const CString& strPath);
|
||||
CString GetServer(const CString& strPath);
|
||||
void GetServers( const CString& strPath, CStringArray& servers );
|
||||
CString GetOwner(const CString& strPath);
|
||||
CString GetGroup(const CString& strPath);
|
||||
CString GetCellName(const CString& strPath, BOOL bFollow = TRUE);
|
||||
CString GetServer(const CString& strPath, BOOL bFollow = TRUE);
|
||||
void GetServers( const CString& strPath, CStringArray& servers, BOOL bFollow = TRUE );
|
||||
CString GetOwner(const CString& strPath, BOOL bFollow = TRUE);
|
||||
CString GetGroup(const CString& strPath, BOOL bFollow = TRUE);
|
||||
BOOL GetUnixModeBits(const CString& strPath, CString& user, CString& group, CString& other, CString& suid);
|
||||
void SetUnixModeBits(const CStringArray& files, const CString& user, const CString& group, const CString& other, const CString& suid);
|
||||
CString GetMountpoint(const CString& strPath);
|
||||
|
@ -472,15 +472,13 @@ BEGIN
|
||||
EDITTEXT IDC_PROP_FILENAME,56,25,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "FID:",IDC_STATIC,7,41,15,8
|
||||
EDITTEXT IDC_PROP_FID,56,41,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Cell:",IDC_STATIC,7,89,15,8
|
||||
EDITTEXT IDC_PROP_CELL,56,89,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Fileserver:",IDC_STATIC,7,105,35,8
|
||||
EDITTEXT IDC_PROP_FILESERVER,56,105,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Cell:",IDC_STATIC,7,57,15,8
|
||||
EDITTEXT IDC_PROP_CELL,56,57,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
GROUPBOX "Unix file attributes",IDC_STATIC,7,161,232,75
|
||||
LTEXT "Owner:",IDC_STATIC,7,57,25,8
|
||||
LTEXT "Group:",IDC_STATIC,7,73,23,8
|
||||
EDITTEXT IDC_PROP_OWNER,56,56,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
EDITTEXT IDC_PROP_GROUP,56,73,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Owner:",IDC_STATIC,7,73,25,8
|
||||
LTEXT "Group:",IDC_STATIC,7,89,23,8
|
||||
EDITTEXT IDC_PROP_OWNER,56,73,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
EDITTEXT IDC_PROP_GROUP,56,89,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Symlink:",IDC_SYMLINK_LABEL,7,120,27,8
|
||||
EDITTEXT IDC_PROP_SMINFO,56,120,185,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Mount Point:",IDC_MOUNTPOINT_LABEL,7,121,42,8
|
||||
@ -488,18 +486,18 @@ BEGIN
|
||||
LTEXT "User:",IDC_STATIC,14,175,18,8
|
||||
LTEXT "Group:",IDC_STATIC,14,190,23,8
|
||||
LTEXT "Other:",IDC_STATIC,14,205,22,8
|
||||
CONTROL "Read",IDC_ATTR_USER_READ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,56,174,33,10
|
||||
CONTROL "Read",IDC_ATTR_GROUP_READ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,56,189,33,10
|
||||
CONTROL "Read",IDC_ATTR_OTHER_READ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,56,204,33,10
|
||||
CONTROL "Write",IDC_ATTR_USER_WRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,96,174,33,10
|
||||
CONTROL "Write",IDC_ATTR_GROUP_WRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,96,189,33,10
|
||||
CONTROL "Write",IDC_ATTR_OTHER_WRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,96,204,33,10
|
||||
CONTROL "Execute",IDC_ATTR_USER_EXECUTE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,136,174,33,10
|
||||
CONTROL "Execute",IDC_ATTR_GROUP_EXECUTE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,136,189,33,10
|
||||
CONTROL "Execute",IDC_ATTR_OTHER_EXECUTE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,136,204,33,10
|
||||
CONTROL "SUid",IDC_ATTR_SUID_UID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,56,219,33,10
|
||||
CONTROL "SGid",IDC_ATTR_SUID_GID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,96,219,33,10
|
||||
CONTROL "SVtx",IDC_ATTR_SUID_VTX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,136,219,33,10
|
||||
CONTROL "Read",IDC_ATTR_USER_READ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,56,174,40,10
|
||||
CONTROL "Read",IDC_ATTR_GROUP_READ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,56,189,40,10
|
||||
CONTROL "Read",IDC_ATTR_OTHER_READ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,56,204,40,10
|
||||
CONTROL "Write",IDC_ATTR_USER_WRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,174,40,10
|
||||
CONTROL "Write",IDC_ATTR_GROUP_WRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,189,40,10
|
||||
CONTROL "Write",IDC_ATTR_OTHER_WRITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,204,40,10
|
||||
CONTROL "Execute",IDC_ATTR_USER_EXECUTE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,144,174,40,10
|
||||
CONTROL "Execute",IDC_ATTR_GROUP_EXECUTE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,144,189,40,10
|
||||
CONTROL "Execute",IDC_ATTR_OTHER_EXECUTE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,144,204,40,10
|
||||
CONTROL "SUid",IDC_ATTR_SUID_UID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,56,219,40,10
|
||||
CONTROL "SGid",IDC_ATTR_SUID_GID,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,219,40,10
|
||||
CONTROL "SVtx",IDC_ATTR_SUID_VTX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,144,219,40,10
|
||||
PUSHBUTTON "Edit...",IDC_EDIT,134,137,50,14
|
||||
PUSHBUTTON "Remove Symlink",IDC_REMOVESYMLINK,54,137,73,14,NOT WS_VISIBLE
|
||||
PUSHBUTTON "Remove Mountpoint",IDC_REMOVEMOUNTPOINT,54,137,73,14,NOT WS_VISIBLE
|
||||
@ -530,32 +528,34 @@ END
|
||||
|
||||
IDD_PROPPAGE_VOLUME DIALOGEX 0, 0, 247, 277
|
||||
STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_CAPTION
|
||||
CAPTION "AFS"
|
||||
CAPTION "AFS Volume"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Volume:",IDC_STATIC,7,7,26,8
|
||||
EDITTEXT IDC_PROP_VOLUMENAME,56,7,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "FID:",IDC_STATIC,7,23,15,8
|
||||
EDITTEXT IDC_PROP_FID,56,23,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Owner:",IDC_STATIC,7,39,25,8
|
||||
EDITTEXT IDC_PROP_OWNER,56,38,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Group:",IDC_STATIC,7,55,23,8
|
||||
EDITTEXT IDC_PROP_GROUP,56,55,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Cell:",IDC_STATIC,7,71,15,8
|
||||
EDITTEXT IDC_PROP_CELL,56,71,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Fileserver:",IDC_STATIC,7,87,35,8
|
||||
EDITTEXT IDC_PROP_FILESERVER,56,87,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
PUSHBUTTON "&Flush",IDC_FLUSH,191,103,50,14
|
||||
GROUPBOX "Capacity",IDC_STATIC,9,129,225,68
|
||||
LTEXT "Used Space:",IDC_STATIC,18,144,41,8
|
||||
EDITTEXT IDC_USEDBYTES,76,143,81,14,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
EDITTEXT IDC_USEDBYTES2,157,143,69,14,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Free Space:",IDC_STATIC,18,162,40,8
|
||||
EDITTEXT IDC_FREEBYTES,76,162,81,14,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
EDITTEXT IDC_FREEBYTES2,157,162,69,14,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Total Space:",IDC_STATIC,18,180,41,8
|
||||
EDITTEXT IDC_TOTALBYTES,76,180,81,14,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
EDITTEXT IDC_TOTALBYTES2,157,180,69,14,ES_RIGHT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "VID:",IDC_STATIC,7,23,15,8
|
||||
EDITTEXT IDC_PROP_VID,56,23,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Cell:",IDC_STATIC,7,39,25,8
|
||||
EDITTEXT IDC_PROP_CELL,56,38,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Fileserver:",IDC_STATIC,7,55,40,8
|
||||
EDITTEXT IDC_PROP_FILESERVER,56,55,184,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
LTEXT "Status:",IDC_STATIC,7,72,40,8
|
||||
EDITTEXT IDC_PROP_VOLUME_STATUS,56,72,128,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
PUSHBUTTON "&Flush",IDC_FLUSH,191,71,50,14
|
||||
GROUPBOX "Quota",IDC_STATIC,9,91,225,48
|
||||
LTEXT "Maximum",IDC_STATIC,18,108,40,8
|
||||
LTEXT "Used",IDC_STATIC,97,108,40,8
|
||||
LTEXT "%Used",IDC_STATIC,176,108,40,8
|
||||
EDITTEXT IDC_QUOTA_MAX,18,120,70,14,ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
EDITTEXT IDC_QUOTA_USED,97,120,70,14,ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
EDITTEXT IDC_QUOTA_PERCENT,176,120,40,14,ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
GROUPBOX "Partition Information",IDC_STATIC,9,148,225,48
|
||||
LTEXT "Total Size",IDC_STATIC,18,165,40,8
|
||||
LTEXT "Free Space",IDC_STATIC,97,165,40,8
|
||||
LTEXT "%Free",IDC_STATIC,176,165,40,8
|
||||
EDITTEXT IDC_PARTITION_SIZE,18,177,70,14,ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
EDITTEXT IDC_PARTITION_FREE,97,177,70,14,ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
EDITTEXT IDC_PARTITION_PERCENT,176,177,40,14,ES_LEFT | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER
|
||||
GROUPBOX "Servers",IDC_STATIC,9,200,225,63
|
||||
LISTBOX IDC_SERVERS,16,210,211,44,LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
@ -299,15 +299,15 @@
|
||||
#define IDC_ATTR_OTHER_WRITE2 1107
|
||||
#define IDC_ATTR_OTHER_EXECUTE 1107
|
||||
#define IDC_PROP_SMINFO 1108
|
||||
#define IDC_USEDBYTES 1108
|
||||
#define IDC_QUOTA_MAX 1108
|
||||
#define IDC_SYMLINK_LABEL 1109
|
||||
#define IDC_USEDBYTES2 1109
|
||||
#define IDC_QUOTA_USED 1109
|
||||
#define IDC_MOUNTPOINT_LABEL 1110
|
||||
#define IDC_PROP_VOLUMENAME 1111
|
||||
#define IDC_FREEBYTES 1112
|
||||
#define IDC_TOTALBYTES 1113
|
||||
#define IDC_FREEBYTES2 1114
|
||||
#define IDC_TOTALBYTES2 1115
|
||||
#define IDC_QUOTA_PERCENT 1112
|
||||
#define IDC_PARTITION_SIZE 1113
|
||||
#define IDC_PARTITION_FREE 1114
|
||||
#define IDC_PARTITION_PERCENT 1115
|
||||
#define IDC_COLUMN_4 1116
|
||||
#define IDC_PROP_TYPE 1117
|
||||
#define IDC_BUTTON2 1118
|
||||
@ -316,6 +316,8 @@
|
||||
#define IDC_ATTR_SUID_UID 1121
|
||||
#define IDC_ATTR_SUID_GID 1122
|
||||
#define IDC_ATTR_SUID_VTX 1123
|
||||
#define IDC_PROP_VID 1124
|
||||
#define IDC_PROP_VOLUME_STATUS 1125
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
@ -323,7 +325,7 @@
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 165
|
||||
#define _APS_NEXT_COMMAND_VALUE 32829
|
||||
#define _APS_NEXT_CONTROL_VALUE 1124
|
||||
#define _APS_NEXT_CONTROL_VALUE 1126
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
@ -16,6 +16,7 @@ public:
|
||||
CString m_strFilePath;
|
||||
CString m_strFileName;
|
||||
CString m_strName;
|
||||
CString m_strAvail;
|
||||
unsigned __int64 m_nID;
|
||||
unsigned __int64 m_nQuota;
|
||||
unsigned __int64 m_nNewQuota;
|
||||
|
Loading…
Reference in New Issue
Block a user