Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
vsftpd und die Zeit
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
Kleini
Tux's lil' helper
Tux's lil' helper


Joined: 11 Feb 2004
Posts: 112

PostPosted: Sat Jul 16, 2005 3:51 pm    Post subject: vsftpd und die Zeit Reply with quote

Hallo Community!

Ich habe folgendes Problem, welches ich noch nicht gelöst bekommen habe:

Auf meinem FTP-Server läuft vsftpd. Dieser zeigt aber bei Dateiänderungen etc. nicht die aktuelle Zeit, sondern die GMT an. Ich habe auch schon in der Konfigurations-Datei "use_localtime=YES" eingetragen. Auch der Symlink unter /etc/localtime exisitiert. /etc/conf.d/clock ist auch richtig konfiguriert. Sonst funktioniert die Uhr tadellos, nur im vsftpd leider nicht. Selbst die Logs weisen die falsche Zeit auf.
Hat jemand eine Idee was man noch einstellen kann oder ich vergessen habe vielleicht? Danke schonmal für euere Antworten!
Back to top
View user's profile Send private message
schachti
Advocate
Advocate


Joined: 28 Jul 2003
Posts: 3765
Location: Gifhorn, Germany

PostPosted: Sat Jul 16, 2005 5:15 pm    Post subject: Reply with quote

Selbes Phänomen hier, ich suche auch schon nach geraumer Zeit nach einem Workaround, leider erfolglos. :(
_________________
Never argue with an idiot. He brings you down to his level, then beats you with experience.

How-To: Daten verschlüsselt auf DVD speichern.
Back to top
View user's profile Send private message
psyqil
Advocate
Advocate


Joined: 26 May 2003
Posts: 2767

PostPosted: Sat Jul 16, 2005 5:35 pm    Post subject: Reply with quote

Behold my leet google skills! :mrgreen:
http://neacm.fe.up.pt/pub/tugux/prgs/ftp/vsftpd/dist/vsftpd-2.0.1-use_localtime.patch
Code:
--- vsftpd-2.0.1/sysutil.c.use_localtime   2005-01-10 10:05:06.000000000 +0100
+++ vsftpd-2.0.1/sysutil.c   2005-01-10 10:11:18.172815304 +0100
@@ -2372,7 +2372,7 @@
 }
 
 const char*
-vsf_sysutil_get_current_date(void)
+vsf_sysutil_get_current_date(int use_localtime)
 {
   static char datebuf[64];
   time_t curr_time;
@@ -2380,7 +2380,11 @@
   int i = 0;
   vsf_sysutil_update_cached_time();
   curr_time = vsf_sysutil_get_cached_time_sec();
-  p_tm = localtime(&curr_time);
+  if (!use_localtime) { 
+    p_tm = gmtime(&curr_time);
+  } else {
+    p_tm = localtime(&curr_time);
+  }
   if (strftime(datebuf, sizeof(datebuf), "%a %b!%d %H:%M:%S %Y", p_tm) == 0)
   {
     die("strftime");
--- vsftpd-2.0.1/logging.c.use_localtime   2004-07-02 13:23:26.000000000 +0200
+++ vsftpd-2.0.1/logging.c   2005-01-10 10:11:05.716708920 +0100
@@ -171,7 +171,7 @@
   long delta_sec;
   enum EVSFLogEntryType what = (enum EVSFLogEntryType) p_sess->log_type;
   /* Date - vsf_sysutil_get_current_date updates cached time */
-  str_alloc_text(p_str, vsf_sysutil_get_current_date());
+  str_alloc_text(p_str, vsf_sysutil_get_current_date(tunable_use_localtime));
   str_append_char(p_str, ' ');
   /* Transfer time (in seconds) */
   delta_sec = vsf_sysutil_get_cached_time_sec() - p_sess->log_start_sec;
@@ -241,7 +241,7 @@
                              const struct mystr* p_log_str)
 {
   /* Date - vsf_sysutil_get_current_date updates cached time */
-  str_alloc_text(p_str, vsf_sysutil_get_current_date());
+  str_alloc_text(p_str, vsf_sysutil_get_current_date(tunable_use_localtime));
   /* Pid */
   str_append_text(p_str, " [pid ");
   str_append_ulong(p_str, vsf_sysutil_getpid());
--- vsftpd-2.0.1/sysutil.h.use_localtime   2004-06-04 12:11:52.000000000 +0200
+++ vsftpd-2.0.1/sysutil.h   2005-01-10 10:11:23.252043144 +0100
@@ -288,7 +288,7 @@
 void vsf_sysutil_set_umask(unsigned int umask);
 void vsf_sysutil_make_session_leader(void);
 void vsf_sysutil_tzset(void);
-const char* vsf_sysutil_get_current_date(void);
+const char* vsf_sysutil_get_current_date(int use_localtime);
 void vsf_sysutil_qsort(void* p_base, unsigned int num_elem,
                        unsigned int elem_size,
                        int (*p_compar)(const void *, const void *));
Back to top
View user's profile Send private message
Kleini
Tux's lil' helper
Tux's lil' helper


Joined: 11 Feb 2004
Posts: 112

PostPosted: Sat Jul 16, 2005 6:03 pm    Post subject: Reply with quote

Danke für den Patch, den hatte ich noch nicht gefunden. Leider hilft dieser auch nicht weiter, da die aktuelle Version 2.0.3 ist und dort denke ich mal schon der Patch integriert ist. Trotzdem hab ich diese Version und auch die 2.0.2 mit dem Patch kompiliert, aber ohne Erfolg. Selbst die 2.0.1 wies den Fehler auf. Ich glaube es liegt nicht an vsftpd selber, sondern am System.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum