/*
- * $Id: volume.c,v 1.15 2001-12-03 05:03:38 jmarcus Exp $
+ * $Id: volume.c,v 1.17 2002-01-03 17:49:38 sibaz Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
#endif /* HAVE_CONFIG_H */
#include <sys/time.h>
-#include <sys/syslog.h>
+#include <syslog.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
ad_close(&ad, ADFLAGS_HF);
return( AFP_OK );
}
+
+
+int wincheck(struct vol *vol, const char *path)
+{
+ int len;
+
+ if (!(vol->v_flags & AFPVOL_MSWINDOWS))
+ return 1;
+
+ /* empty paths are not allowed */
+ if ((len = strlen(path)) == 0)
+ return 0;
+
+ /* leading or trailing whitespaces are not allowed */
+ if ((*path == ' ') || (path[len-1] == ' '))
+ return 0;
+
+ /* certain characters are not allowed */
+ if (strpbrk(path, MSWINDOWS_BADCHARS))
+ return 0;
+
+ /* everything else is okay */
+ return 1;
+}