/*
- * $Id: desktop.c,v 1.33 2006-03-14 06:15:45 didg Exp $
+ * $Id: desktop.c,v 1.36 2006-09-19 01:35:45 didg Exp $
*
* See COPYRIGHT.
*
static const u_char ucreator[] = { 0, 0, 0, 0 };/* { 'U', 'N', 'I', 'X' };*/
static const u_char utype[] = { 0, 0, 0, 0 };/* { 'T', 'E', 'X', 'T' };*/
static const short usize = 256;
+
+#if 0
static const u_char uicon[] = {
0x1F, 0xFF, 0xFC, 0x00, 0x10, 0x00, 0x06, 0x00,
0x10, 0x00, 0x05, 0x00, 0x10, 0x00, 0x04, 0x80,
0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0,
0x1F, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFF, 0xF0,
};
+#endif
int afp_geticoninfo(obj, ibuf, ibuflen, rbuf, rbuflen )
AFPObj *obj _U_;
memcpy( &bsize, ibuf, sizeof( bsize ));
bsize = ntohs( bsize );
+#if 0
if ( memcmp( fcreator, ucreator, sizeof( ucreator )) == 0 &&
memcmp( ftype, utype, sizeof( utype )) == 0 &&
itype == 1 &&
*rbuflen = bsize;
return( AFP_OK );
}
+#endif
if ( iconopen( vol, fcreator, O_RDONLY, 0 ) < 0) {
return( AFPERR_NOITEM );
char *mtoupath(const struct vol *vol, char *mpath, cnid_t did, int utf8)
{
- static char upath[ MAXPATHLEN + 1];
+ static char upath[ MAXPATHLEN + 2]; /* for convert_charset dest_len parameter +2 */
char *m, *u;
size_t inplen;
size_t outlen;
LOG(log_error, logtype_afpd, "conversion from %s to %s for %s failed.", (utf8)?"UTF8-MAC":vol->v_maccodepage, vol->v_volcodepage, mpath);
return NULL;
}
- upath[outlen] = 0;
#ifdef DEBUG
LOG(log_debug, logtype_afpd, "mtoupath: '%s':'%s'", mpath, upath);
*/
char *utompath(const struct vol *vol, char *upath, cnid_t id, int utf8)
{
- static char mpath[ MAXPATHLEN + 1];
+ static char mpath[ MAXPATHLEN + 2]; /* for convert_charset dest_len parameter +2 */
char *m, *u;
u_int16_t flags = CONV_IGNORE | CONV_UNESCAPEHEX;
size_t outlen;
goto utompath_error;
}
- mpath[outlen] = 0;
if (!(flags & CONV_REQMANGLE))
flags = 0;
else
struct ofork *of;
char *upath;
int isadir;
-
+ int clen;
upath = path->u_name;
isadir = path_isadir(path);
return( AFPERR_NOITEM );
}
- *rbuf++ = ad_getentrylen( adp, ADEID_COMMENT );
- memcpy( rbuf, ad_entry( adp, ADEID_COMMENT ), ad_getentrylen( adp, ADEID_COMMENT ));
- *rbuflen = ad_getentrylen( adp, ADEID_COMMENT ) + 1;
+ clen = min( ad_getentrylen( adp, ADEID_COMMENT ), 128 ); /* OSX only use 128, greater kill Adobe CS2 */
+ *rbuf++ = clen;
+ memcpy( rbuf, ad_entry( adp, ADEID_COMMENT ), clen);
+ *rbuflen = clen + 1;
ad_close_metadata( adp);
return( AFP_OK );