Subject: [netatalk-admins] Funny Dates

From: "Robert B. Bell" <[email-masked]>
Date: Tue, 02 Feb 1999 14:21:04 -0800

Hello,

I have been having problems with dates on my server.

I am using pre-asun2.1.2-4.tar.gz on a Linux 2.0.35 box.

The dates seems to bounce around by 30 years.
This problem would occur when I would copy a file 
from my desktop to the server.

I made the following change to the function ad_refresh()
in libatalk/adouble/ad_open.c 

*** libatalk/adouble/ad_open.c.org	Tue Feb  2 13:54:50 1999
--- libatalk/adouble/ad_open.c	Tue Feb  2 13:55:48 1999
***************
*** 502,508 ****
        
        /* only set dates if the modify dates are way off */
        if (((ad_getdate(ad, AD_DATE_MODIFY | AD_DATE_UNIX, &aint)) == 0) &&
! 	  (aint - st.st_mtime > TIMEWARP_DELTA)) {
  	ad_setdate(ad, AD_DATE_MODIFY | AD_DATE_UNIX, st.st_mtime);
  	ad_getdate(ad, AD_DATE_CREATE | AD_DATE_UNIX, &aint);
  	ad_setdate(ad, AD_DATE_CREATE | AD_DATE_UNIX, aint - AD_DATE_DELTA);
--- 502,510 ----
        
        /* only set dates if the modify dates are way off */
        if (((ad_getdate(ad, AD_DATE_MODIFY | AD_DATE_UNIX, &aint)) == 0) &&
! 	  ((aint > st.st_mtime)         /* is modify date after inode's modify
time */
! 	   ? ((aint - st.st_mtime) > TIMEWARP_DELTA) /* yes, subtract unsigns
this way*/
! 	   : ((st.st_mtime - aint) > TIMEWARP_DELTA))) { /* no, subtract the
other way*/
  	ad_setdate(ad, AD_DATE_MODIFY | AD_DATE_UNIX, st.st_mtime);
  	ad_getdate(ad, AD_DATE_CREATE | AD_DATE_UNIX, &aint);
  	ad_setdate(ad, AD_DATE_CREATE | AD_DATE_UNIX, aint - AD_DATE_DELTA);

which makes the date problem of copying the file from desktop to server 
go away.

Is this a good change?

Also, I was looking at who calls ad_refresh() from etc/afpd.
I only found it in etc/afpd/fork.c.
And ad_refresh() is called with a ad_getdate(ad, AD_DATE_MODIFY...)
and ad_setdate(ad, AD_DATE_MODIFY...) around it.
The AD_DATE_MODIFY is the "variable" that is being checked to see
if the dates are off by 30 years.
(ad_refresh() is also called by libatalk/cnid/cnid_add.c and cnid_nextid.c.)

Is this right?

Thank you,
  Robert Bell.

---

From: PayPC System Mail Subscriber <[email-masked]>
Date: Wed, 3 Feb 1999 21:44:03 +1000

Robert B. Bell said in [netatalk-admins] Funny Dates at 03/Feb/1999 (Wed) 
08:21:04.

> from my desktop to the server.

Me too.  I almost ALWAYS have problems if I copy files to a netatalk zone 
with samba, (or NFS).... I think it's the AppleDouble magic number "fix"....  
Adrian, I think it's prudent to do a one-time "fixup" of the date based on 
the UNIX mod/create dates so that the Macintosh clients don't see files dated 
before most of us were alive...

=Rob=

---

From: Stephen Waters <[email-masked]>
Date: Thu, 04 Feb 1999 12:41:01 -0600

my $0.02,

i think that it would be EXTREMELY nice if netatalk functioned,
at least from a sysadmin/user config perspective, more like samba.
i'm not sure how this would work from a developer's perspective
given that i'm not much of a programmer meself (a little bash ;)

maybe netatalk-asun3.0 or something.

i'd esp. like to see:

1) atalkpasswd == smbpasswd
working at a school, we basically have guest/student and staff
logins. i'd like to eliminate having a home dir for student and
just have 1 file, atalkpasswd, to deal with like in samba.

thanks for listening,

-stephen