/*
- * $Id: directory.c,v 1.26 2002-01-19 21:29:55 jmarcus Exp $
+ * $Id: directory.c,v 1.27 2002-03-13 19:29:14 srittau Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
}
}
- /* check for illegal bits */
- if (!wincheck(vol, path))
- return AFPERR_PARAM;
-
upath = mtoupath(vol, path);
+ /* check for illegal bits in the unix filename */
+ if (!wincheck(vol, upath))
+ return AFPERR_PARAM;
+
if ((vol->v_flags & AFPVOL_NOHEX) && strchr(upath, '/'))
return AFPERR_PARAM;
/*
- * $Id: file.c,v 1.40 2002-03-05 02:04:46 jmarcus Exp $
+ * $Id: file.c,v 1.41 2002-03-13 19:29:17 srittau Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
return( AFPERR_NOOBJ );
}
- if (!wincheck(vol, path))
- return AFPERR_PARAM;
-
upath = mtoupath(vol, path);
+ /* check for illegal bits in the unix filename */
+ if (!wincheck(vol, upath))
+ return AFPERR_PARAM;
+
if ((vol->v_flags & AFPVOL_NOHEX) && strchr(upath, '/'))
return AFPERR_PARAM;
/* all this stuff is so that we can unwind a failed operation
* properly. */
-err_temp_to_dest:
+
/* rename dest to temp */
renamefile(upath, temp, temp, vol_noadouble(vol));
of_rename(vol, curdir, upath, curdir, temp);
/*
- * $Id: file.h,v 1.4 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: file.h,v 1.5 2002-03-13 19:29:17 srittau Exp $
*
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
char em_type[ 4 ];
};
-extern struct extmap *extmap;
extern struct extmap *getextmap __P((const char *));
extern int getfilparams __P((struct vol *, u_int16_t, char *,
/*
- * $Id: filedir.c,v 1.23 2002-03-05 01:41:36 srittau Exp $
+ * $Id: filedir.c,v 1.24 2002-03-13 19:29:17 srittau Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
if (strcmp(path, ibuf) == 0)
return AFP_OK;
- /* check for illegal characters */
- if (!wincheck(vol, ibuf))
- return AFPERR_PARAM;
-
newpath = obj->oldtmp;
strcpy( newpath, mtoupath(vol, ibuf ));
+ /* check for illegal characters in the unix filename */
+ if (!wincheck(vol, newpath))
+ return AFPERR_PARAM;
+
if ((vol->v_flags & AFPVOL_NOHEX) && strchr(newpath, '/'))
return AFPERR_PARAM;
newname[ plen ] = '\0';
}
- /* check for illegal characters */
- if (!wincheck(vol, newname))
- return AFPERR_PARAM;
-
upath = mtoupath(vol, newname);
+ /* check for illegal characters in the unix filename */
+ if (!wincheck(vol, upath))
+ return AFPERR_PARAM;
+
if ((vol->v_flags & AFPVOL_NOHEX) && strchr(upath, '/'))
return AFPERR_PARAM;
/*
- * $Id: volume.c,v 1.22 2002-02-06 21:58:50 jmarcus Exp $
+ * $Id: volume.c,v 1.23 2002-03-13 19:29:17 srittau Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
if ((len = strlen(path)) == 0)
return 0;
- /* leading or trailing whitespaces are not allowed */
- if ((*path == ' ') || (path[len-1] == ' '))
+ /* leading or trailing whitespaces are not allowed, carriage returns
+ * and probably other whitespace is okay, tabs are not allowed
+ */
+ if ((path[0] == ' ') || (path[len-1] == ' '))
return 0;
/* certain characters are not allowed */
/*
- * $Id: volume.h,v 1.9 2002-01-02 21:14:10 srittau Exp $
+ * $Id: volume.h,v 1.10 2002-03-13 19:29:17 srittau Exp $
*
* Copyright (c) 1990,1994 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#define AFPVOL_UUPPERMLOWER (AFPVOL_MTOUUPPER | AFPVOL_UTOMLOWER)
#define AFPVOL_ULOWERMUPPER (AFPVOL_MTOULOWER | AFPVOL_UTOMUPPER)
-#define MSWINDOWS_BADCHARS "\\/<>*?|\""
+#define MSWINDOWS_BADCHARS ":\t\\/<>*?|\""
#define MSWINDOWS_CODEPAGE "maccode.iso8859-1"
int wincheck(struct vol *vol, const char *path);