Subject: [netatalk-admins] a15 patchset available

From: a sun <[email-masked]>
Date: Thu, 28 Aug 1997 11:38:25 -0700 (PDT)

i've decided to make an "official" a15 available so that i can
re-engineer the read/write routines for a16 as well as merge in
various feature patches. anyways, this patch set fixes some, but not
all, of the os8 interaction problems. it also plugs a few holes as
well as deals w/ errors a little better. per a suggestion made by wes,
i moved the multicast configuration in atalkd to a better place. now,
if you have a network interface that doesn't support hardware
multicast, atalkd will just skip it.

as always, you can get it at ftp.u.washington.edu:/public/asun.

tar'ed file:  netatalk-1.4b2+asun2.0a15.tar.gz
1.4b2 -> a15: 1.4b2-2.0a15.diff.gz
a14 -> a15:   a14-a15.diff.gz

-a (is for adrian)

---

From: Patrick Gardella <[email-masked]>
Date: Thu, 28 Aug 1997 15:46:01 -0400 (EDT)

Downloaded it (netatalk-1.4b2+asun2.0a15.tar.gz) and did make.

And I got the following error:
building profiled adoublelib
building normal adoublelib
<snip>
gcc -p -DBSD4_4 -DTCPWRAP -O2 -I../../include -c dsi_tcp.c
dsi_tcp.c:25: tcpd.h: No such file or directory
*** Error code 1

Stop.

Am I doing something wrong?  Or is the file missing?

I am on a FreeBSD 2.2.1 machine.

Patrick

>a14 -> a15:   a14-a15.diff.gz

----------------------------------
E-Mail: Patrick Gardella <[email-masked]>
Date: 28-Aug-97
Time: 15:46:01

This message was sent by XFMail
----------------------------------

---

From: Mike Holling <[email-masked]>
Date: Thu, 28 Aug 1997 15:59:21 -0400 (EDT)

> I am on a FreeBSD 2.2.1 machine.

I got this running a couple hours ago.  I had to add /usr/local/include
and /usr/local/lib in some of the makefiles.  Also, there was a variable
declaration missing in one of the routines in auth.c.  Works much better
(for me) than a14, however.

- Mike

---

From: [email-masked]
Date: Thu, 28 Aug 1997 16:11:25 -0400

> From:    a sun <[email-masked]>
> To:      [email-masked]

> anyways, this patch set fixes some, but not
> all, of the os8 interaction problems.

Find attached the set of patches (thus far) for MacOS 8.  It fixes
everything that I've had reported so far, i.e. "dancing" in the finder,
and failed finder copies when there's no AppleDouble header file.

I've given these patches to a couple of people, but since I've not
gotten any responses back, I'll no hold them any longer.

:wes
*** etc/afpd/file.c-	1997/08/17 00:01:46
--- etc/afpd/file.c	1997/08/20 22:39:08
***************
*** 125,139 ****
  	    break;
  
  	case FILPBIT_FINFO :
! 	    if ( !isad ||
! 		    bcmp( ad_entry( &ad, ADEID_FINDERI ), ufinderi, 8 ) == 0 ) {
  		bcopy( ufinderi, data, 32 );
- 		if (( em = getextmap( path )) != NULL ) {
- 		    bcopy( em->em_type, data, sizeof( em->em_type ));
- 		    bcopy( em->em_creator, data + 4, sizeof( em->em_creator ));
- 		}
  	    } else {
  		bcopy( ad_entry( &ad, ADEID_FINDERI ), data, 32 );
  	    }
  	    data += 32;
  	    break;
--- 125,139 ----
  	    break;
  
  	case FILPBIT_FINFO :
! 	    if ( !isad ) {
  		bcopy( ufinderi, data, 32 );
  	    } else {
  		bcopy( ad_entry( &ad, ADEID_FINDERI ), data, 32 );
+ 	    }
+ 	    if ( bcmp( data, ufinderi, 8 ) == 0 &&
+ 		    ( em = getextmap( path )) != NULL ) {
+ 		bcopy( em->em_type, data, sizeof( em->em_type ));
+ 		bcopy( em->em_creator, data + 4, sizeof( em->em_creator ));
  	    }
  	    data += 32;
  	    break;
*** etc/afpd/fork.c-	1997/08/17 00:01:46
--- etc/afpd/fork.c	1997/08/26 03:50:24
***************
*** 95,108 ****
  
      if ( ad_open( mtoupath( path ), adflags, oflags, 0,
  		&ofork->of_ad ) < 0 ) {
! 	if ( errno == ENOENT && adflags != ADFLAGS_HF ) {
  	    ad_close( &ofork->of_ad, adflags );
! 	    if ( ad_open( mtoupath( path ), ADFLAGS_DF, oflags, 0,
! 		    &ofork->of_ad ) < 0 ) {
! 		ad_close( &ofork->of_ad, ADFLAGS_DF );
! 		of_dealloc( ofork );
! 		*rbuflen = 0;
! 		return( AFPERR_NOOBJ );
  	    }
  	} else {
  	    of_dealloc( ofork );
--- 95,110 ----
  
      if ( ad_open( mtoupath( path ), adflags, oflags, 0,
  		&ofork->of_ad ) < 0 ) {
! 	if ( errno == ENOENT ) {
  	    ad_close( &ofork->of_ad, adflags );
! 	    if ( adflags != ADFLAGS_HF ) {
! 		if ( ad_open( mtoupath( path ), ADFLAGS_DF, oflags, 0,
! 			&ofork->of_ad ) < 0 ) {
! 		    ad_close( &ofork->of_ad, ADFLAGS_DF );
! 		    of_dealloc( ofork );
! 		    *rbuflen = 0;
! 		    return( AFPERR_NOOBJ );
! 		}
  	    }
  	} else {
  	    of_dealloc( ofork );
***************
*** 171,176 ****
--- 173,181 ----
  	lockfd = ad_dfileno( &ofork->of_ad );
      } else {
  	lockfd = ad_hfileno( &ofork->of_ad );
+ 	if ( lockfd == -1 ) {
+ 	    lockop = 0;
+ 	}
      }
      if ( lockop && flock( lockfd, lockop|LOCK_NB ) < 0 ) {
  	ret = errno;
***************
*** 318,325 ****
  
      if ( ad_dfileno( &ofork->of_ad ) != -1 ) {
  	eid = ADEID_DFORK;
!     } else {
  	eid = ADEID_RFORK;
      }
  
      if ( reqcount < 0 ) {
--- 323,333 ----
  
      if ( ad_dfileno( &ofork->of_ad ) != -1 ) {
  	eid = ADEID_DFORK;
!     } else if ( ad_hfileno( &ofork->of_ad ) != -1 ) {
  	eid = ADEID_RFORK;
+     } else {
+ 	*rbuflen = 0;
+ 	return( AFPERR_EOF );
      }
  
      if ( reqcount < 0 ) {
***************
*** 548,555 ****
  	    *rbuflen = 0;
  	    return( AFPERR_DFULL );
  	default :
- 	    syslog( LOG_ERR, "afp_write: ad_write: %m" );
  	    *rbuflen = 0;
  	    return( AFPERR_PARAM );
  	}
      }
--- 556,563 ----
  	    *rbuflen = 0;
  	    return( AFPERR_DFULL );
  	default :
  	    *rbuflen = 0;
+ 	    syslog( LOG_ERR, "afp_write: ad_write: %m" );
  	    return( AFPERR_PARAM );
  	}
      }
***************
*** 642,649 ****
      }
      if ( bitmap & ( 1<<FILPBIT_DFLEN | 1<<FILPBIT_FNUM )) {
  	if ( ad_dfileno( &ofork->of_ad ) == -1 ) {
! 	    if ( fstat( ad_hfileno( &ofork->of_ad ), &st ) < 0 ) {
! 		return( AFPERR_BITMAP );
  	    }
  	} else {
  	    if ( fstat( ad_dfileno( &ofork->of_ad ), &st ) < 0 ) {
--- 650,657 ----
      }
      if ( bitmap & ( 1<<FILPBIT_DFLEN | 1<<FILPBIT_FNUM )) {
  	if ( ad_dfileno( &ofork->of_ad ) == -1 ) {
! 	    if ( stat( mtoupath( ofork->of_name ), &st ) < 0 ) {
! 		return( AFPERR_NOOBJ );
  	    }
  	} else {
  	    if ( fstat( ad_dfileno( &ofork->of_ad ), &st ) < 0 ) {
***************
*** 710,724 ****
  	    break;
  
  	case FILPBIT_FINFO :
! 	    if ( !isad || bcmp( ad_entry( &ofork->of_ad, ADEID_FINDERI ),
! 		    ufinderi, 8 ) == 0 ) {
  		bcopy( ufinderi, data, 32 );
- 		if (( em = getextmap( ofork->of_name )) != NULL ) {
- 		    bcopy( em->em_type, data, sizeof( em->em_type ));
- 		    bcopy( em->em_creator, data + 4, sizeof( em->em_creator ));
- 		}
  	    } else {
  		bcopy( ad_entry( &ofork->of_ad, ADEID_FINDERI ), data, 32 );
  	    }
  	    data += 32;
  	    break;
--- 718,732 ----
  	    break;
  
  	case FILPBIT_FINFO :
! 	    if ( !isad ) {
  		bcopy( ufinderi, data, 32 );
  	    } else {
  		bcopy( ad_entry( &ofork->of_ad, ADEID_FINDERI ), data, 32 );
+ 	    }
+ 	    if ( bcmp( data, ufinderi, 8 ) == 0 &&
+ 		    ( em = getextmap( ofork->of_name )) != NULL ) {
+ 		bcopy( em->em_type, data, sizeof( em->em_type ));
+ 		bcopy( em->em_creator, data + 4, sizeof( em->em_creator ));
  	    }
  	    data += 32;
  	    break;

---

From: a sun <[email-masked]>
Date: Thu, 28 Aug 1997 13:30:18 -0700 (PDT)

Stop.

you're missing afpd.h. if you don't want to use tcp wrappers, go into
sys/freebsd/Makefile and get rid of the -DTCPWRAP.

-a

---

From: Patrick Gardella <[email-masked]>
Date: Fri, 29 Aug 1997 10:01:43 -0400 (EDT)

Mike,

What did you declare "p" to be in auth.c?  It looked to be a char, 
but I want to make sure.

Pat

Date: 29-Aug-97
Time: 10:01:43

---

From: Mike Holling <[email-masked]>
Date: Fri, 29 Aug 1997 12:22:02 -0400 (EDT)

> What did you declare "p" to be in auth.c?  It looked to be a char, 

It's a char *:

clrtxt_login(obj, ibuf, ibuflen, rbuf, rbuflen )
    AFPObj      *obj;
    char        *ibuf, *rbuf;
    int         ibuflen, *rbuflen;
{
    struct passwd       *pwd;
    int                 len;
    char                *p;

It's only used here:

        p = crypt( ibuf, pwd->pw_passwd );
        if ( strcmp( p, pwd->pw_passwd ) == 0 ) {
            return( login( pwd->pw_name, pwd->pw_uid, pwd->pw_gid ));

- Mike