From 3a43b6ca05ec2b8f0494f8619a82d25204b7b457 Mon Sep 17 00:00:00 2001 From: Frank Lahm Date: Thu, 3 Jan 2013 13:27:20 +0100 Subject: [PATCH] Fix compiler diagnostics --- bin/ad/ad_cp.c | 28 ++----------- bin/ad/ad_mv.c | 32 --------------- bin/ad/ad_set.c | 3 +- bin/misc/fce.c | 14 +------ etc/afpd/acls.c | 13 +++--- etc/afpd/afp_dsi.c | 6 +-- etc/afpd/catsearch.c | 3 +- etc/afpd/desktop.c | 15 +++---- etc/afpd/dircache.c | 1 - etc/afpd/directory.c | 3 +- etc/afpd/fce_api.c | 6 +-- etc/afpd/file.c | 1 - etc/afpd/fork.c | 6 +-- etc/afpd/hash.c | 15 ++++--- etc/afpd/main.c | 4 +- etc/afpd/status.c | 9 ++-- etc/afpd/volume.c | 3 -- etc/cnid_dbd/cmd_dbd_scanvol.c | 54 ++---------------------- etc/cnid_dbd/cnid_metad.c | 47 ++------------------- etc/cnid_dbd/main.c | 4 +- etc/netatalk/netatalk.c | 6 +-- etc/uams/uams_dhx_pam.c | 18 ++++---- etc/uams/uams_gss.c | 2 - libatalk/acl/cache.c | 2 - libatalk/acl/ldap.c | 2 +- libatalk/acl/uuid.c | 1 - libatalk/adouble/ad_conv.c | 3 +- libatalk/adouble/ad_flush.c | 3 -- libatalk/adouble/ad_lock.c | 1 - libatalk/adouble/ad_open.c | 6 ++- libatalk/adouble/ad_read.c | 1 - libatalk/adouble/ad_write.c | 2 - libatalk/bstring/bstradd.c | 3 +- libatalk/cnid/tdb/cnid_tdb_add.c | 8 ++-- libatalk/cnid/tdb/cnid_tdb_delete.c | 4 +- libatalk/cnid/tdb/cnid_tdb_get.c | 2 +- libatalk/cnid/tdb/cnid_tdb_lookup.c | 6 +-- libatalk/cnid/tdb/cnid_tdb_open.c | 4 +- libatalk/cnid/tdb/cnid_tdb_resolve.c | 2 +- libatalk/cnid/tdb/cnid_tdb_update.c | 10 ++--- libatalk/dsi/dsi_getsess.c | 2 +- libatalk/iniparser/iniparser.c | 1 - libatalk/tdb/io.c | 1 - libatalk/tdb/tdb_private.h | 17 ++------ libatalk/unicode/util_unistr.c | 12 +++--- libatalk/util/netatalk_conf.c | 61 +++++++++++++--------------- libatalk/util/server_child.c | 3 +- libatalk/util/server_ipc.c | 2 - libatalk/util/server_lock.c | 2 - libatalk/vfs/unix.c | 3 -- libatalk/vfs/vfs.c | 2 - 51 files changed, 122 insertions(+), 337 deletions(-) diff --git a/bin/ad/ad_cp.c b/bin/ad/ad_cp.c index ef995ce8..239936dc 100644 --- a/bin/ad/ad_cp.c +++ b/bin/ad/ad_cp.c @@ -95,36 +95,14 @@ static volatile sig_atomic_t alarmed; static int badcp, rval; static int ftw_options = FTW_MOUNT | FTW_PHYS | FTW_ACTIONRETVAL; -static char *netatalk_dirs[] = { - ".AppleDouble", - ".AppleDB", - ".AppleDesktop", - NULL -}; - /* Forward declarations */ static int copy(const char *fpath, const struct stat *sb, int tflag, struct FTW *ftwbuf); static int ftw_copy_file(const struct FTW *, const char *, const struct stat *, int); static int ftw_copy_link(const struct FTW *, const char *, const struct stat *, int); static int setfile(const struct stat *, int); -static int preserve_dir_acls(const struct stat *, char *, char *); +// static int preserve_dir_acls(const struct stat *, char *, char *); static int preserve_fd_acls(int, int); -/* - Check for netatalk special folders e.g. ".AppleDB" or ".AppleDesktop" - Returns pointer to name or NULL. -*/ -static const char *check_netatalk_dirs(const char *name) -{ - int c; - - for (c=0; netatalk_dirs[c]; c++) { - if ((strcmp(name, netatalk_dirs[c])) == 0) - return netatalk_dirs[c]; - } - return NULL; -} - static void upfunc(void) { did = pdid; @@ -953,9 +931,9 @@ static int preserve_fd_acls(int source_fd, int dest_fd) return (0); } +#if 0 static int preserve_dir_acls(const struct stat *fs, char *source_dir, char *dest_dir) { -#if 0 acl_t (*aclgetf)(const char *, acl_type_t); int (*aclsetf)(const char *, acl_type_t, acl_t); struct acl *aclp; @@ -1037,6 +1015,6 @@ static int preserve_dir_acls(const struct stat *fs, char *source_dir, char *dest return (1); } acl_free(acl); -#endif return (0); } +#endif diff --git a/bin/ad/ad_mv.c b/bin/ad/ad_mv.c index 7f592dd2..72698f73 100644 --- a/bin/ad/ad_mv.c +++ b/bin/ad/ad_mv.c @@ -50,31 +50,9 @@ static int fflg, iflg, nflg, vflg; static afpvol_t svolume, dvolume; static cnid_t did, pdid; static volatile sig_atomic_t alarmed; -static char *netatalk_dirs[] = { - ".AppleDouble", - ".AppleDB", - ".AppleDesktop", - NULL -}; static int copy(const char *, const char *); static int do_move(const char *, const char *); -static void preserve_fd_acls(int source_fd, int dest_fd, const char *source_path, - const char *dest_path); -/* - Check for netatalk special folders e.g. ".AppleDB" or ".AppleDesktop" - Returns pointer to name or NULL. -*/ -static const char *check_netatalk_dirs(const char *name) -{ - int c; - - for (c=0; netatalk_dirs[c]; c++) { - if ((strcmp(name, netatalk_dirs[c])) == 0) - return netatalk_dirs[c]; - } - return NULL; -} /* SIGNAL handling: @@ -242,7 +220,6 @@ int ad_mv(int argc, char *argv[], AFPObj *obj) } } -exit: closevol(&dvolume); return rval; } @@ -465,12 +442,3 @@ static int copy(const char *from, const char *to) } return 0; } - -static void -preserve_fd_acls(int source_fd, - int dest_fd, - const char *source_path, - const char *dest_path) -{ - ; -} diff --git a/bin/ad/ad_set.c b/bin/ad/ad_set.c index d41d5222..af825093 100644 --- a/bin/ad/ad_set.c +++ b/bin/ad/ad_set.c @@ -140,7 +140,6 @@ static void change_label(char *path, afpvol_t *vol, const struct stat *st, struc static void change_attributes(char *path, afpvol_t *vol, const struct stat *st, struct adouble *ad, char *new_attributes) { - char *FinderInfo; uint16_t AFPattributes; ad_getattr(ad, &AFPattributes); @@ -256,7 +255,7 @@ static void change_flags(char *path, afpvol_t *vol, const struct stat *st, struc int ad_set(int argc, char **argv, AFPObj *obj) { - int c, firstarg; + int c; afpvol_t vol; struct stat st; int adflags = 0; diff --git a/bin/misc/fce.c b/bin/misc/fce.c index b80f6a14..23101bfb 100644 --- a/bin/misc/fce.c +++ b/bin/misc/fce.c @@ -30,16 +30,6 @@ static char *fce_ev_names[] = { "FCE_DIR_CREATE" }; -// get sockaddr, IPv4 or IPv6: -static void *get_in_addr(struct sockaddr *sa) -{ - if (sa->sa_family == AF_INET) { - return &(((struct sockaddr_in*)sa)->sin_addr); - } - - return &(((struct sockaddr_in6*)sa)->sin6_addr); -} - static int unpack_fce_packet(unsigned char *buf, struct fce_packet *packet) { unsigned char *p = buf; @@ -77,8 +67,6 @@ int main(void) struct sockaddr_storage their_addr; char buf[MAXBUFLEN]; socklen_t addr_len; - char s[INET6_ADDRSTRLEN]; - uint64_t tmsize; memset(&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; // set to AF_INET to force IPv4 @@ -129,7 +117,7 @@ int main(void) exit(1); } - unpack_fce_packet(buf, &packet); + unpack_fce_packet((unsigned char *)buf, &packet); if (memcmp(packet.magic, FCE_PACKET_MAGIC, sizeof(packet.magic)) == 0) { diff --git a/etc/afpd/acls.c b/etc/afpd/acls.c index b14beb6f..5cab99fe 100644 --- a/etc/afpd/acls.c +++ b/etc/afpd/acls.c @@ -629,6 +629,7 @@ EC_CLEANUP: EC_EXIT; } +#if 0 /*! * Add entries of one acl to another acl * @@ -651,6 +652,7 @@ static int acl_add_acl(acl_t *aclp, const acl_t acl) EC_CLEANUP: EC_EXIT; } +#endif /*! * Map Darwin ACE rights to POSIX 1e perm @@ -1261,7 +1263,6 @@ static int set_acl(const struct vol *vol, acl_entry_t entry; acl_tag_t tag; int entry_id = ACL_FIRST_ENTRY; - int has_def_acl = 0; /* flags to indicate if the object has a minimal default acl and/or an extended * default acl. */ @@ -1355,7 +1356,6 @@ static int check_acl_access(const AFPObj *obj, int ret; uint32_t allowed_rights = 0; char *username = NULL; - uuidtype_t uuidtype; struct stat st; bstring parent = NULL; int is_dir; @@ -1577,10 +1577,10 @@ int afp_getacl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size LOG(log_debug, logtype_afpd, "afp_getacl: client requested files owner user UUID"); if (NULL == (pw = getpwuid(s_path->st.st_uid))) { LOG(log_debug, logtype_afpd, "afp_getacl: local uid: %u", s_path->st.st_uid); - localuuid_from_id(rbuf, UUID_USER, s_path->st.st_uid); + localuuid_from_id((unsigned char *)rbuf, UUID_USER, s_path->st.st_uid); } else { LOG(log_debug, logtype_afpd, "afp_getacl: got uid: %d, name: %s", s_path->st.st_uid, pw->pw_name); - if ((ret = getuuidfromname(pw->pw_name, UUID_USER, rbuf)) != 0) + if ((ret = getuuidfromname(pw->pw_name, UUID_USER, (unsigned char *)rbuf)) != 0) return AFPERR_MISC; } rbuf += UUID_BINSIZE; @@ -1592,10 +1592,10 @@ int afp_getacl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size LOG(log_debug, logtype_afpd, "afp_getacl: client requested files owner group UUID"); if (NULL == (gr = getgrgid(s_path->st.st_gid))) { LOG(log_debug, logtype_afpd, "afp_getacl: local gid: %u", s_path->st.st_gid); - localuuid_from_id(rbuf, UUID_GROUP, s_path->st.st_gid); + localuuid_from_id((unsigned char *)rbuf, UUID_GROUP, s_path->st.st_gid); } else { LOG(log_debug, logtype_afpd, "afp_getacl: got gid: %d, name: %s", s_path->st.st_gid, gr->gr_name); - if ((ret = getuuidfromname(gr->gr_name, UUID_GROUP, rbuf)) != 0) + if ((ret = getuuidfromname(gr->gr_name, UUID_GROUP, (unsigned char *)rbuf)) != 0) return AFPERR_MISC; } rbuf += UUID_BINSIZE; @@ -1727,7 +1727,6 @@ int afp_setacl(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size int acltoownermode(const AFPObj *obj, const struct vol *vol, char *path, struct stat *st, struct maccess *ma) { EC_INIT; - uint32_t rights = 0; if ( ! (obj->options.flags & OPTION_ACL2MACCESS) || ! (vol->v_flags & AFPVOL_ACLS)) diff --git a/etc/afpd/afp_dsi.c b/etc/afpd/afp_dsi.c index 11e54627..8e1f90d2 100644 --- a/etc/afpd/afp_dsi.c +++ b/etc/afpd/afp_dsi.c @@ -143,8 +143,6 @@ static void afp_dsi_die(int sig) /* SIGQUIT handler */ static void ipc_reconnect_handler(int sig _U_) { - DSI *dsi = (DSI *)AFPobj->dsi; - if (reconnect_ipc(AFPobj) != 0) { LOG(log_error, logtype_afpd, "ipc_reconnect_handler: failed IPC reconnect"); afp_dsi_close(AFPobj); @@ -626,7 +624,7 @@ void afp_over_dsi(AFPObj *obj) LOG(log_debug, logtype_afpd, "<== Start AFP command: %s", AfpNum2name(function)); err = (*afp_switch[function])(obj, - dsi->commands, dsi->cmdlen, + (char *)dsi->commands, dsi->cmdlen, (char *)&dsi->data, &dsi->datalen); LOG(log_debug, logtype_afpd, "==> Finished AFP command: %s -> %s", @@ -667,7 +665,7 @@ void afp_over_dsi(AFPObj *obj) LOG(log_debug, logtype_afpd, "<== Start AFP command: %s", AfpNum2name(function)); err = (*afp_switch[function])(obj, - dsi->commands, dsi->cmdlen, + (char *)dsi->commands, dsi->cmdlen, (char *)&dsi->data, &dsi->datalen); LOG(log_debug, logtype_afpd, "==> Finished AFP command: %s -> %s", diff --git a/etc/afpd/catsearch.c b/etc/afpd/catsearch.c index 09e3ff52..9ffea6e2 100644 --- a/etc/afpd/catsearch.c +++ b/etc/afpd/catsearch.c @@ -137,7 +137,6 @@ static void clearstack(void) static int addstack(char *uname, struct dir *dir, int pidx) { struct dsitem *ds; - size_t l, u; struct dsitem *tmpds = NULL; /* check if we have some space on stack... */ @@ -551,7 +550,7 @@ static int catsearch(const AFPObj *obj, dirpos = opendir("."); if (dirpos == NULL) - dirpos = opendir(bdata(currentdir->d_fullpath)); + dirpos = opendir(cfrombstr(currentdir->d_fullpath)); if (error || dirpos == NULL) { switch (errno) { diff --git a/etc/afpd/desktop.c b/etc/afpd/desktop.c index f34729cc..9ba96bc5 100644 --- a/etc/afpd/desktop.c +++ b/etc/afpd/desktop.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include "volume.h" @@ -61,7 +62,7 @@ int setdeskmode(const struct vol *vol, const mode_t mode) bstring dtpath = bfromcstr(vol->v_dbpath); bcatcstr(dtpath, "/" APPLEDESKTOP); - EC_NEG1( chdir(bdata(dtpath)) ); + EC_NEG1( chdir(cfrombstr(dtpath)) ); if (( desk = opendir( "." )) == NULL ) { if ( chdir( wd ) < 0 ) { @@ -138,7 +139,7 @@ int setdeskowner(const struct vol *vol, uid_t uid, gid_t gid) bstring dtpath = bfromcstr(vol->v_dbpath); bcatcstr(dtpath, "/" APPLEDESKTOP); - EC_NEG1( chdir(bdata(dtpath)) ); + EC_NEG1( chdir(cfrombstr(dtpath)) ); if (( desk = opendir( "." )) == NULL ) { if ( chdir( wd ) < 0 ) { @@ -182,7 +183,7 @@ int setdeskowner(const struct vol *vol, uid_t uid, gid_t gid) LOG(log_error, logtype_afpd, "setdeskowner: chdir %s: %s", wd, strerror(errno) ); EC_FAIL; } - if (chown(bdata(dtpath), uid, gid ) < 0 && errno != EPERM ) { + if (chown(cfrombstr(dtpath), uid, gid ) < 0 && errno != EPERM ) { LOG(log_error, logtype_afpd, "setdeskowner: chown %s: %s", fullpathname(".AppleDouble"), strerror(errno) ); } @@ -203,11 +204,11 @@ static void create_appledesktop_folder(const struct vol * vol) dtpath = bfromcstr(vol->v_dbpath); bcatcstr(dtpath, "/" APPLEDESKTOP); - if (lstat(bdata(dtpath), &st) != 0) { + if (lstat(cfrombstr(dtpath), &st) != 0) { become_root(); - if (lstat(bdata(olddtpath), &st) == 0) { + if (lstat(cfrombstr(olddtpath), &st) == 0) { cmd_argv[0] = "mv"; cmd_argv[1] = bdata(olddtpath); cmd_argv[2] = bdata(dtpath); @@ -215,10 +216,10 @@ static void create_appledesktop_folder(const struct vol * vol) if (run_cmd("mv", cmd_argv) != 0) { LOG(log_error, logtype_afpd, "moving .AppleDesktop from \"%s\" to \"%s\" failed", bdata(olddtpath), bdata(dtpath)); - mkdir(bdata(dtpath), 0777); + mkdir(cfrombstr(dtpath), 0777); } } else { - mkdir(bdata(dtpath), 0777); + mkdir(cfrombstr(dtpath), 0777); } unbecome_root(); diff --git a/etc/afpd/dircache.c b/etc/afpd/dircache.c index 7cd08f6f..37af45fa 100644 --- a/etc/afpd/dircache.c +++ b/etc/afpd/dircache.c @@ -434,7 +434,6 @@ struct dir *dircache_search_by_name(const struct vol *vol, int dircache_add(const struct vol *vol, struct dir *dir) { - struct dir *cdir = NULL; struct dir key; hnode_t *hn; diff --git a/etc/afpd/directory.c b/etc/afpd/directory.c index d617ea8f..9a4fc64e 100644 --- a/etc/afpd/directory.c +++ b/etc/afpd/directory.c @@ -912,7 +912,7 @@ exit: void dir_free_invalid_q(void) { struct dir *dir; - while (dir = (struct dir *)dequeue(invalid_dircache_entries)) + while ((dir = (struct dir *)dequeue(invalid_dircache_entries))) dir_free(dir); } @@ -2200,7 +2200,6 @@ int afp_createdir(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_ ad_flush(&ad); ad_close(&ad, ADFLAGS_HF); -createdir_done: memcpy( rbuf, &dir->d_did, sizeof( uint32_t )); *rbuflen = sizeof( uint32_t ); setvoltime(obj, vol ); diff --git a/etc/afpd/fce_api.c b/etc/afpd/fce_api.c index 5f6b70ba..49dd3cd7 100644 --- a/etc/afpd/fce_api.c +++ b/etc/afpd/fce_api.c @@ -68,7 +68,7 @@ static unsigned long fce_ev_enabled = (1 << FCE_DIR_CREATE); #define MAXIOBUF 1024 -static char iobuf[MAXIOBUF]; +static unsigned char iobuf[MAXIOBUF]; static const char *skip_files[] = { ".DS_Store", @@ -165,7 +165,6 @@ static ssize_t build_fce_packet( struct fce_packet *packet, const char *path, in { size_t pathlen = 0; ssize_t data_len = 0; - uint64_t *t; /* Set content of packet */ memcpy(packet->magic, FCE_PACKET_MAGIC, sizeof(packet->magic) ); @@ -229,7 +228,6 @@ static void send_fce_event(const char *path, int event) static bool first_event = true; struct fce_packet packet; - void *data = &packet; static uint32_t event_id = 0; /* the unique packet couter to detect packet/data loss. Going from 0xFFFFFFFF to 0x0 is a valid increment */ time_t now = time(NULL); @@ -490,7 +488,7 @@ void shortsleep( unsigned int us ) } int main( int argc, char*argv[] ) { - int c,ret; + int c; char *port = FCE_DEFAULT_PORT_STRING; char *host = "localhost"; diff --git a/etc/afpd/file.c b/etc/afpd/file.c index c2a1413d..f62e05ee 100644 --- a/etc/afpd/file.c +++ b/etc/afpd/file.c @@ -751,7 +751,6 @@ createfile_iderr: ad_close(&ad, ADFLAGS_DF|ADFLAGS_HF ); fce_register(FCE_FILE_CREATE, fullpathname(upath), NULL, fce_file); -createfile_done: curdir->d_offcnt++; setvoltime(obj, vol ); diff --git a/etc/afpd/fork.c b/etc/afpd/fork.c index 5af91207..2d59b5da 100644 --- a/etc/afpd/fork.c +++ b/etc/afpd/fork.c @@ -251,7 +251,6 @@ int afp_openfork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, si struct stat *st; uint16_t bshort; struct path *s_path; - struct stat xxx; ibuf++; fork = *ibuf++; @@ -734,8 +733,6 @@ int afp_bytelock_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t static int read_file(const struct ofork *ofork, int eid, off_t offset, char *rbuf, size_t *rbuflen) { ssize_t cc; - int eof = 0; - char *p, *q; cc = ad_read(ofork->of_ad, eid, offset, rbuf, *rbuflen); if ( cc < 0 ) { @@ -1052,7 +1049,6 @@ static ssize_t write_file(struct ofork *ofork, int eid, off_t offset, char *rbuf, size_t rbuflen) { - char *p, *q; ssize_t cc; LOG(log_debug, logtype_afpd, "write_file(off: %ju, size: %zu)", @@ -1091,7 +1087,7 @@ static int write_fork(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, s uint16_t ofrefnum; ssize_t cc; DSI *dsi = obj->dsi; - char *rcvbuf = dsi->commands; + char *rcvbuf = (char *)dsi->commands; size_t rcvbuflen = dsi->server_quantum; /* figure out parameters */ diff --git a/etc/afpd/hash.c b/etc/afpd/hash.c index b7471ccb..f1e30685 100644 --- a/etc/afpd/hash.c +++ b/etc/afpd/hash.c @@ -58,7 +58,6 @@ static const char rcsid[] = "$Id: hash.c,v 1.4 2009-11-19 10:37:43 franklahm Exp static hnode_t *hnode_alloc(void *context); static void hnode_free(hnode_t *node, void *context); static hash_val_t hash_fun_default(const void *key); -static hash_val_t hash_fun2(const void *key); static int hash_comp_default(const void *key1, const void *key2); int hash_val_t_bit; @@ -850,6 +849,13 @@ static hash_val_t hash_fun_default(const void *key) +(uint32_t)(((const uint8_t *)(d))[0]) ) #endif +static int hash_comp_default(const void *key1, const void *key2) +{ + return strcmp(key1, key2); +} + +#ifdef KAZLIB_TEST_MAIN + static hash_val_t hash_fun2(const void *key) { int len, rem; @@ -897,13 +903,6 @@ static hash_val_t hash_fun2(const void *key) return hash; } -static int hash_comp_default(const void *key1, const void *key2) -{ - return strcmp(key1, key2); -} - -#ifdef KAZLIB_TEST_MAIN - #include #include #include diff --git a/etc/afpd/main.c b/etc/afpd/main.c index 106f725c..0e0a858e 100644 --- a/etc/afpd/main.c +++ b/etc/afpd/main.c @@ -210,8 +210,6 @@ static int setlimits(void) int main(int ac, char **av) { - fd_set rfds; - void *ipc; struct sigaction sv; sigset_t sigs; int ret; @@ -428,7 +426,7 @@ int main(int ac, char **av) switch (polldata[i].fdtype) { case LISTEN_FD: - if (child = dsi_start(&obj, (DSI *)polldata[i].data, server_children)) { + if ((child = dsi_start(&obj, (DSI *)polldata[i].data, server_children))) { /* Add IPC fd to select fd set */ fdset_add_fd(obj.options.connections + AFP_LISTENERS + FDSET_SAFETY, &fdset, diff --git a/etc/afpd/status.c b/etc/afpd/status.c index f42bf5ec..caa74d5d 100644 --- a/etc/afpd/status.c +++ b/etc/afpd/status.c @@ -95,7 +95,7 @@ static void status_flags(char *data, static int status_server(char *data, const char *server, const struct afp_options *options) { char *start = data; - char *Obj, *Type, *Zone; + char *Obj; char buf[32]; uint16_t status; size_t len; @@ -364,7 +364,6 @@ static size_t status_directorynames(char *data, data += offset; char *DirectoryNamesCount = data++; - char *DirectoryNames = data; size_t size = sizeof(uint8_t); *DirectoryNamesCount = 0; @@ -441,7 +440,7 @@ static size_t status_directorynames(char *data, } krb5_unparse_name(context, entry.principal, &principal); - krb5_kt_free_entry(context, &entry); + krb5_free_keytab_entry_contents(context, &entry); append_directoryname(&data, offset, @@ -501,7 +500,7 @@ static size_t status_utf8servername(char *data, int *nameoffset, uint16_t namelen; size_t len; char *begin = data; - uint16_t offset, status; + uint16_t offset; memcpy(&offset, data + *nameoffset, sizeof(offset)); offset = ntohs(offset); @@ -645,7 +644,7 @@ void set_signature(struct afp_options *options) { char *servername_conf; int header = 0; char buf[1024], *p; - FILE *fp = NULL, *randomp; + FILE *fp = NULL; size_t len; char *server_tmp; diff --git a/etc/afpd/volume.c b/etc/afpd/volume.c index 172584d8..844444ba 100644 --- a/etc/afpd/volume.c +++ b/etc/afpd/volume.c @@ -152,7 +152,6 @@ static int get_tm_used(struct vol * restrict vol) DIR *dir = NULL; const struct dirent *entry; const char *p; - struct stat st; long int links; time_t now = time(NULL); @@ -212,7 +211,6 @@ static int getvolspace(const AFPObj *obj, struct vol *vol, { int spaceflag, rc; uint32_t maxsize; - VolSpace used; #ifndef NO_QUOTA_SUPPORT VolSpace qfree, qtotal; #endif @@ -663,7 +661,6 @@ int afp_openvol(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t { struct stat st; char *volname; - char *p; struct vol *volume; struct dir *dir; diff --git a/etc/cnid_dbd/cmd_dbd_scanvol.c b/etc/cnid_dbd/cmd_dbd_scanvol.c index 99156aa9..48deb5f0 100644 --- a/etc/cnid_dbd/cmd_dbd_scanvol.c +++ b/etc/cnid_dbd/cmd_dbd_scanvol.c @@ -65,7 +65,6 @@ static struct cnid_dbd_rqst rqst; static struct cnid_dbd_rply rply; static jmp_buf jmp; static char pname[MAXPATHLEN] = "../"; -static char cnidResBuf[12 + MAXPATHLEN + 1]; /* Taken form afpd/desktop.c @@ -106,52 +105,6 @@ static char *utompath(char *upath) return(m); } -/* - Taken form afpd/desktop.c -*/ -static char *mtoupath(char *mpath) -{ - static char upath[ MAXPATHLEN + 2]; /* for convert_charset dest_len parameter +2 */ - char *m, *u; - size_t inplen; - size_t outlen; - u_int16_t flags = 0; - - if (!mpath) - return NULL; - - if ( *mpath == '\0' ) { - return( "." ); - } - - /* set conversion flags */ - if ((vol->v_casefold & AFPVOL_MTOUUPPER)) - flags |= CONV_TOUPPER; - else if ((vol->v_casefold & AFPVOL_MTOULOWER)) - flags |= CONV_TOLOWER; - - if ((vol->v_flags & AFPVOL_EILSEQ)) { - flags |= CONV__EILSEQ; - } - - m = mpath; - u = upath; - - inplen = strlen(m); - outlen = MAXPATHLEN; - - if ((size_t)-1 == (outlen = convert_charset(CH_UTF8_MAC, - vol->v_volcharset, - vol->v_maccharset, - m, inplen, u, outlen, &flags)) ) { - dbd_log( LOGSTD, "conversion from UTF8-MAC to %s for %s failed.", - vol->v_volcodepage, mpath); - return NULL; - } - - return( upath ); -} - /* Check for netatalk special folders e.g. ".AppleDB" or ".AppleDesktop" Returns pointer to name or NULL. @@ -187,7 +140,6 @@ static const char *check_special_dirs(const char *name) */ static int update_cnid(cnid_t did, const struct stat *sp, const char *oldname, const char *newname) { - int ret; cnid_t id; /* Query the database */ @@ -608,8 +560,8 @@ static int read_addir(void) */ static cnid_t check_cnid(const char *name, cnid_t did, struct stat *st, int adfile_ok) { - int ret, adflags = ADFLAGS_HF; - cnid_t db_cnid, ad_cnid, tmpid; + int adflags = ADFLAGS_HF; + cnid_t db_cnid, ad_cnid; struct adouble ad; adflags = ADFLAGS_HF | (S_ISDIR(st->st_mode) ? ADFLAGS_DIR : 0); @@ -667,7 +619,7 @@ static cnid_t check_cnid(const char *name, cnid_t did, struct stat *st, int adfi */ static int dbd_readdir(int volroot, cnid_t did) { - int cwd, ret = 0, adfile_ok, addir_ok, encoding_ok; + int cwd, ret = 0, adfile_ok, addir_ok; cnid_t cnid = 0; const char *name; DIR *dp; diff --git a/etc/cnid_dbd/cnid_metad.c b/etc/cnid_dbd/cnid_metad.c index 2fc1e8de..18e063da 100644 --- a/etc/cnid_dbd/cnid_metad.c +++ b/etc/cnid_dbd/cnid_metad.c @@ -92,6 +92,7 @@ #include #include #include +#include #include #include @@ -286,7 +287,6 @@ static int maybe_start_dbd(const AFPObj *obj, char *dbdpn, const char *volpath) static int set_dbdir(const char *dbdir, const char *vpath) { EC_INIT; - int status; struct stat st; bstring oldpath, newpath; char *cmd_argv[4]; @@ -301,7 +301,7 @@ static int set_dbdir(const char *dbdir, const char *vpath) EC_FAIL; } - if (lstat(bdata(oldpath), &st) == 0 && lstat(bdata(newpath), &st) != 0 && errno == ENOENT) { + if (lstat(cfrombstr(oldpath), &st) == 0 && lstat(cfrombstr(newpath), &st) != 0 && errno == ENOENT) { /* There's an .AppleDB in the volume root, we move it */ cmd_argv[0] = "mv"; cmd_argv[1] = bdata(oldpath); @@ -315,7 +315,7 @@ static int set_dbdir(const char *dbdir, const char *vpath) } - if (lstat(bdata(newpath), &st) < 0 && mkdir(bdata(newpath), 0755 ) < 0) { + if (lstat(cfrombstr(newpath), &st) < 0 && mkdir(cfrombstr(newpath), 0755 ) < 0) { LOG(log_error, logtype_cnid, "set_dbdir: mkdir failed for %s", bdata(newpath)); EC_FAIL; } @@ -326,44 +326,6 @@ EC_CLEANUP: EC_EXIT; } -/* ------------------ */ -static uid_t user_to_uid (char *username) -{ - struct passwd *this_passwd; - - /* check for anything */ - if ( !username || strlen ( username ) < 1 ) return 0; - - /* grab the /etc/passwd record relating to username */ - this_passwd = getpwnam ( username ); - - /* return false if there is no structure returned */ - if (this_passwd == NULL) return 0; - - /* return proper uid */ - return this_passwd->pw_uid; - -} - -/* ------------------ */ -static gid_t group_to_gid ( char *group) -{ - struct group *this_group; - - /* check for anything */ - if ( !group || strlen ( group ) < 1 ) return 0; - - /* grab the /etc/groups record relating to group */ - this_group = getgrnam ( group ); - - /* return false if there is no structure returned */ - if (this_group == NULL) return 0; - - /* return proper gid */ - return this_group->gr_gid; - -} - /* ------------------ */ static void catch_child(int sig _U_) { @@ -471,7 +433,6 @@ int main(int argc, char *argv[]) int cc; uid_t uid = 0; gid_t gid = 0; - int err = 0; int debug = 0; int ret; sigset_t set; @@ -508,7 +469,7 @@ int main(int argc, char *argv[]) (void)setlimits(); host = iniparser_getstrdup(obj.iniconfig, INISEC_GLOBAL, "cnid listen", "localhost:4700"); - if (port = strrchr(host, ':')) + if ((port = strrchr(host, ':'))) *port++ = 0; else port = DEFAULTPORT; diff --git a/etc/cnid_dbd/main.c b/etc/cnid_dbd/main.c index edbe60f8..767e1e3c 100644 --- a/etc/cnid_dbd/main.c +++ b/etc/cnid_dbd/main.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -216,7 +217,7 @@ static int delete_db(void) EC_ZERO( get_lock(LOCK_FREE, bdata(dbpath)) ); EC_NEG1( cwd = open(".", O_RDONLY) ); - chdir(bdata(dbpath)); + chdir(cfrombstr(dbpath)); system("rm -f cnid2.db lock log.* __db.*"); if ((db_locked = get_lock(LOCK_EXCL, bdata(dbpath))) != LOCK_EXCL) { @@ -477,7 +478,6 @@ int main(int argc, char *argv[]) EC_INIT; int delete_bdb = 0; int ctrlfd = -1, clntfd = -1; - char *logconfig; AFPObj obj = { 0 }; char *volpath = NULL; diff --git a/etc/netatalk/netatalk.c b/etc/netatalk/netatalk.c index 23659fe5..9ac72c5a 100644 --- a/etc/netatalk/netatalk.c +++ b/etc/netatalk/netatalk.c @@ -52,7 +52,6 @@ static void kill_childs(int sig, ...); /* static variables */ static AFPObj obj; -static sig_atomic_t got_chldsig; static pid_t afpd_pid = -1, cnid_metad_pid = -1; static uint afpd_restarts, cnid_metad_restarts; static struct event_base *base; @@ -134,7 +133,7 @@ static void sighup_cb(evutil_socket_t fd, short what, void *arg) /* SIGCHLD callback */ static void sigchld_cb(evutil_socket_t fd, short what, void *arg) { - int status, i; + int status; pid_t pid; LOG(log_debug, logtype_afpd, "Got SIGCHLD event"); @@ -167,8 +166,6 @@ static void sigchld_cb(evutil_socket_t fd, short what, void *arg) /* timer callback */ static void timer_cb(evutil_socket_t fd, short what, void *arg) { - static int i = 0; - if (in_shutdown) return; @@ -252,7 +249,6 @@ static void usage(void) int main(int argc, char **argv) { - const char *configfile = NULL; int c, ret, debug = 0; sigset_t blocksigs; struct timeval tv; diff --git a/etc/uams/uams_dhx_pam.c b/etc/uams/uams_dhx_pam.c index 66ccc014..8b879f06 100644 --- a/etc/uams/uams_dhx_pam.c +++ b/etc/uams/uams_dhx_pam.c @@ -197,7 +197,7 @@ static int dhx_setup(void *obj, char *ibuf, size_t ibuflen _U_, DH *dh; /* get the client's public key */ - if (!(bn = BN_bin2bn(ibuf, KEYSIZE, NULL))) { + if (!(bn = BN_bin2bn((unsigned char *)ibuf, KEYSIZE, NULL))) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM No Public Key -- %s", strerror(errno)); @@ -259,10 +259,10 @@ static int dhx_setup(void *obj, char *ibuf, size_t ibuflen _U_, } /* figure out the key. store the key in rbuf for now. */ - i = DH_compute_key(rbuf, bn, dh); + i = DH_compute_key((unsigned char *)rbuf, bn, dh); /* set the key */ - CAST_set_key(&castkey, i, rbuf); + CAST_set_key(&castkey, i, (unsigned char *)rbuf); /* session id. it's just a hashed version of the object pointer. */ sessid = dhxhash(obj); @@ -271,7 +271,7 @@ static int dhx_setup(void *obj, char *ibuf, size_t ibuflen _U_, *rbuflen += sizeof(sessid); /* public key */ - BN_bn2bin(dh->pub_key, rbuf); + BN_bn2bin(dh->pub_key, (unsigned char *)rbuf); rbuf += KEYSIZE; *rbuflen += KEYSIZE; @@ -305,7 +305,7 @@ static int dhx_setup(void *obj, char *ibuf, size_t ibuflen _U_, #endif /* 0 */ /* encrypt using cast */ - CAST_cbc_encrypt(rbuf, rbuf, CRYPTBUFLEN, &castkey, msg2_iv, + CAST_cbc_encrypt((unsigned char *)rbuf, (unsigned char *)rbuf, CRYPTBUFLEN, &castkey, msg2_iv, CAST_ENCRYPT); *rbuflen += CRYPTBUFLEN; BN_free(bn); @@ -440,13 +440,13 @@ static int pam_logincont(void *obj, struct passwd **uam_pwd, hostname = NULL; } - CAST_cbc_encrypt(ibuf, rbuf, CRYPT2BUFLEN, &castkey, + CAST_cbc_encrypt((unsigned char *)ibuf, (unsigned char *)rbuf, CRYPT2BUFLEN, &castkey, msg3_iv, CAST_DECRYPT); memset(&castkey, 0, sizeof(castkey)); /* check to make sure that the random number is the same. we * get sent back an incremented random number. */ - if (!(bn1 = BN_bin2bn(rbuf, KEYSIZE, NULL))) + if (!(bn1 = BN_bin2bn((unsigned char *)rbuf, KEYSIZE, NULL))) return AFPERR_PARAM; if (!(bn2 = BN_bin2bn(randbuf, sizeof(randbuf), NULL))) { @@ -617,13 +617,13 @@ static int pam_changepw(void *obj, char *username, } /* grab the client's nonce, old password, and new password. */ - CAST_cbc_encrypt(ibuf, ibuf, CHANGEPWBUFLEN, &castkey, + CAST_cbc_encrypt((unsigned char *)ibuf, (unsigned char *)ibuf, CHANGEPWBUFLEN, &castkey, msg3_iv, CAST_DECRYPT); memset(&castkey, 0, sizeof(castkey)); /* check to make sure that the random number is the same. we * get sent back an incremented random number. */ - if (!(bn1 = BN_bin2bn(ibuf, KEYSIZE, NULL))) { + if (!(bn1 = BN_bin2bn((unsigned char *)ibuf, KEYSIZE, NULL))) { /* Log Entry */ LOG(log_info, logtype_uams, "uams_dhx_pam.c :PAM: Random Number Not the same or not incremented-- %s", strerror(errno)); diff --git a/etc/uams/uams_gss.c b/etc/uams/uams_gss.c index f8cfc1af..29ea36c0 100644 --- a/etc/uams/uams_gss.c +++ b/etc/uams/uams_gss.c @@ -318,8 +318,6 @@ static int do_gss_auth(void *obj, cleanup_client_name: gss_release_name(&status, &client_name); - -cleanup_context: gss_release_buffer(&status, &authenticator_buff); gss_delete_sec_context(&status, &context, NULL); diff --git a/libatalk/acl/cache.c b/libatalk/acl/cache.c index bc9806d9..15eea478 100644 --- a/libatalk/acl/cache.c +++ b/libatalk/acl/cache.c @@ -46,7 +46,6 @@ static cacheduser_t *uuidcache[256]; /* indexed by hash of uuid */ void uuidcache_dump(void) { int i; - int ret = 0; cacheduser_t *entry; char timestr[200]; struct tm *tmp = NULL; @@ -301,7 +300,6 @@ int add_cachebyuuid( uuidp_t inuuid, const char *inname, uuidtype_t type, const char *name = NULL; unsigned char *uuid = NULL; cacheduser_t *cacheduser = NULL; - cacheduser_t *entry; unsigned char hash; /* allocate mem and copy values */ diff --git a/libatalk/acl/ldap.c b/libatalk/acl/ldap.c index 44caae83..f04c5aef 100644 --- a/libatalk/acl/ldap.c +++ b/libatalk/acl/ldap.c @@ -347,7 +347,7 @@ int ldap_getnamefromuuid( const char *uuidstr, char **name, uuidtype_t *type) { int i = 0; int s = 0; char c; - while(c = uuidstr[i]) { + while ((c = uuidstr[i])) { if((c >='a' && c <= 'f') || (c >= 'A' && c <= 'F') || (c >= '0' && c <= '9')) { diff --git a/libatalk/acl/uuid.c b/libatalk/acl/uuid.c index b71c13e6..c1bc065f 100644 --- a/libatalk/acl/uuid.c +++ b/libatalk/acl/uuid.c @@ -209,7 +209,6 @@ int getuuidfromname( const char *name, uuidtype_t type, unsigned char *uuid) { add_cachebyname(name, uuid, mytype, 0); } -cleanup: #ifdef HAVE_LDAP if (uuid_string) free(uuid_string); #endif diff --git a/libatalk/adouble/ad_conv.c b/libatalk/adouble/ad_conv.c index 329790bb..ff0eebcc 100644 --- a/libatalk/adouble/ad_conv.c +++ b/libatalk/adouble/ad_conv.c @@ -57,7 +57,6 @@ static int ad_conv_v22ea_hf(const char *path, const struct stat *sp, const struc EC_INIT; struct adouble adv2; struct adouble adea; - const char *adpath; int adflags; uint32_t ctime, mtime, afpinfo = 0; char *emptyad; @@ -199,7 +198,7 @@ static int ad_conv_dehex(const char *path, const struct stat *sp, const struct v { EC_INIT; static char buf[MAXPATHLEN]; - const char *adpath, *p; + const char *p; int adflags = S_ISDIR(sp->st_mode) ? ADFLAGS_DIR : 0; bstring newpath = NULL; diff --git a/libatalk/adouble/ad_flush.c b/libatalk/adouble/ad_flush.c index d8fbacf6..50fd8bae 100644 --- a/libatalk/adouble/ad_flush.c +++ b/libatalk/adouble/ad_flush.c @@ -59,7 +59,6 @@ int ad_rebuild_adouble_header_v2(struct adouble *ad) uint32_t temp; uint16_t nent; char *buf, *nentp; - int len; LOG(log_debug, logtype_ad, "ad_rebuild_adouble_header_v2"); @@ -105,7 +104,6 @@ int ad_rebuild_adouble_header_ea(struct adouble *ad) uint32_t temp; uint16_t nent; char *buf, *nentp; - int len; LOG(log_debug, logtype_ad, "ad_rebuild_adouble_header_ea"); @@ -153,7 +151,6 @@ static int ad_rebuild_adouble_header_osx(struct adouble *ad, char *adbuf) uint32_t temp; uint16_t nent; char *buf; - int len; LOG(log_debug, logtype_ad, "ad_rebuild_adouble_header_osx"); diff --git a/libatalk/adouble/ad_lock.c b/libatalk/adouble/ad_lock.c index 6e159cdd..173adc4c 100644 --- a/libatalk/adouble/ad_lock.c +++ b/libatalk/adouble/ad_lock.c @@ -630,7 +630,6 @@ int ad_testlock(struct adouble *ad, int eid, const off_t off) uint16_t ad_openforks(struct adouble *ad, uint16_t attrbits) { uint16_t ret = 0; - struct ad_fd *adf; off_t off; off_t len; diff --git a/libatalk/adouble/ad_open.c b/libatalk/adouble/ad_open.c index e66929f2..5205b9e2 100644 --- a/libatalk/adouble/ad_open.c +++ b/libatalk/adouble/ad_open.c @@ -108,7 +108,9 @@ static int ad_mkrf(const char *path); static int ad_header_read(const char *path, struct adouble *ad, const struct stat *hst); static int ad_header_upgrade(struct adouble *ad, const char *name); +#ifdef HAVE_EAFD static int ad_mkrf_ea(const char *path); +#endif static int ad_header_read_ea(const char *path, struct adouble *ad, const struct stat *hst); static int ad_header_upgrade_ea(struct adouble *ad, const char *name); static int ad_reso_size(const char *path, int adflags, struct adouble *ad); @@ -691,11 +693,13 @@ static int ad_mkrf(const char *path) return 0; } +#ifdef HAVE_EAFD static int ad_mkrf_ea(const char *path _U_) { AFP_PANIC("ad_mkrf_ea: dont use"); return 0; } +#endif static int ad_mkrf_osx(const char *path _U_) { @@ -1033,7 +1037,6 @@ EC_CLEANUP: static int ad_open_hf_ea(const char *path, int adflags, int mode, struct adouble *ad) { EC_INIT; - ssize_t rforklen; int oflags; int opened = 0; @@ -1216,7 +1219,6 @@ static int ad_open_rf_ea(const char *path, int adflags, int mode, struct adouble int oflags; int opened = 0; int closeflags = adflags & (ADFLAGS_DF | ADFLAGS_HF); - ssize_t rlen; #ifndef HAVE_EAFD const char *rfpath; struct stat st; diff --git a/libatalk/adouble/ad_read.c b/libatalk/adouble/ad_read.c index ed7c0cb4..852a6e96 100644 --- a/libatalk/adouble/ad_read.c +++ b/libatalk/adouble/ad_read.c @@ -62,7 +62,6 @@ ssize_t adf_pread(struct ad_fd *ad_fd, void *buf, size_t count, off_t offset) ssize_t ad_read( struct adouble *ad, const uint32_t eid, off_t off, char *buf, const size_t buflen) { ssize_t cc; - ssize_t rlen; off_t r_off = 0; /* We're either reading the data fork (and thus the data file) diff --git a/libatalk/adouble/ad_write.c b/libatalk/adouble/ad_write.c index 6e8a0190..a807c1de 100644 --- a/libatalk/adouble/ad_write.c +++ b/libatalk/adouble/ad_write.c @@ -52,7 +52,6 @@ ssize_t ad_write(struct adouble *ad, uint32_t eid, off_t off, int end, const cha EC_INIT; struct stat st; ssize_t cc; - size_t roundup; off_t r_off; if (ad_data_fileno(ad) == AD_SYMLINK) { @@ -94,7 +93,6 @@ ssize_t ad_write(struct adouble *ad, uint32_t eid, off_t off, int end, const cha return -1; /* we don't know how to write if it's not a ressource or data fork */ } -EC_CLEANUP: if (ret != 0) return ret; return( cc ); diff --git a/libatalk/bstring/bstradd.c b/libatalk/bstring/bstradd.c index 7b59b2e8..c78fd0e0 100644 --- a/libatalk/bstring/bstradd.c +++ b/libatalk/bstring/bstradd.c @@ -77,7 +77,6 @@ */ bstring brefcstr (char *str) { bstring b; - int i; size_t j; if (str == NULL) @@ -90,7 +89,7 @@ bstring brefcstr (char *str) { b->slen = (int) j; b->mlen = -1; - b->data = str; + b->data = (unsigned char *)str; return b; } diff --git a/libatalk/cnid/tdb/cnid_tdb_add.c b/libatalk/cnid/tdb/cnid_tdb_add.c index fcb43fa2..3203eda9 100644 --- a/libatalk/cnid/tdb/cnid_tdb_add.c +++ b/libatalk/cnid/tdb/cnid_tdb_add.c @@ -93,7 +93,7 @@ static int add_cnid (struct _cnid_tdb_private *db, TDB_DATA *key, TDB_DATA *data } /* did/name database */ - altkey.dptr = (char *) data->dptr +CNID_DID_OFS; + altkey.dptr = data->dptr +CNID_DID_OFS; altkey.dsize = data->dsize -CNID_DID_OFS; if (tdb_store(db->tdb_didname, altkey, altdata, TDB_REPLACE)) { goto abort; @@ -112,7 +112,7 @@ static cnid_t get_cnid(struct _cnid_tdb_private *db) memset(&rootinfo_key, 0, sizeof(rootinfo_key)); memset(&data, 0, sizeof(data)); - rootinfo_key.dptr = ROOTINFO_KEY; + rootinfo_key.dptr = (unsigned char *)ROOTINFO_KEY; rootinfo_key.dsize = ROOTINFO_KEYLEN; tdb_chainlock(db->tdb_didname, rootinfo_key); @@ -136,7 +136,7 @@ static cnid_t get_cnid(struct _cnid_tdb_private *db) } memset(&data, 0, sizeof(data)); - data.dptr = (char *)&hint; + data.dptr = (unsigned char *)&hint; data.dsize = sizeof(hint); if (tdb_store(db->tdb_didname, rootinfo_key, data, TDB_REPLACE)) { goto cleanup; @@ -181,7 +181,7 @@ cnid_t cnid_tdb_add(struct _cnid_db *cdb, const struct stat *st, memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); - key.dptr = (char *)&hint; + key.dptr = (unsigned char *)&hint; key.dsize = sizeof(cnid_t); if ((data.dptr = make_tdb_data(cdb->flags, lstp, did, name, len)) == NULL) { LOG(log_error, logtype_default, "tdb_add: Path name is too long"); diff --git a/libatalk/cnid/tdb/cnid_tdb_delete.c b/libatalk/cnid/tdb/cnid_tdb_delete.c index aa801e58..e7bf6f71 100644 --- a/libatalk/cnid/tdb/cnid_tdb_delete.c +++ b/libatalk/cnid/tdb/cnid_tdb_delete.c @@ -26,7 +26,7 @@ int cnid_tdb_delete(struct _cnid_db *cdb, const cnid_t id) memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); - key.dptr = (char *)&id; + key.dptr = (unsigned char *)&id; key.dsize = sizeof(cnid_t); data = tdb_fetch(db->tdb_cnid, key); if (!data.dptr) @@ -40,7 +40,7 @@ int cnid_tdb_delete(struct _cnid_db *cdb, const cnid_t id) key.dsize = CNID_DEVINO_LEN; tdb_delete(db->tdb_devino, key); - key.dptr = (char *)data.dptr +CNID_DID_OFS; + key.dptr = data.dptr +CNID_DID_OFS; key.dsize = data.dsize -CNID_DID_OFS; tdb_delete(db->tdb_didname, key); diff --git a/libatalk/cnid/tdb/cnid_tdb_get.c b/libatalk/cnid/tdb/cnid_tdb_get.c index 8321d04e..4e7f638d 100644 --- a/libatalk/cnid/tdb/cnid_tdb_get.c +++ b/libatalk/cnid/tdb/cnid_tdb_get.c @@ -26,7 +26,7 @@ cnid_t cnid_tdb_get(struct _cnid_db *cdb, cnid_t did, const char *name, size_t l buf += sizeof(did); memcpy(buf, name, len); *(buf + len) = '\0'; /* Make it a C-string. */ - key.dptr = start; + key.dptr = (unsigned char *)start; key.dsize = CNID_DID_LEN + len + 1; data = tdb_fetch(db->tdb_didname, key); if (!data.dptr) diff --git a/libatalk/cnid/tdb/cnid_tdb_lookup.c b/libatalk/cnid/tdb/cnid_tdb_lookup.c index f095cd54..c95631af 100644 --- a/libatalk/cnid/tdb/cnid_tdb_lookup.c +++ b/libatalk/cnid/tdb/cnid_tdb_lookup.c @@ -25,7 +25,7 @@ cnid_t cnid_tdb_lookup(struct _cnid_db *cdb, const struct stat *st, cnid_t did, return 0; } - if ((buf = make_tdb_data(cdb->flags, st, did, name, len)) == NULL) { + if ((buf = (char *)make_tdb_data(cdb->flags, st, did, name, len)) == NULL) { LOG(log_error, logtype_default, "tdb_lookup: Pathname is too long"); return 0; } @@ -42,7 +42,7 @@ cnid_t cnid_tdb_lookup(struct _cnid_db *cdb, const struct stat *st, cnid_t did, memcpy(dev, buf + CNID_DEV_OFS, CNID_DEV_LEN); memcpy(ino, buf + CNID_INO_OFS, CNID_INO_LEN); - key.dptr = buf +CNID_DEVINO_OFS; + key.dptr = (unsigned char *)buf + CNID_DEVINO_OFS; key.dsize = CNID_DEVINO_LEN; cniddata = tdb_fetch(db->tdb_devino, key); if (!cniddata.dptr) { @@ -66,7 +66,7 @@ cnid_t cnid_tdb_lookup(struct _cnid_db *cdb, const struct stat *st, cnid_t did, } /* did/name now */ - key.dptr = buf + CNID_DID_OFS; + key.dptr = (unsigned char *)buf + CNID_DID_OFS; key.dsize = CNID_DID_LEN + len + 1; cniddata = tdb_fetch(db->tdb_didname, key); if (!cniddata.dptr) { diff --git a/libatalk/cnid/tdb/cnid_tdb_open.c b/libatalk/cnid/tdb/cnid_tdb_open.c index 889cea1e..0aee5b4d 100644 --- a/libatalk/cnid/tdb/cnid_tdb_open.c +++ b/libatalk/cnid/tdb/cnid_tdb_open.c @@ -125,14 +125,14 @@ struct _cnid_db *cnid_tdb_open(struct cnid_open_args *args) * to change the format in any way. */ memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); - key.dptr = DBVERSION_KEY; + key.dptr = (unsigned char *)DBVERSION_KEY; key.dsize = DBVERSION_KEYLEN; data = tdb_fetch(db->tdb_didname, key); if (!data.dptr) { uint32_t version = htonl(DBVERSION); - data.dptr = (char *)&version; + data.dptr = (unsigned char *)&version; data.dsize = sizeof(version); if (tdb_store(db->tdb_didname, key, data, TDB_REPLACE)) { LOG(log_error, logtype_default, "tdb_open: Error putting new version"); diff --git a/libatalk/cnid/tdb/cnid_tdb_resolve.c b/libatalk/cnid/tdb/cnid_tdb_resolve.c index 5e831222..7e80f385 100644 --- a/libatalk/cnid/tdb/cnid_tdb_resolve.c +++ b/libatalk/cnid/tdb/cnid_tdb_resolve.c @@ -19,7 +19,7 @@ char *cnid_tdb_resolve(struct _cnid_db *cdb, cnid_t * id, void *buffer, size_t l if (!cdb || !(db = cdb->_private) || !id || !(*id)) { return NULL; } - key.dptr = (char *)id; + key.dptr = (unsigned char *)id; key.dsize = sizeof(cnid_t); data = tdb_fetch(db->tdb_cnid, key); if (data.dptr) diff --git a/libatalk/cnid/tdb/cnid_tdb_update.c b/libatalk/cnid/tdb/cnid_tdb_update.c index d367334e..6d23b109 100644 --- a/libatalk/cnid/tdb/cnid_tdb_update.c +++ b/libatalk/cnid/tdb/cnid_tdb_update.c @@ -38,7 +38,7 @@ int cnid_tdb_update(struct _cnid_db *cdb, cnid_t id, const struct stat *st, free(altdata.dptr); if (data.dptr) { - key.dptr = (char *)data.dptr +CNID_DID_OFS; + key.dptr = (unsigned char *)data.dptr +CNID_DID_OFS; key.dsize = data.dsize - CNID_DID_OFS; tdb_delete(db->tdb_didname, key); @@ -49,7 +49,7 @@ int cnid_tdb_update(struct _cnid_db *cdb, cnid_t id, const struct stat *st, /* search by did/name */ data.dptr = make_tdb_data(cdb->flags, st, did, name, len); data.dsize = CNID_HEADER_LEN + len + 1; - key.dptr = (char *)data.dptr +CNID_DID_OFS; + key.dptr = (unsigned char *)data.dptr +CNID_DID_OFS; key.dsize = data.dsize - CNID_DID_OFS; altdata = tdb_fetch(db->tdb_didname, key); if (altdata.dptr) { @@ -76,7 +76,7 @@ int cnid_tdb_update(struct _cnid_db *cdb, cnid_t id, const struct stat *st, memcpy(data.dptr, &id, sizeof(id)); /* Update the old CNID with the new info. */ - key.dptr = (char *) &id; + key.dptr = (unsigned char *) &id; key.dsize = sizeof(id); if (tdb_store(db->tdb_cnid, key, data, TDB_REPLACE)) { goto update_err; @@ -85,13 +85,13 @@ int cnid_tdb_update(struct _cnid_db *cdb, cnid_t id, const struct stat *st, /* Put in a new dev/ino mapping. */ key.dptr = data.dptr +CNID_DEVINO_OFS; key.dsize = CNID_DEVINO_LEN; - altdata.dptr = (char *) &id; + altdata.dptr = (unsigned char *) &id; altdata.dsize = sizeof(id); if (tdb_store(db->tdb_devino, key, altdata, TDB_REPLACE)) { goto update_err; } /* put in a new did/name mapping. */ - key.dptr = (char *) data.dptr +CNID_DID_OFS; + key.dptr = (unsigned char *) data.dptr +CNID_DID_OFS; key.dsize = data.dsize -CNID_DID_OFS; if (tdb_store(db->tdb_didname, key, altdata, TDB_REPLACE)) { diff --git a/libatalk/dsi/dsi_getsess.c b/libatalk/dsi/dsi_getsess.c index d5b855a8..39c93bf5 100644 --- a/libatalk/dsi/dsi_getsess.c +++ b/libatalk/dsi/dsi_getsess.c @@ -36,7 +36,7 @@ int dsi_getsession(DSI *dsi, server_child *serv_children, int tickleval, afp_child_t **childp) { pid_t pid; - unsigned int ipc_fds[2]; + int ipc_fds[2]; afp_child_t *child; if (socketpair(PF_UNIX, SOCK_STREAM, 0, ipc_fds) < 0) { diff --git a/libatalk/iniparser/iniparser.c b/libatalk/iniparser/iniparser.c index c0514d96..93e14b6b 100644 --- a/libatalk/iniparser/iniparser.c +++ b/libatalk/iniparser/iniparser.c @@ -532,7 +532,6 @@ dictionary * iniparser_load(const char * ininame) char line [ASCIILINESZ+1] ; char section [ASCIILINESZ+1] ; char key [ASCIILINESZ+1] ; - char tmp [ASCIILINESZ+1] ; char val [ASCIILINESZ+1] ; int last=0 ; diff --git a/libatalk/tdb/io.c b/libatalk/tdb/io.c index d549715f..55bc9818 100644 --- a/libatalk/tdb/io.c +++ b/libatalk/tdb/io.c @@ -25,7 +25,6 @@ License along with this library; if not, see . */ - #include "tdb_private.h" /* check for an out of bounds access - if it is out of bounds then diff --git a/libatalk/tdb/tdb_private.h b/libatalk/tdb/tdb_private.h index 41389c41..de5dd02b 100644 --- a/libatalk/tdb/tdb_private.h +++ b/libatalk/tdb/tdb_private.h @@ -23,15 +23,9 @@ License along with this library; if not, see . */ -#if 0 -#include "replace.h" -#include "system/filesys.h" -#include "system/time.h" -#include "system/shmem.h" -#include "system/select.h" -#include "system/wait.h" -#include "tdb.h" -#endif +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif /* HAVE_CONFIG_H */ #include #include @@ -50,6 +44,7 @@ #include #include #include +#include #ifndef __STRING #define __STRING(x) #x @@ -78,10 +73,6 @@ typedef uint32_t tdb_len_t; typedef uint32_t tdb_off_t; -#ifndef offsetof -#define offsetof(t,f) ((unsigned int)&((t *)0)->f) -#endif - #define TDB_MAGIC_FOOD "TDB file\n" #define TDB_VERSION (0x26011967 + 6) #define TDB_MAGIC (0x26011999U) diff --git a/libatalk/unicode/util_unistr.c b/libatalk/unicode/util_unistr.c index ce3355df..0eba9a3c 100644 --- a/libatalk/unicode/util_unistr.c +++ b/libatalk/unicode/util_unistr.c @@ -291,12 +291,12 @@ int strcasecmp_w(const ucs2_t *a, const ucs2_t *b) while (*a && *b) { if ((0xD800 <= *a) && (*a < 0xDC00)) { - if (ret = tolower_sp((uint32_t)*a << 16 | (uint32_t)a[1]) - tolower_sp((uint32_t)*b << 16 | (uint32_t)b[1])) return ret; + if ((ret = tolower_sp((uint32_t)*a << 16 | (uint32_t)a[1]) - tolower_sp((uint32_t)*b << 16 | (uint32_t)b[1]))) return ret; a++; b++; if (!(*a && *b)) return (tolower_w(*a) - tolower_w(*b)); /* avoid buffer over run */ } else { - if (ret = tolower_w(*a) - tolower_w(*b)) return ret; + if ((ret = tolower_w(*a) - tolower_w(*b))) return ret; } a++; b++; @@ -317,13 +317,13 @@ int strncasecmp_w(const ucs2_t *a, const ucs2_t *b, size_t len) while ((n < len) && *a && *b) { if ((0xD800 <= *a) && (*a < 0xDC00)) { - if (ret = tolower_sp((uint32_t)*a << 16 | (uint32_t)a[1]) - tolower_sp((uint32_t)*b << 16 | (uint32_t)b[1])) return ret; + if ((ret = tolower_sp((uint32_t)*a << 16 | (uint32_t)a[1]) - tolower_sp((uint32_t)*b << 16 | (uint32_t)b[1]))) return ret; a++; b++; n++; if (!((n < len) && *a && *b)) return (tolower_w(*a) - tolower_w(*b)); } else { - if (ret = tolower_w(*a) - tolower_w(*b)) return ret; + if ((ret = tolower_w(*a) - tolower_w(*b))) return ret; } a++; b++; @@ -607,7 +607,7 @@ size_t precompose_w (ucs2_t *name, size_t inplen, ucs2_t *comp, size_t *outlen) base_sp = ((uint32_t)base << 16) | (uint32_t)comb; do { comb_sp = ((uint32_t)in[1] << 16) | (uint32_t)in[2]; - if (result_sp = do_precomposition_sp(base_sp, comb_sp)) { + if ((result_sp = do_precomposition_sp(base_sp, comb_sp))) { base_sp = result_sp; i += 4; in +=2; @@ -641,7 +641,7 @@ size_t precompose_w (ucs2_t *name, size_t inplen, ucs2_t *comp, size_t *outlen) } /* Binary Search for BMP */ - else if (result = do_precomposition(base, comb)) { + else if ((result = do_precomposition(base, comb))) { base = result; } diff --git a/libatalk/util/netatalk_conf.c b/libatalk/util/netatalk_conf.c index 824c69f9..46d6f766 100644 --- a/libatalk/util/netatalk_conf.c +++ b/libatalk/util/netatalk_conf.c @@ -51,6 +51,7 @@ #include #include #include +#include #define VOLPASSLEN 8 #ifndef UUID_PRINTABLE_STRING_LENGTH @@ -513,13 +514,11 @@ static int hostaccessvol(const AFPObj *obj, const char *volname, const char *arg */ static const char *getoption(const dictionary *conf, const char *vol, const char *opt, const char *defsec, const char *defval) { - EC_INIT; const char *result; if ((!(result = iniparser_getstring(conf, vol, opt, NULL))) && (defsec != NULL)) result = iniparser_getstring(conf, defsec, opt, NULL); -EC_CLEANUP: if (result == NULL) result = defval; return result; @@ -538,13 +537,11 @@ EC_CLEANUP: */ static int getoption_bool(const dictionary *conf, const char *vol, const char *opt, const char *defsec, int defval) { - EC_INIT; int result; if (((result = iniparser_getboolean(conf, vol, opt, -1)) == -1) && (defsec != NULL)) result = iniparser_getboolean(conf, defsec, opt, -1); -EC_CLEANUP: if (result == -1) result = defval; return result; @@ -639,14 +636,14 @@ static struct vol *creatvol(AFPObj *obj, volume->v_vfs_ea = AFPVOL_EA_AUTO; volume->v_umask = obj->options.umask; - if (val = getoption(obj->iniconfig, section, "password", preset, NULL)) + if ((val = getoption(obj->iniconfig, section, "password", preset, NULL))) EC_NULL( volume->v_password = strdup(val) ); - if (val = getoption(obj->iniconfig, section, "veto files", preset, NULL)) + if ((val = getoption(obj->iniconfig, section, "veto files", preset, NULL))) EC_NULL( volume->v_veto = strdup(val) ); /* vol charset is in [G] and [V] */ - if (val = getoption(obj->iniconfig, section, "vol charset", preset, NULL)) { + if ((val = getoption(obj->iniconfig, section, "vol charset", preset, NULL))) { if (strcasecmp(val, "UTF-8") == 0) { val = strdup("UTF8"); } @@ -656,7 +653,7 @@ static struct vol *creatvol(AFPObj *obj, EC_NULL( volume->v_volcodepage = strdup(obj->options.volcodepage) ); /* mac charset is in [G] and [V] */ - if (val = getoption(obj->iniconfig, section, "mac charset", preset, NULL)) { + if ((val = getoption(obj->iniconfig, section, "mac charset", preset, NULL))) { if (strncasecmp(val, "MAC", 3) != 0) { LOG(log_warning, logtype_afpd, "Is '%s' really mac charset? ", val); } @@ -671,41 +668,41 @@ static struct vol *creatvol(AFPObj *obj, if(tmpname[i] == '/') tmpname[i] = ':'; bstring dbpath; - EC_NULL_LOG( val = iniparser_getstring(obj->iniconfig, INISEC_GLOBAL, "vol dbpath", _PATH_STATEDIR "CNID/") ); - EC_NULL_LOG( dbpath = bformat("%s/%s/", val, tmpname) ); - EC_NULL_LOG( volume->v_dbpath = strdup(bdata(dbpath)) ); + EC_NULL( val = iniparser_getstring(obj->iniconfig, INISEC_GLOBAL, "vol dbpath", _PATH_STATEDIR "CNID/") ); + EC_NULL( dbpath = bformat("%s/%s/", val, tmpname) ); + EC_NULL( volume->v_dbpath = strdup(cfrombstr(dbpath)) ); bdestroy(dbpath); - if (val = getoption(obj->iniconfig, section, "cnid scheme", preset, NULL)) + if ((val = getoption(obj->iniconfig, section, "cnid scheme", preset, NULL))) EC_NULL( volume->v_cnidscheme = strdup(val) ); else volume->v_cnidscheme = strdup(DEFAULT_CNID_SCHEME); - if (val = getoption(obj->iniconfig, section, "umask", preset, NULL)) + if ((val = getoption(obj->iniconfig, section, "umask", preset, NULL))) volume->v_umask = (int)strtol(val, NULL, 8); - if (val = getoption(obj->iniconfig, section, "directory perm", preset, NULL)) + if ((val = getoption(obj->iniconfig, section, "directory perm", preset, NULL))) volume->v_dperm = (int)strtol(val, NULL, 8); - if (val = getoption(obj->iniconfig, section, "file perm", preset, NULL)) + if ((val = getoption(obj->iniconfig, section, "file perm", preset, NULL))) volume->v_fperm = (int)strtol(val, NULL, 8); - if (val = getoption(obj->iniconfig, section, "vol size limit", preset, NULL)) + if ((val = getoption(obj->iniconfig, section, "vol size limit", preset, NULL))) volume->v_limitsize = (uint32_t)strtoul(val, NULL, 10); - if (val = getoption(obj->iniconfig, section, "preexec", preset, NULL)) + if ((val = getoption(obj->iniconfig, section, "preexec", preset, NULL))) EC_NULL( volume->v_preexec = volxlate(obj, NULL, MAXPATHLEN, val, pwd, path, name) ); - if (val = getoption(obj->iniconfig, section, "postexec", preset, NULL)) + if ((val = getoption(obj->iniconfig, section, "postexec", preset, NULL))) EC_NULL( volume->v_postexec = volxlate(obj, NULL, MAXPATHLEN, val, pwd, path, name) ); - if (val = getoption(obj->iniconfig, section, "root preexec", preset, NULL)) + if ((val = getoption(obj->iniconfig, section, "root preexec", preset, NULL))) EC_NULL( volume->v_root_preexec = volxlate(obj, NULL, MAXPATHLEN, val, pwd, path, name) ); - if (val = getoption(obj->iniconfig, section, "root postexec", preset, NULL)) + if ((val = getoption(obj->iniconfig, section, "root postexec", preset, NULL))) EC_NULL( volume->v_root_postexec = volxlate(obj, NULL, MAXPATHLEN, val, pwd, path, name) ); - if (val = getoption(obj->iniconfig, section, "appledouble", preset, NULL)) { + if ((val = getoption(obj->iniconfig, section, "appledouble", preset, NULL))) { if (strcmp(val, "v2") == 0) volume->v_adouble = AD_VERSION2; else if (strcmp(val, "ea") == 0) @@ -714,10 +711,10 @@ static struct vol *creatvol(AFPObj *obj, volume->v_adouble = AD_VERSION; } - if (val = getoption(obj->iniconfig, section, "cnid server", preset, NULL)) { + if ((val = getoption(obj->iniconfig, section, "cnid server", preset, NULL))) { EC_NULL( p = strdup(val) ); volume->v_cnidserver = p; - if (q = strrchr(val, ':')) { + if ((q = strrchr(val, ':'))) { *q++ = 0; volume->v_cnidport = strdup(q); } else { @@ -729,7 +726,7 @@ static struct vol *creatvol(AFPObj *obj, volume->v_cnidport = strdup(obj->options.Cnid_port); } - if (val = getoption(obj->iniconfig, section, "ea", preset, NULL)) { + if ((val = getoption(obj->iniconfig, section, "ea", preset, NULL))) { if (strcasecmp(val, "ad") == 0) volume->v_vfs_ea = AFPVOL_EA_AD; else if (strcasecmp(val, "sys") == 0) @@ -738,7 +735,7 @@ static struct vol *creatvol(AFPObj *obj, volume->v_vfs_ea = AFPVOL_EA_NONE; } - if (val = getoption(obj->iniconfig, section, "casefold", preset, NULL)) { + if ((val = getoption(obj->iniconfig, section, "casefold", preset, NULL))) { if (strcasecmp(val, "tolower") == 0) volume->v_casefold = AFPVOL_UMLOWER; else if (strcasecmp(val, "toupper") == 0) @@ -981,9 +978,7 @@ static int readvolfile(AFPObj *obj, const struct passwd *pwent) char volname[AFPVOL_U8MNAMELEN + 1]; char path[MAXPATHLEN + 1], tmp[MAXPATHLEN + 1]; const char *preset, *default_preset, *p, *basedir; - char *q, *u; int i; - struct passwd *pw; regmatch_t match[1]; LOG(log_debug, logtype_afpd, "readvolfile: BEGIN"); @@ -1034,7 +1029,7 @@ static int readvolfile(AFPObj *obj, const struct passwd *pwent) continue; } - if (p = iniparser_getstring(obj->iniconfig, INISEC_HOMES, "path", NULL)) { + if ((p = iniparser_getstring(obj->iniconfig, INISEC_HOMES, "path", NULL))) { strlcat(tmp, "/", MAXPATHLEN); strlcat(tmp, p, MAXPATHLEN); } @@ -1075,7 +1070,7 @@ static int readvolfile(AFPObj *obj, const struct passwd *pwent) free(realvolpath); } -EC_CLEANUP: +// EC_CLEANUP: EC_EXIT; } @@ -1538,7 +1533,7 @@ struct vol *getvolbypath(AFPObj *obj, const char *path) p++; EC_NULL_LOG( user = strdup(p) ); - if (prw = strchr(user, '/')) + if ((prw = strchr(user, '/'))) *prw++ = 0; if (prw != 0) subpath = prw; @@ -1548,7 +1543,7 @@ struct vol *getvolbypath(AFPObj *obj, const char *path) strlcat(tmpbuf, "/", MAXPATHLEN); /* (6) */ - if (subpathconfig = iniparser_getstring(obj->iniconfig, INISEC_HOMES, "path", NULL)) { + if ((subpathconfig = iniparser_getstring(obj->iniconfig, INISEC_HOMES, "path", NULL))) { /* if (!subpath || strncmp(subpathconfig, subpath, strlen(subpathconfig)) != 0) { EC_FAIL; @@ -1615,8 +1610,8 @@ int afp_config_parse(AFPObj *AFPObj, char *processname) EC_INIT; dictionary *config; struct afp_options *options = &AFPObj->options; - int i, c; - const char *p, *tmp; + int c; + const char *p; char *q, *r; char val[MAXVAL]; diff --git a/libatalk/util/server_child.c b/libatalk/util/server_child.c index ada3e610..547d68d9 100644 --- a/libatalk/util/server_child.c +++ b/libatalk/util/server_child.c @@ -135,7 +135,7 @@ afp_child_t *server_child_add(server_child *children, int forkid, pid_t pid, int fork = (server_child_fork *) children->fork + forkid; /* if we already have an entry. just return. */ - if (child = resolve_child(fork->table, pid)) + if ((child = resolve_child(fork->table, pid))) goto exit; if ((child = calloc(1, sizeof(afp_child_t))) == NULL) @@ -262,7 +262,6 @@ int server_child_transfer_session(server_child *children, EC_INIT; server_child_fork *fork; struct server_child_data *child; - int i; fork = (server_child_fork *) children->fork + forkid; if ((child = resolve_child(fork->table, pid)) == NULL) { diff --git a/libatalk/util/server_ipc.c b/libatalk/util/server_ipc.c index d40e3a49..815c58d8 100644 --- a/libatalk/util/server_ipc.c +++ b/libatalk/util/server_ipc.c @@ -267,8 +267,6 @@ int ipc_server_read(server_child *children, int fd) LOG(log_debug, logtype_afpd, "ipc_server_read(%s): pid: %u", ipc_cmd_str[ipc.command], ipc.child_pid); - int afp_socket; - switch (ipc.command) { case IPC_DISCOLDSESSION: diff --git a/libatalk/util/server_lock.c b/libatalk/util/server_lock.c index 0251eada..6ae817e5 100644 --- a/libatalk/util/server_lock.c +++ b/libatalk/util/server_lock.c @@ -126,9 +126,7 @@ int check_lockfile(const char *program, const char *pidfile) */ int create_lockfile(const char *program, const char *pidfile) { - char buf[10]; FILE *pf; - pid_t pid; int mask; if (check_lockfile(program, pidfile) != 0) diff --git a/libatalk/vfs/unix.c b/libatalk/vfs/unix.c index f414bf59..bc90c75a 100644 --- a/libatalk/vfs/unix.c +++ b/libatalk/vfs/unix.c @@ -166,9 +166,6 @@ int copy_file(int dirfd, const char *src, const char *dst, mode_t mode) int ret = 0; int sfd = -1; int dfd = -1; - ssize_t cc; - size_t buflen; - char filebuf[NETATALK_DIOSZ_STACK]; #ifdef HAVE_ATFUNCS if (dirfd == -1) diff --git a/libatalk/vfs/vfs.c b/libatalk/vfs/vfs.c index 53b53064..3dd3ebb4 100644 --- a/libatalk/vfs/vfs.c +++ b/libatalk/vfs/vfs.c @@ -170,7 +170,6 @@ static int RF_setfilmode_adouble(VFS_FUNC_ARGS_SETFILEMODE) static int RF_setdirunixmode_adouble(VFS_FUNC_ARGS_SETDIRUNIXMODE) { const char *adouble = vol->ad_path(name, ADFLAGS_DIR ); - int dropbox = vol->v_flags; if (dir_rx_set(mode)) { if (chmod_acl(ad_dir(adouble), (DIRBITS | mode) & ~vol->v_umask) < 0 ) @@ -208,7 +207,6 @@ static int setdirmode_adouble_loop(const struct vol *vol, struct dirent *de _U_, static int RF_setdirmode_adouble(VFS_FUNC_ARGS_SETDIRMODE) { - int dropbox = vol->v_flags; mode_t hf_mode = ad_hf_mode(mode); const char *adouble = vol->ad_path(name, ADFLAGS_DIR ); const char *adouble_p = ad_dir(adouble); -- 2.39.2