/*
- * $Id: afp_dsi.c,v 1.24.2.1 2003-06-06 19:43:12 srittau Exp $
+ * $Id: afp_dsi.c,v 1.24.2.2 2003-06-09 15:09:06 srittau Exp $
*
* Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
it.it_interval.tv_usec = 0;
it.it_value.tv_sec = 300;
it.it_value.tv_usec = 0;
+
if ( setitimer( ITIMER_REAL, &it, 0 ) < 0 ) {
LOG(log_error, logtype_afpd, "afp_timedown: setitimer: %s", strerror(errno) );
afp_dsi_die(1);
if (cmd == DSIFUNC_TICKLE) {
/* so we don't get killed on the client side. */
- if (child.flags & CHILD_DIE)
+ if ((child.flags & CHILD_DIE))
dsi_tickle(dsi);
continue;
- } else if (!(child.flags & CHILD_DIE)) /* reset tickle timer */
+ } else if (!(child.flags & CHILD_DIE)) { /* reset tickle timer */
setitimer(ITIMER_REAL, &dsi->timer, NULL);
+ }
switch(cmd) {
case DSIFUNC_CLOSE:
/*
- * $Id: afp_options.c,v 1.27.2.2 2003-06-09 14:53:14 srittau Exp $
+ * $Id: afp_options.c,v 1.27.2.3 2003-06-09 15:09:06 srittau Exp $
*
* Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
* Copyright (c) 1990,1993 Regents of The University of Michigan.
perror( "gethostname" );
return 0;
}
- if (( p = strchr(options->hostname, '.' )) != 0 ) {
+ if (NULL != ( p = strchr(options->hostname, '.' )) ) {
*p = '\0';
}
- if (( p = strrchr( av[ 0 ], '/' )) == NULL ) {
+ if (NULL == ( p = strrchr( av[ 0 ], '/' )) ) {
p = av[ 0 ];
} else {
p++;
}
- while (( c = getopt( ac, av, OPTIONS )) != EOF ) {
+ while (EOF != ( c = getopt( ac, av, OPTIONS )) ) {
switch ( c ) {
case 'd' :
options->flags |= OPTION_DEBUG;
/*
- * $Id: appl.c,v 1.8 2002-10-11 14:18:25 didg Exp $
+ * $Id: appl.c,v 1.7.2.1 2003-06-09 15:09:06 srittau Exp $
*
* Copyright (c) 1990,1993 Regents of The University of Michigan.
* All Rights Reserved. See COPYRIGHT.
strncpy( p, path, strlen( path ));
while ( dir->d_parent != NULL ) {
- p -= strlen( dir->d_m_name ) + 1;
- strcpy( p, dir->d_m_name );
+ p -= strlen( dir->d_name ) + 1;
+ strcpy( p, dir->d_name );
dir = dir->d_parent;
}
return( p );
int tfd, cc;
u_int32_t did;
u_int16_t vid, mplen;
- struct path *path;
- char *dtf, *p, *mp;
+ char *path, *dtf, *p, *mp;
u_char creator[ 4 ];
u_char appltag[ 4 ];
char *mpath, *tempfile;
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid ))) {
return( AFPERR_PARAM );
}
memcpy( &did, ibuf, sizeof( did ));
ibuf += sizeof( did );
- if (( dir = dirlookup( vol, did )) == NULL ) {
+ if (NULL == ( dir = dirlookup( vol, did )) ) {
return( AFPERR_NOOBJ );
}
memcpy( appltag, ibuf, sizeof( appltag ));
ibuf += sizeof( appltag );
- if (( path = cname( vol, dir, &ibuf )) == NULL ) {
+ if (NULL == ( path = cname( vol, dir, &ibuf )) ) {
return( AFPERR_NOOBJ );
}
- if ( *path->m_name == '\0' ) {
+ if ( *path == '\0' ) {
return( AFPERR_BADTYPE );
}
return( AFPERR_PARAM );
}
mpath = obj->newtmp;
- mp = makemacpath( mpath, AFPOBJ_TMPSIZ, curdir, path->m_name );
+ mp = makemacpath( mpath, AFPOBJ_TMPSIZ, curdir, path );
mplen = mpath + AFPOBJ_TMPSIZ - mp;
/* write the new appl entry at start of temporary file */
int tfd, cc;
u_int32_t did;
u_int16_t vid, mplen;
- struct path *path;
- char *dtf, *mp;
+ char *path, *dtf, *mp;
u_char creator[ 4 ];
char *tempfile, *mpath;
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid ))) {
return( AFPERR_PARAM );
}
memcpy( &did, ibuf, sizeof( did ));
ibuf += sizeof( did );
- if (( dir = dirlookup( vol, did )) == NULL ) {
+ if (NULL == ( dir = dirlookup( vol, did )) ) {
return( AFPERR_NOOBJ );
}
memcpy( creator, ibuf, sizeof( creator ));
ibuf += sizeof( creator );
- if (( path = cname( vol, dir, &ibuf )) == NULL ) {
+ if (NULL == ( path = cname( vol, dir, &ibuf )) ) {
return( AFPERR_NOOBJ );
}
- if ( *path->m_name == '\0' ) {
+ if ( *path == '.' ) {
return( AFPERR_BADTYPE );
}
return( AFPERR_PARAM );
}
mpath = obj->newtmp;
- mp = makemacpath( mpath, AFPOBJ_TMPSIZ, curdir, path->m_name );
+ mp = makemacpath( mpath, AFPOBJ_TMPSIZ, curdir, path );
mplen = mpath + AFPOBJ_TMPSIZ - mp;
cc = copyapplfile( sa.sdt_fd, tfd, mp, mplen );
close( tfd );
char *ibuf, *rbuf;
int ibuflen, *rbuflen;
{
+ struct stat st;
struct vol *vol;
char *p, *q;
int cc, buflen;
u_char creator[ 4 ];
u_char appltag[ 4 ];
char *buf, *cbuf;
- struct path *path;
-
+
ibuf += 2;
memcpy( &vid, ibuf, sizeof( vid ));
ibuf += sizeof( vid );
- if (( vol = getvolbyvid( vid )) == NULL ) {
+ if (NULL == ( vol = getvolbyvid( vid )) ) {
*rbuflen = 0;
return( AFPERR_PARAM );
}
memcpy( q, p, len );
q = cbuf;
- if (( path = cname( vol, vol->v_dir, &q )) == NULL ) {
+ if (( p = cname( vol, vol->v_dir, &q )) == NULL ) {
*rbuflen = 0;
return( AFPERR_NOITEM );
}
- if ( *path->m_name == '\0' || path->st_errno ) {
+ if ( stat( mtoupath(vol, p), &st ) < 0 ) {
*rbuflen = 0;
return( AFPERR_NOITEM );
}
buflen = *rbuflen - sizeof( bitmap ) - sizeof( appltag );
- if ( getfilparams(vol, bitmap, path, curdir, rbuf + sizeof( bitmap ) +
+ if ( getfilparams(vol, bitmap, p, curdir, &st, rbuf + sizeof( bitmap ) +
sizeof( appltag ), &buflen ) != AFP_OK ) {
*rbuflen = 0;
return( AFPERR_BITMAP );