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;
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;
return (1);
}
acl_free(acl);
-#endif
return (0);
}
+#endif
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:
}
}
-exit:
closevol(&dvolume);
return rval;
}
}
return 0;
}
-
-static void
-preserve_fd_acls(int source_fd,
- int dest_fd,
- const char *source_path,
- const char *dest_path)
-{
- ;
-}
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);
int ad_set(int argc, char **argv, AFPObj *obj)
{
- int c, firstarg;
+ int c;
afpvol_t vol;
struct stat st;
int adflags = 0;
"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;
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
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) {
EC_EXIT;
}
+#if 0
/*!
* Add entries of one acl to another acl
*
EC_CLEANUP:
EC_EXIT;
}
+#endif
/*!
* Map Darwin ACE rights to POSIX 1e perm
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.
*/
int ret;
uint32_t allowed_rights = 0;
char *username = NULL;
- uuidtype_t uuidtype;
struct stat st;
bstring parent = NULL;
int is_dir;
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;
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;
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))
/* 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);
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",
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",
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... */
dirpos = opendir(".");
if (dirpos == NULL)
- dirpos = opendir(bdata(currentdir->d_fullpath));
+ dirpos = opendir(cfrombstr(currentdir->d_fullpath));
if (error || dirpos == NULL) {
switch (errno) {
#include <atalk/netatalk_conf.h>
#include <atalk/unix.h>
#include <atalk/bstrlib.h>
+#include <atalk/bstradd.h>
#include <atalk/errchk.h>
#include "volume.h"
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 ) {
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 ) {
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) );
}
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);
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();
int dircache_add(const struct vol *vol,
struct dir *dir)
{
- struct dir *cdir = NULL;
struct dir key;
hnode_t *hn;
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);
}
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 );
(1 << FCE_DIR_CREATE);
#define MAXIOBUF 1024
-static char iobuf[MAXIOBUF];
+static unsigned char iobuf[MAXIOBUF];
static const char *skip_files[] =
{
".DS_Store",
{
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) );
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);
}
int main( int argc, char*argv[] )
{
- int c,ret;
+ int c;
char *port = FCE_DEFAULT_PORT_STRING;
char *host = "localhost";
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 );
struct stat *st;
uint16_t bshort;
struct path *s_path;
- struct stat xxx;
ibuf++;
fork = *ibuf++;
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 ) {
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)",
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 */
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;
+(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;
return hash;
}
-static int hash_comp_default(const void *key1, const void *key2)
-{
- return strcmp(key1, key2);
-}
-
-#ifdef KAZLIB_TEST_MAIN
-
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
int main(int ac, char **av)
{
- fd_set rfds;
- void *ipc;
struct sigaction sv;
sigset_t sigs;
int ret;
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,
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;
data += offset;
char *DirectoryNamesCount = data++;
- char *DirectoryNames = data;
size_t size = sizeof(uint8_t);
*DirectoryNamesCount = 0;
}
krb5_unparse_name(context, entry.principal, &principal);
- krb5_kt_free_entry(context, &entry);
+ krb5_free_keytab_entry_contents(context, &entry);
append_directoryname(&data,
offset,
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);
char *servername_conf;
int header = 0;
char buf[1024], *p;
- FILE *fp = NULL, *randomp;
+ FILE *fp = NULL;
size_t len;
char *server_tmp;
DIR *dir = NULL;
const struct dirent *entry;
const char *p;
- struct stat st;
long int links;
time_t now = time(NULL);
{
int spaceflag, rc;
uint32_t maxsize;
- VolSpace used;
#ifndef NO_QUOTA_SUPPORT
VolSpace qfree, qtotal;
#endif
{
struct stat st;
char *volname;
- char *p;
struct vol *volume;
struct dir *dir;
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
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.
*/
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 */
*/
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);
*/
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;
#include <atalk/compat.h>
#include <atalk/errchk.h>
#include <atalk/bstrlib.h>
+#include <atalk/bstradd.h>
#include <atalk/netatalk_conf.h>
#include <atalk/volume.h>
static int set_dbdir(const char *dbdir, const char *vpath)
{
EC_INIT;
- int status;
struct stat st;
bstring oldpath, newpath;
char *cmd_argv[4];
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);
}
- 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;
}
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_)
{
int cc;
uid_t uid = 0;
gid_t gid = 0;
- int err = 0;
int debug = 0;
int ret;
sigset_t set;
(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;
#include <atalk/logger.h>
#include <atalk/errchk.h>
#include <atalk/bstrlib.h>
+#include <atalk/bstradd.h>
#include <atalk/netatalk_conf.h>
#include <atalk/util.h>
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) {
EC_INIT;
int delete_bdb = 0;
int ctrlfd = -1, clntfd = -1;
- char *logconfig;
AFPObj obj = { 0 };
char *volpath = NULL;
/* 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;
/* 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");
/* timer callback */
static void timer_cb(evutil_socket_t fd, short what, void *arg)
{
- static int i = 0;
-
if (in_shutdown)
return;
int main(int argc, char **argv)
{
- const char *configfile = NULL;
int c, ret, debug = 0;
sigset_t blocksigs;
struct timeval tv;
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));
}
/* 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);
*rbuflen += sizeof(sessid);
/* public key */
- BN_bn2bin(dh->pub_key, rbuf);
+ BN_bn2bin(dh->pub_key, (unsigned char *)rbuf);
rbuf += KEYSIZE;
*rbuflen += KEYSIZE;
#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);
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))) {
}
/* 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));
cleanup_client_name:
gss_release_name(&status, &client_name);
-
-cleanup_context:
gss_release_buffer(&status, &authenticator_buff);
gss_delete_sec_context(&status, &context, NULL);
void uuidcache_dump(void) {
int i;
- int ret = 0;
cacheduser_t *entry;
char timestr[200];
struct tm *tmp = NULL;
char *name = NULL;
unsigned char *uuid = NULL;
cacheduser_t *cacheduser = NULL;
- cacheduser_t *entry;
unsigned char hash;
/* allocate mem and copy values */
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')) {
add_cachebyname(name, uuid, mytype, 0);
}
-cleanup:
#ifdef HAVE_LDAP
if (uuid_string) free(uuid_string);
#endif
EC_INIT;
struct adouble adv2;
struct adouble adea;
- const char *adpath;
int adflags;
uint32_t ctime, mtime, afpinfo = 0;
char *emptyad;
{
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;
uint32_t temp;
uint16_t nent;
char *buf, *nentp;
- int len;
LOG(log_debug, logtype_ad, "ad_rebuild_adouble_header_v2");
uint32_t temp;
uint16_t nent;
char *buf, *nentp;
- int len;
LOG(log_debug, logtype_ad, "ad_rebuild_adouble_header_ea");
uint32_t temp;
uint16_t nent;
char *buf;
- int len;
LOG(log_debug, logtype_ad, "ad_rebuild_adouble_header_osx");
uint16_t ad_openforks(struct adouble *ad, uint16_t attrbits)
{
uint16_t ret = 0;
- struct ad_fd *adf;
off_t off;
off_t len;
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);
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_)
{
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;
int oflags;
int opened = 0;
int closeflags = adflags & (ADFLAGS_DF | ADFLAGS_HF);
- ssize_t rlen;
#ifndef HAVE_EAFD
const char *rfpath;
struct stat st;
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)
EC_INIT;
struct stat st;
ssize_t cc;
- size_t roundup;
off_t r_off;
if (ad_data_fileno(ad) == AD_SYMLINK) {
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 );
*/
bstring brefcstr (char *str) {
bstring b;
- int i;
size_t j;
if (str == NULL)
b->slen = (int) j;
b->mlen = -1;
- b->data = str;
+ b->data = (unsigned char *)str;
return b;
}
}
/* 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;
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);
}
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;
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");
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)
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);
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)
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;
}
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) {
}
/* 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) {
* 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");
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)
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);
/* 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) {
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;
/* 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)) {
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) {
char line [ASCIILINESZ+1] ;
char section [ASCIILINESZ+1] ;
char key [ASCIILINESZ+1] ;
- char tmp [ASCIILINESZ+1] ;
char val [ASCIILINESZ+1] ;
int last=0 ;
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-
#include "tdb_private.h"
/* check for an out of bounds access - if it is out of bounds then
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
-#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 <unistd.h>
#include <stdint.h>
#include <stdio.h>
#include <errno.h>
#include <sys/param.h>
+#include <stddef.h>
#ifndef __STRING
#define __STRING(x) #x
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)
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++;
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++;
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;
}
/* Binary Search for BMP */
- else if (result = do_precomposition(base, comb)) {
+ else if ((result = do_precomposition(base, comb))) {
base = result;
}
#include <atalk/uuid.h>
#include <atalk/netatalk_conf.h>
#include <atalk/bstrlib.h>
+#include <atalk/bstradd.h>
#define VOLPASSLEN 8
#ifndef UUID_PRINTABLE_STRING_LENGTH
*/
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;
*/
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;
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");
}
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);
}
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)
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 {
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)
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)
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");
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);
}
free(realvolpath);
}
-EC_CLEANUP:
+// EC_CLEANUP:
EC_EXIT;
}
p++;
EC_NULL_LOG( user = strdup(p) );
- if (prw = strchr(user, '/'))
+ if ((prw = strchr(user, '/')))
*prw++ = 0;
if (prw != 0)
subpath = prw;
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;
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];
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)
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) {
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:
*/
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)
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)
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 )
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);