On Fri, Jul 08, 2011 at 04:53:19PM +0200, Samuel Ortiz wrote: > Hi Arron, > > On Wed, Jun 29, 2011 at 11:13:03PM -0400, [email protected] wrote: > > From: arron <[email protected]> > > > > When we update timezone info, we write changes to /etc/localtime, but > > sometimes file /etc/localtime is a symlink, then inotify to watch this > > file can't reflect the status of timezone update, also may change the > > linked file. > > The default umask value in connman is 0077, then when /etc/localtime > > does not exists, the new created file can't be accessed by normal user > > program. > Those are 2 different issues, and I usually expect to get 2 different patches > for it. But: > > > > + if (lstat(pathname, &st) == 0) { > > + if (S_ISLNK(st.st_mode)) > > + unlink(pathname); > > + } > > + > > + old_mask = umask(0022); > > fd = open(pathname, O_WRONLY | O_CREAT | O_TRUNC, 0644); > The new /etc/localtime will be created with the right permissions, ie rw for > root, r for group and r for others. So everyone should have read permissions > on the /etc/localtime created by ConnMan. > Thus, I don't think it's necessary to set umask. I applied your patch without the umask version.
Cheers, Samuel. -- Intel Open Source Technology Centre http://oss.intel.com/ _______________________________________________ connman mailing list [email protected] http://lists.connman.net/listinfo/connman
