[patch] net time set && net time system on FreeBSD box with samba-3.0.11

Pavel Rochnyack rpv at muma.tusur.ru
Thu Mar 10 10:52:11 GMT 2005


Hello Andrew,
Thursday, March 10, 2005, 2:15:55 PM, you wrote:

AB> Is there a standard format that both expect?  #ifdef __FreeBSD__ seems
AB> like entirely the wrong approach - (for example) what does OpenBSD
AB> expect?  

OpenBSD date format is same as on FreeBSD:

date [-anu] [-d dst] [-r seconds] [-t minutes_west] [+format]
          [[[[[[cc]yy]mm]dd]HH]MM[.SS]]

This described on
http://www.openbsd.org/cgi-bin/man.cgi?query=date&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html page.

The NetBSD format is the same ( http://netbsd.gw.com/cgi-bin/man-cgi?date++NetBSD-current ):

 date [-nu] [-r seconds] [+format]
 date [[[[[cc]yy]mm]dd]hh]mm[.ss]

The Solaris format is same as Linux (http://docs.sun.com/app/docs/doc/816-5165/6mbb0m9e7?q=date&a=view)

/usr/bin/date [-u] [[mmdd]HHMM| mmddHHMM[cc]yy] [.SS]


So we have two date formats - for Linux(Solaris) and for xBSD systems.


Simo Sorce <idra at samba.org> wrote:
SS>I think the right patch is to not rely on the default date format, but
SS>specify the format through the +format option.
SS>Can you work out a patch on this line?

Ok, FreeBSD has capabilities to make translation from other formats,
but OpenBSD and NetBSD uses format string only to display date but not set (IMHO).

OpenBSD and NetBSD man page cite:

"An operand with a leading plus sign (`+') signals a user-defined format
string which specifies the format in which to display the date and time."

AB> At the very least, we would need a configure test.

It is not enough to test operation system once ?  I think what format
string doesn`t changes between OS versions.


-- 
Best regards,
 Pavel                            mailto:rpv at muma.tusur.ru



More information about the samba-technical mailing list