From 61bb3b7f096f3b10075dcb1403879e3ec518276b Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 11 Feb 2008 14:45:43 +0000 Subject: [PATCH] windows-freelance-20080211 LICENSE MIT Do not return BAD_NETWORK_ERROR in response to attempts to create directories or files in the Freelance root.afs volume. Instead return ACCESS_DENIED. BAD_NETWORK_ERROR was being sent because the Freelance cell has no vldb servers. Short circuit the error by testing for freelance in CreateFile and MakeDir --- src/WINNT/afsd/cm_vnodeops.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/WINNT/afsd/cm_vnodeops.c b/src/WINNT/afsd/cm_vnodeops.c index 690be84..d4d135e 100644 --- a/src/WINNT/afsd/cm_vnodeops.c +++ b/src/WINNT/afsd/cm_vnodeops.c @@ -2687,6 +2687,16 @@ long cm_Create(cm_scache_t *dscp, char *namep, long flags, cm_attr_t *attrp, return CM_ERROR_ATSYS; } +#ifdef AFS_FREELANCE_CLIENT + /* Freelance root volume does not hold files */ + if (cm_freelanceEnabled && + dscp->fid.cell==AFS_FAKE_ROOT_CELL_ID && + dscp->fid.volume==AFS_FAKE_ROOT_VOL_ID ) + { + return CM_ERROR_NOACCESS; + } +#endif /* AFS_FREELANCE_CLIENT */ + /* before starting the RPC, mark that we're changing the file data, so * that someone who does a chmod will know to wait until our call * completes. @@ -2837,6 +2847,16 @@ long cm_MakeDir(cm_scache_t *dscp, char *namep, long flags, cm_attr_t *attrp, return CM_ERROR_ATSYS; } +#ifdef AFS_FREELANCE_CLIENT + /* Freelance root volume does not hold subdirectories */ + if (cm_freelanceEnabled && + dscp->fid.cell==AFS_FAKE_ROOT_CELL_ID && + dscp->fid.volume==AFS_FAKE_ROOT_VOL_ID ) + { + return CM_ERROR_NOACCESS; + } +#endif /* AFS_FREELANCE_CLIENT */ + /* before starting the RPC, mark that we're changing the directory * data, so that someone who does a chmod on the dir will wait until * our call completes. -- 1.9.4