/*
- * $Id: directory.c,v 1.111 2009-10-16 00:15:53 didg Exp $
+ * $Id: directory.c,v 1.112 2009-10-22 12:35:38 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
LOG(log_error, logtype_afpd, "adddir: malloc: %s", strerror(errno) );
return NULL;
}
- if ((size_t)-1 == convert_string_allocate((utf8_encoding())?CH_UTF8_MAC:vol->v_maccharset, CH_UCS2, path->m_name, strlen(path->m_name), &cdir->d_m_name_ucs2)) {
+ if ((size_t)-1 == convert_string_allocate((utf8_encoding())?CH_UTF8_MAC:vol->v_maccharset, CH_UCS2, path->m_name, strlen(path->m_name), (char **)&cdir->d_m_name_ucs2)) {
LOG(log_error, logtype_afpd, "Couldn't set UCS2 name for %s", name);
cdir->d_m_name_ucs2 = NULL;
}
int getdirparams(const struct vol *vol,
u_int16_t bitmap, struct path *s_path,
struct dir *dir,
- char *buf, int *buflen )
+ char *buf, size_t *buflen )
{
struct maccess ma;
struct adouble ad;
/*
- * $Id: directory.h,v 1.31 2009-10-15 12:08:22 didg Exp $
+ * $Id: directory.h,v 1.32 2009-10-22 12:35:38 franklahm Exp $
*
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
extern mode_t mtoumode (struct maccess *);
extern void utommode (struct stat *, struct maccess *);
extern int getdirparams (const struct vol *, u_int16_t, struct path *,
- struct dir *, char *, int *);
+ struct dir *, char *, size_t *);
extern int setdirparams (const struct vol *, struct path *, u_int16_t, char *);
extern int renamedir (const struct vol *, char *, char *, struct dir *,
struct dir *, char *);
/*
- $Id: extattrs.c,v 1.8 2009-10-20 09:53:42 franklahm Exp $
+ $Id: extattrs.c,v 1.9 2009-10-22 12:35:38 franklahm Exp $
Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
struct adouble ad, *adp = NULL;
struct ofork *of;
char *uname, *FinderInfo;
- static int buf_valid = 0, attrbuflen = 0;
char emptyFinderInfo[32] = { 0 };
+ static int buf_valid = 0;
+ static size_t attrbuflen = 0;
+
*rbuflen = 0;
ibuf += 2;
/*
- * $Id: fork.c,v 1.66 2009-10-22 05:09:56 didg Exp $
+ * $Id: fork.c,v 1.67 2009-10-22 12:35:38 franklahm Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
int afp_getforkparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
{
struct ofork *ofork;
- int buflen, ret;
+ int ret;
u_int16_t ofrefnum, bitmap;
-
+ size_t buflen;
ibuf += 2;
memcpy(&ofrefnum, ibuf, sizeof( ofrefnum ));
ibuf += sizeof( ofrefnum );
/*
- * $Id: uam.c,v 1.29 2009-10-15 11:39:48 didg Exp $
+ * $Id: uam.c,v 1.30 2009-10-22 12:35:38 franklahm Exp $
*
* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT.
/* if we need to maintain a connection, this is how we do it.
* because an action pointer gets passed in, we can stream
* DSI connections */
-int uam_afp_read(void *handle, char *buf, int *buflen,
+int uam_afp_read(void *handle, char *buf, size_t *buflen,
int (*action)(void *, void *, const int))
{
AFPObj *obj = handle;
/*
- * $Id: uam_auth.h,v 1.6 2009-10-13 22:55:37 didg Exp $
+ * $Id: uam_auth.h,v 1.7 2009-10-22 12:35:38 franklahm Exp $
*
* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
* All Rights Reserved. See COPYRIGHT.
union {
struct {
int (*login) (void *, struct passwd **,
- char *, int, char *, int *);
+ char *, int, char *, size_t *);
int (*logincont) (void *, struct passwd **, char *,
- int, char *, int *);
+ int, char *, size_t *);
void (*logout) (void);
int (*login_ext) (void *, char *, struct passwd **,
- char *, int, char *, int *);
+ char *, int, char *, size_t *);
} uam_login;
int (*uam_changepw) (void *, char *, struct passwd *, char *,
- int, char *, int *);
+ int, char *, size_t *);
} u;
struct uam_obj *uam_prev, *uam_next;
};
extern int asp_attention (ASP, AFPUserBytes);
extern int asp_getrequest (ASP);
extern int asp_cmdreply (ASP, int);
-extern int asp_wrtcont (ASP, char *, int *);
+extern int asp_wrtcont (ASP, char *, size_t *);
#define asp_wrtreply(a,b) asp_cmdreply((a), (b))
extern void asp_kill (int);
extern int asp_tickle (ASP, const u_int8_t, struct sockaddr_at *);
extern int uam_checkuser (const struct passwd *);
/* afp helper functions */
-extern int uam_afp_read (void *, char *, int *,
+extern int uam_afp_read (void *, char *, size_t *,
int (*)(void *, void *, const int));
extern int uam_afpserver_option (void *, const int, void *, size_t *);
#ifdef TRU64
#define VFS_FUNC_ARGS_REMOVE_ACL const struct vol *vol, const char *path, int dir
#define VFS_FUNC_VARS_REMOVE_ACL vol, path, dir
-#define VFS_FUNC_ARGS_EA_GETSIZE const struct vol * restrict vol, char * restrict rbuf, int * restrict rbuflen, const char * restrict uname, int oflag, const char * restrict attruname
+#define VFS_FUNC_ARGS_EA_GETSIZE const struct vol * restrict vol, char * restrict rbuf, size_t * restrict rbuflen, const char * restrict uname, int oflag, const char * restrict attruname
#define VFS_FUNC_VARS_EA_GETSIZE vol, rbuf, rbuflen, uname, oflag, attruname
-#define VFS_FUNC_ARGS_EA_GETCONTENT const struct vol * restrict vol, char * restrict rbuf, int * restrict rbuflen, const char * restrict uname, int oflag, const char * restrict attruname, int maxreply
+#define VFS_FUNC_ARGS_EA_GETCONTENT const struct vol * restrict vol, char * restrict rbuf, size_t * restrict rbuflen, const char * restrict uname, int oflag, const char * restrict attruname, int maxreply
#define VFS_FUNC_VARS_EA_GETCONTENT vol, rbuf, rbuflen, uname, oflag, attruname, maxreply
-#define VFS_FUNC_ARGS_EA_LIST const struct vol * restrict vol, char * restrict attrnamebuf, int * restrict buflen, const char * restrict uname, int oflag
+#define VFS_FUNC_ARGS_EA_LIST const struct vol * restrict vol, char * restrict attrnamebuf, size_t * restrict buflen, const char * restrict uname, int oflag
#define VFS_FUNC_VARS_EA_LIST vol, attrnamebuf, buflen, uname, oflag
#define VFS_FUNC_ARGS_EA_SET const struct vol * restrict vol, const char * restrict uname, const char * restrict attruname, const char * restrict ibuf, size_t attrsize, int oflag
/*
- * $Id: asp_write.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ * $Id: asp_write.c,v 1.4 2009-10-22 12:35:39 franklahm Exp $
*
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
#define memmove(a, b, n) bcopy((b), (a), (n))
#endif /* BSD || BSD4_3 */
-int asp_wrtcont(ASP asp, char *buf, int *buflen)
+int asp_wrtcont(ASP asp, char *buf, size_t *buflen)
{
struct iovec iov[ ASP_MAXPACKETS ];
struct atp_block atpb;
/*
- $Id: locking.c,v 1.2 2009-10-14 01:38:29 didg Exp $
+ $Id: locking.c,v 1.3 2009-10-22 12:35:39 franklahm Exp $
Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
GNU General Public License for more details.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <unistd.h>
#include <fcntl.h>
#include <atalk/util.h>
/*
- $Id: ea.c,v 1.8 2009-10-21 17:41:45 franklahm Exp $
+ $Id: ea.c,v 1.9 2009-10-22 12:35:39 franklahm Exp $
Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
*
* Copies EA size into rbuf in network order. Increments *rbuflen +4.
*/
-int get_easize(const struct vol * restrict vol,
- char * restrict rbuf,
- int * restrict rbuflen,
- const char * restrict uname,
- int oflag,
- const char * restrict attruname)
+int get_easize(VFS_FUNC_ARGS_EA_GETSIZE)
{
int ret = AFPERR_MISC, count = 0;
uint32_t uint32;
*
* Copies EA into rbuf. Increments *rbuflen accordingly.
*/
-int get_eacontent(const struct vol * restrict vol,
- char * restrict rbuf,
- int * restrict rbuflen,
- const char * restrict uname,
- int oflag,
- const char * restrict attruname,
- int maxreply)
+int get_eacontent(VFS_FUNC_ARGS_EA_GETCONTENT)
{
int ret = AFPERR_MISC, count = 0, fd = -1;
uint32_t uint32;
* Copies names of all EAs of uname as consecutive C strings into rbuf.
* Increments *buflen accordingly.
*/
-int list_eas(const struct vol * restrict vol,
- char * restrict attrnamebuf,
- int * restrict buflen,
- const char * restrict uname,
- int oflag)
+int list_eas(VFS_FUNC_ARGS_EA_LIST)
{
int count = 0, attrbuflen = *buflen, ret = AFP_OK, len;
char *buf = attrnamebuf;