#include <afs/auth.h>
#include <WINNT\afsreg.h>
#include <cm.h>
+#include <cm_nls.h>
+#include <osi.h>
+#include <cm_user.h>
+#include <cm_scache.h>
+#include <cm_ioctl.h>
}
#define STRSAFE_NO_DEPRECATE
void Flush(const CStringArray& files)
{
- register LONG code;
+ LONG code;
struct ViceIoctl blob;
int error = 0;
void FlushVolume(const CStringArray& files)
{
- register LONG code;
+ LONG code;
struct ViceIoctl blob;
int error = 0;
void WhichCell(CStringArray& files)
{
- register LONG code;
+ LONG code;
struct ViceIoctl blob;
int error;
CString str;
} else
results.Add(GetAfsError(errno));
} else {
+ space[MAXSIZE - 1] = '\0';
results.Add(Utf8ToCString(space));
}
}
void WSCellCmd()
{
- register LONG code;
+ LONG code;
struct ViceIoctl blob;
HOURGLASS hourglass;
BOOL CheckVolumes()
{
- register LONG code;
+ LONG code;
struct ViceIoctl blob;
blob.in_size = 0;
void SetCacheSizeCmd(LONG nNewCacheSize)
{
- register LONG code;
+ LONG code;
struct ViceIoctl blob;
HOURGLASS hourglass;
void WhereIs(CStringArray& files)
{
- register LONG code;
+ LONG code;
struct ViceIoctl blob;
CStringArray servers;
CStringArray resultFiles;
struct AclEntry *minuslist;
};
-int foldcmp (register char *a, register char *b)
+int foldcmp (char *a, char *b)
{
- register char t, u;
+ char t, u;
while (1) {
t = *a++;
u = *b++;
extern "C" void ZapList(struct AclEntry *alist)
{
- register struct AclEntry *tp, *np;
+ struct AclEntry *tp, *np;
for (tp = alist; tp; tp = np) {
np = tp->next;
return ctr;
}
-char *SkipLine (register char *astr)
+char *SkipLine (char *astr)
{
while (*astr != '\n')
astr++;
}
/* tell if a name is 23 or -45 (digits or minus digits), which are bad names we must prune */
-static int BadName(register char *aname)
+static int BadName(char *aname)
{
- register int tc;
+ int tc;
/* all must be '-' or digit to be bad */
while (tc = *aname++) {
return 1;
}
-CString GetRightsString(register LONG arights, int dfs)
+CString GetRightsString(LONG arights, int dfs)
{
CString str;
struct Acl *EmptyAcl(const CString& strCellName)
{
- register struct Acl *tp;
+ struct Acl *tp;
CStringUtf8 ustrCell(strCellName);
tp = (struct Acl *)malloc(sizeof (struct Acl));
struct Acl *EmptyAcl(char *astr)
{
- register struct Acl *tp;
+ struct Acl *tp;
int junk;
tp = (struct Acl *)malloc(sizeof (struct Acl));
any changes to the list, and 0 otherwise */
extern "C" int CleanAcl(struct Acl *aa)
{
- register struct AclEntry *te, **le, *ne;
+ struct AclEntry *te, **le, *ne;
int changes;
HOURGLASS hourglass;
void CleanACL(CStringArray& names)
{
- register LONG code;
- register struct Acl *ta;
+ LONG code;
+ struct Acl *ta;
struct ViceIoctl blob;
int changes;
// Derived from fs.c's ListAclCmd
BOOL GetRights(const CString& strDir, CStringArray& strNormal, CStringArray& strNegative)
{
- register LONG code;
- register struct Acl *ta;
+ LONG code;
+ struct Acl *ta;
struct ViceIoctl blob;
struct AclEntry *te;
int idf = 0; //getidf(as, parm_listacl_id);
return TRUE;
}
-struct AclEntry *FindList(register struct AclEntry *pCurEntry, const char *entryName)
+struct AclEntry *FindList(struct AclEntry *pCurEntry, const char *entryName)
{
while (pCurEntry) {
if (!foldcmp(pCurEntry->name, PCCHAR(entryName)))
static LONG Convert(const CString& strRights, int dfs, enum rtype *rtypep)
{
- register int i, len;
+ int i, len;
LONG mode;
*rtypep = add; /* add rights, by default */
BOOL SaveACL(const CString& strCellName, const CString& strDir, const CStringArray& normal, const CStringArray& negative)
{
- register LONG code;
+ LONG code;
struct ViceIoctl blob;
struct Acl *pAcl;
LONG rights;
BOOL CopyACL(const CString& strToDir, const CStringArray& normal, const CStringArray& negative, BOOL bClear)
{
- register LONG code;
+ LONG code;
struct ViceIoctl blob;
struct Acl *pToAcl;
int idf = 0; // getidf(as, parm_copyacl_id);
BOOL IsPathInAfs(const CString & strPath)
{
struct ViceIoctl blob;
+ cm_ioctlQueryOptions_t options;
+ cm_fid_t fid;
int code;
HOURGLASS hourglass;
- CString debugBuf;
-
- debugBuf.Format(_T("IsPathInAfs(%s)"), strPath);
- OutputDebugString(debugBuf);
-
- blob.in_size = 0;
- blob.out_size = MAXSIZE;
- blob.out = space;
-
- code = pioctl_T(strPath, VIOC_FILE_CELL_NAME, &blob, 1);
-
- debugBuf.Format(_T("VIOC_FILE_CELL_NAME=%d"), code);
- OutputDebugString(debugBuf);
+ 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, VIOCGETFID, &blob, 1);
if (code) {
if ((errno == EINVAL) || (errno == ENOENT))
return FALSE;
BOOL ListMount(CStringArray& files)
{
- register LONG code;
+ LONG code;
struct ViceIoctl blob;
int error;
last_component.ReleaseBuffer();
if (code == 0) {
- int nPos = strlen(space) - 1;
+ int nPos;
+ space[MAXSIZE - 1] = '\0';
+ nPos = strlen(space) - 1;
if (space[nPos] == '.')
space[nPos] = 0;
mountPoints.Add(ParseMountPoint(StripPath(files[i]), Utf8ToCString(space)));
HOURGLASS hourglass;
- {
- CString str;
- str.Format(_T("IsSymlink(%s)"), strName);
- OutputDebugString(str);
- }
-
CStringUtf8 ustrLast(LastComponent(strName));
CString strParent = Parent(strName);
BOOL IsMountPoint(const CString& path)
{
- register LONG code = 0;
+ LONG code = 0;
struct ViceIoctl blob;
char lsbuffer[1024];
HOURGLASS hourglass;
- {
- CString str;
- str.Format(_T("IsMountPoint(%s)"), path);
- OutputDebugString(str);
- }
-
CString parent = Parent(path);
FixNetbiosPath(parent);
CStringUtf8 mountpoint(LastComponent(path));
- {
- CString str;
-#ifdef UNICODE
- str.Format(_T("last_component=%S"), mountpoint);
-#else
- str.Format(_T("last_component=%s"), mountpoint);
-#endif
- OutputDebugString(str);
- }
-
blob.in_size = mountpoint.GetLength() + 1;
blob.in = mountpoint.GetBuffer();
blob.out = lsbuffer;
*/
BOOL RemoveMount(CStringArray& files)
{
- register LONG code = 0;
+ LONG code = 0;
struct ViceIoctl blob;
BOOL error = FALSE;
CStringArray results;
BOOL GetVolumeInfo(CString strFile, CVolInfo& volInfo)
{
- register LONG code;
+ LONG code;
struct ViceIoctl blob;
struct VolumeStatus *status;
char *name;
blob.out = space;
code = pioctl_T(strFile, VIOCGETVOLSTAT, &blob, 1);
- if (code) {
+ if (code || blob.out_size < sizeof(*status)) {
volInfo.m_strErrorMsg = GetAfsError(errno, strFile);
return FALSE;
}
BOOL SetVolInfo(CVolInfo& volInfo)
{
- register LONG code;
+ LONG code;
struct ViceIoctl blob;
struct VolumeStatus *status;
char *input;
#endif
code = pioctl_T(volInfo.m_strFilePath, VIOCSETVOLSTAT, &blob, 1);
- if (code) {
+ if (code || blob.out_size < sizeof(*status)) {
ShowMessageBox(IDS_SET_QUOTA_ERROR, MB_ICONERROR, IDS_SET_QUOTA_ERROR, GetAfsError(errno, volInfo.m_strName));
return FALSE;
}
BOOL CheckServers(const CString& strCellName, WHICH_CELLS nCellsToCheck, BOOL bFast)
{
- register LONG code;
+ LONG code;
struct ViceIoctl blob;
- register LONG j;
+ LONG j;
LONG temp = 0;
struct afsconf_cell info;
struct chservinfo checkserv;
CString strParent = Parent(strName);
FixNetbiosPath(strParent);
- {
- CString str;
- str.Format(_T("MakeSymbolicLink: name = %s target = %s parent = %s\n"),
- strName, strTarget, strParent);
- OutputDebugString(str);
- }
-
if ( IsFreelanceRoot(strParent) && !IsAdmin() ) {
ShowMessageBox(IDS_NOT_AFS_CLIENT_ADMIN_ERROR, MB_ICONERROR, IDS_NOT_AFS_CLIENT_ADMIN_ERROR);
return FALSE;
BOOL ListSymlink(CStringArray& files)
{
- register LONG code;
+ LONG code;
struct ViceIoctl blob;
int error;
CStringArray symlinks;
ustrLast.ReleaseBuffer();
if (code == 0) {
- CString syml = Utf8ToCString(space);
- int len = syml.GetLength();
+ CString syml;
+ int len;
+
+ space[MAXSIZE - 1] = '\0';
+ syml = Utf8ToCString(space);
+ len = syml.GetLength();
if (len > 0) {
if (syml[len - 1] == _T('.'))