From ebbd415f28dded52d92ed13f66d058707ef3d36f Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sun, 2 May 2010 15:05:40 -0400 Subject: [PATCH] Windows: Prevent cm_FreelanceAddSymlink from creating a symlink ending in a dot Symlinks are ending up in the Freelance root.afs directory that end with a dot. Make sure it cannot happen. LICENSE MIT Change-Id: I8a19c0cf6c2a68c22839e15641206f7e9db8b15b Reviewed-on: http://gerrit.openafs.org/1892 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsd/cm_freelance.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/WINNT/afsd/cm_freelance.c b/src/WINNT/afsd/cm_freelance.c index 083f249362..115daaaa93 100644 --- a/src/WINNT/afsd/cm_freelance.c +++ b/src/WINNT/afsd/cm_freelance.c @@ -1243,6 +1243,10 @@ long cm_FreelanceAddSymlink(char *filename, char *destination, cm_fid_t *fidp) if ( filename[0] == '\0' || destination[0] == '\0' ) return CM_ERROR_INVAL; + /* Do not create the symlink if the name ends in a dot */ + if ( filename[strlen(filename)-1] == '.') + return CM_ERROR_INVAL; + fullname[0] = '\0'; if (filename[0] == '.') { cm_GetCell_Gen(&filename[1], fullname, CM_FLAG_CREATE);