Dr. Volker Zell | 1 Dec 2003 10:07
Picon
Favicon

[PATCH] localtime.cc: Point TZDIR to the /usr/share/zoneinfo

Hi

As discussed in cygwin-apps here's a small patch to point cygwin to an existing
time zone datasbase when the tzcode/data package is installed.

2003-12-01  Dr. Volker Zell  <Dr.Volker.Zell <at> oracle.com>

	* include/tzfile.h: Remove duplicate definition of TM_SUNDAY.
	* localtime.cc: Point TZDIR to the /usr/share/zoneinfo directory used
	by the tzcode package.

Ciao
  Volker

Attachment (timzone.patch): text/x-patch, 1206 bytes
Corinna Vinschen | 1 Dec 2003 11:23
Favicon

Re: [PATCH]: Add flock syscall emulation

On Sun, Nov 30, 2003 at 12:57:48PM -0500, Nicholas Wourms wrote:
> Corinna wrote:
> >I've run indent on flock.c since its formatting was non-GNU.
> 
> I can understand why you did it in this case (the tabs were out of 
> control), but can we make an exception for bsd/isc-derived code?  I 
> think that enforcing this rule strictly on written-from-scratch source 
> is ok, but doing it on derived source reduces the overall transparency 
> of changes against the upstream version.

I see.  Is that necessary for flock?  It's not BSD derived and will
not likely need another external update.

However, we have a problem here, which I just saw when looking into
the flock code another time.  The newlib defintion of `struct flock'
isn't 64 bit aware and it doesn't adhere to the SUSv3 definition.  :-(
It uses 'long' as datatypes for l_start and l_len but these should
be off_t.

So we need to define flock32 and flock64 structs and change the fcntl
interface to accept both.  Sic.

Corinna

--

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin <at> cygwin.com
Red Hat, Inc.

(Continue reading)

Corinna Vinschen | 1 Dec 2003 11:28
Favicon

Re: [PATCH] localtime.cc: Point TZDIR to the /usr/share/zoneinfo

On Mon, Dec 01, 2003 at 10:07:25AM +0100, Dr. Volker Zell wrote:
> Hi
> 
> As discussed in cygwin-apps here's a small patch to point cygwin to an existing
> time zone datasbase when the tzcode/data package is installed.

Should we do some extra stuff to maintain backward compatibility with
the old /usr/local/etc path?  I don't think so but...

Corinna

--

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin <at> cygwin.com
Red Hat, Inc.

Corinna Vinschen | 1 Dec 2003 11:39
Favicon

Re: [PATCH] localtime.cc: Point TZDIR to the /usr/share/zoneinfo

On Mon, Dec 01, 2003 at 11:28:07AM +0100, Corinna Vinschen wrote:
> On Mon, Dec 01, 2003 at 10:07:25AM +0100, Dr. Volker Zell wrote:
> > Hi
> > 
> > As discussed in cygwin-apps here's a small patch to point cygwin to an existing
> > time zone datasbase when the tzcode/data package is installed.
> 
> Should we do some extra stuff to maintain backward compatibility with
> the old /usr/local/etc path?  I don't think so but...

I've applied the patch as is for now.

Thanks,
Corinna

--

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin <at> cygwin.com
Red Hat, Inc.

Corinna Vinschen | 1 Dec 2003 12:18
Favicon

Re: [Patch]: Create Global Privilege

On Sun, Nov 30, 2003 at 12:07:22AM +0100, Corinna Vinschen wrote:
> On Wed, Nov 26, 2003 at 10:45:57AM -0500, Pierre A. Humblet wrote:
> > At 03:32 PM 11/26/2003 +0100, Corinna Vinschen wrote:
> > >Imagine a sshd service is running on the system.  This service has the
> > >SE_CREATE_GLOBAL_NAME privilege and would create the global object on
> > >system startup (given the service is in automatic mode).  Other processes
> > >would then be able to access the global object, regardless if running in
> > >a terminal session or not.  This would keep the process list together,
> > >for instance.
> > [...]
> > The problem with the track you start on is that one can end up with a
> > split system, e.g. the cygwin share in global space and a tty in local
> > space, invisible to the rest of the system. I am unsure of what can
> > happen then. Also the user share could be either global or local, depending
> > if a user (or a seteuid process) is already running at the console/service
> > at the moment a session starts under Terminal Services. 
> > That leads to indeterminate behavior.
> 
> If we make sure that the first process started in a process hirarchy
> determines where the shared mem is, that shouldn't be a problem.  The
> decision should be made only once.

I've applied the patch which just a minor change to remove the
`if (!prefix)'.

However, I think the right thing to do would be to add prefix to
cygheap_init so that it survives exec(2) calls.

Chris, any problem with this?  It's another 8 bytes...

(Continue reading)

Christopher Faylor | 1 Dec 2003 14:57
Picon
Favicon

Re: [Patch]: Create Global Privilege

On Mon, Dec 01, 2003 at 12:18:05PM +0100, Corinna Vinschen wrote:
>On Sun, Nov 30, 2003 at 12:07:22AM +0100, Corinna Vinschen wrote:
>> On Wed, Nov 26, 2003 at 10:45:57AM -0500, Pierre A. Humblet wrote:
>> > At 03:32 PM 11/26/2003 +0100, Corinna Vinschen wrote:
>> > >Imagine a sshd service is running on the system.  This service has the
>> > >SE_CREATE_GLOBAL_NAME privilege and would create the global object on
>> > >system startup (given the service is in automatic mode).  Other processes
>> > >would then be able to access the global object, regardless if running in
>> > >a terminal session or not.  This would keep the process list together,
>> > >for instance.
>> > [...]
>> > The problem with the track you start on is that one can end up with a
>> > split system, e.g. the cygwin share in global space and a tty in local
>> > space, invisible to the rest of the system. I am unsure of what can
>> > happen then. Also the user share could be either global or local, depending
>> > if a user (or a seteuid process) is already running at the console/service
>> > at the moment a session starts under Terminal Services. 
>> > That leads to indeterminate behavior.
>> 
>> If we make sure that the first process started in a process hirarchy
>> determines where the shared mem is, that shouldn't be a problem.  The
>> decision should be made only once.
>
>I've applied the patch which just a minor change to remove the
>`if (!prefix)'.
>
>However, I think the right thing to do would be to add prefix to
>cygheap_init so that it survives exec(2) calls.
>
>Chris, any problem with this?  It's another 8 bytes...
(Continue reading)

Nicholas Wourms | 1 Dec 2003 15:42

Re: [PATCH] localtime.cc: Point TZDIR to the /usr/share/zoneinfo

cygwin-patches <at> cygwin.com wrote:
> On Mon, Dec 01, 2003 at 10:07:25AM +0100, Dr. Volker Zell wrote:
> 
>>Hi
>>
>>As discussed in cygwin-apps here's a small patch to point cygwin to an existing
>>time zone datasbase when the tzcode/data package is installed.
> 
> 
> Should we do some extra stuff to maintain backward compatibility with
> the old /usr/local/etc path?  I don't think so but...
>

As mentioned in another thread, in theory this should be an evironmental 
variable.  However, IIRC, I think DJ ripped out that portion of the 
code, probably assuming at the time there was no need for timezone data. 
  I'll go back and check, though.

Cheers,
Nicholas

Igor Pechtchanski | 1 Dec 2003 17:50
Picon

Re: [PATCH] localtime.cc: Point TZDIR to the /usr/share/zoneinfo

On Mon, 1 Dec 2003, Corinna Vinschen wrote:

> On Mon, Dec 01, 2003 at 10:07:25AM +0100, Dr. Volker Zell wrote:
> > Hi
> >
> > As discussed in cygwin-apps here's a small patch to point cygwin to an existing
> > time zone datasbase when the tzcode/data package is installed.
>
> Should we do some extra stuff to maintain backward compatibility with
> the old /usr/local/etc path?  I don't think so but...
>
> Corinna

That's pretty much what I suggested in
<http://cygwin.com/ml/cygwin-apps/2003-11/msg00443.html>.  Right now, the
code is not $TZDIR-aware, AFAICS.  IMO, having it first check the TZDIR
environment variable, and if that's not set, default to the #defined value
of TZDIR would be the right solution.  Something like (very raw)

Index: localtime.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/localtime.cc,v
retrieving revision 1.8
diff -u -p -r1.8 localtime.cc
--- localtime.cc        20 Dec 2002 03:40:00 -0000      1.8
+++ localtime.cc        1 Dec 2003 16:44:49 -0000
 <at>  <at>  -717,7 +717,8  <at>  <at>  tzload(const char *name, struct state *s
 	register int		fid;
 	save_errno		save;

(Continue reading)

Nicholas Wourms | 1 Dec 2003 19:22

Re: [PATCH]: Add flock syscall emulation

Corinna wrote:
> On Sun, Nov 30, 2003 at 12:57:48PM -0500, Nicholas Wourms wrote:
> 
>>Corinna wrote:
>>
>>>I've run indent on flock.c since its formatting was non-GNU.
>>
>>I can understand why you did it in this case (the tabs were out of 
>>control), but can we make an exception for bsd/isc-derived code?  I 
>>think that enforcing this rule strictly on written-from-scratch source 
>>is ok, but doing it on derived source reduces the overall transparency 
>>of changes against the upstream version.
> 
> 
> I see.  Is that necessary for flock?  It's not BSD derived and will
> not likely need another external update.

Oh, I think I was unclear.  I was trying to say is that I agree with 
your formatting changes to the flock code.  I just wanted to see if I 
could have an exception from this policy in certain cases where the 
source was derived.

> However, we have a problem here, which I just saw when looking into
> the flock code another time.  The newlib defintion of `struct flock'
> isn't 64 bit aware and it doesn't adhere to the SUSv3 definition.  :-(
> It uses 'long' as datatypes for l_start and l_len but these should
> be off_t.

> So we need to define flock32 and flock64 structs and change the fcntl
> interface to accept both.  Sic.
(Continue reading)

Corinna Vinschen | 1 Dec 2003 19:34
Favicon

Re: [PATCH] localtime.cc: Point TZDIR to the /usr/share/zoneinfo

On Mon, Dec 01, 2003 at 11:50:39AM -0500, Igor Pechtchanski wrote:
> On Mon, 1 Dec 2003, Corinna Vinschen wrote:
> > Should we do some extra stuff to maintain backward compatibility with
> > the old /usr/local/etc path?  I don't think so but...
> >
> > Corinna
> 
> That's pretty much what I suggested in
> <http://cygwin.com/ml/cygwin-apps/2003-11/msg00443.html>.  Right now, the
> code is not $TZDIR-aware, AFAICS.  IMO, having it first check the TZDIR
> environment variable, and if that's not set, default to the #defined value
> of TZDIR would be the right solution.  Something like (very raw)

Interested to change this to a real patch with ChangeLog and all that?

Corinna

--

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin <at> cygwin.com
Red Hat, Inc.


Gmane