[ntp:questions] Re: Why Root is BRST and Normal User is UTC?

Leonardo leonardomachado at gmail.com
Tue Nov 9 09:29:22 UTC 2004


mfuhr at fuhr.org (Michael Fuhr) wrote in message news:<418aa20b_1 at omega.dimensional.com>...
> leonardomachado at gmail.com (Leonardo) writes:
> 
> > When I am root I get the right BRST time. When I am a normal user I
> > get UTC time. Why that? I have no Alias for the date command.
> >
> > $ date
> > Thu Nov  4 21:21:12 UTC 2004
> > $ su
> > # date
> > Thu Nov  4 19:21:16 BRST 2004
> 
> Does one of these users have the TZ environment variable set?
> Run "echo $TZ" in both shells and see what you get.
> 
> Another possibility is that a timezone file is readable only by
> root.  You could trace the "date" command to see what files it wants
> to access.  The command for doing a trace differs from system to
> system: strace, ktrace, trace, truss, etc.

---------------
$ strace date 2>&1 | grep etc

access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/etc/localtime", O_RDONLY)        = -1 EACCES (Permission denied)
-----------------

The problem, as you see above, is exactly what you said.

Thank you very much Mike!

--
Leo.



More information about the questions mailing list