Skip Menu |
 

Download (untitled) / with headers
text/plain 4.4KiB
From liebman@gateway.la.zod.com Sat Apr 19 02:40:23 2003
Received: from fort-point-station.mit.edu (FORT-POINT-STATION.MIT.EDU [18.7.7.76]) by krbdev.mit.edu (8.9.3) with ESMTP
id CAA10861; Sat, 19 Apr 2003 02:40:23 -0400 (EDT)
Received: from gateway.la.zod.com (66-215-26-54.pas-mres.charterpipeline.net [66.215.26.54])
by fort-point-station.mit.edu (8.12.4/8.9.2) with ESMTP id h3J6eMfB023572
for <krb5-bugs@mit.edu>; Sat, 19 Apr 2003 02:40:22 -0400 (EDT)
Received: from gateway.la.zod.com (gateway.la.zod.com [127.0.0.1])
by gateway.la.zod.com (8.12.8/8.12.8) with ESMTP id h3J6eL8F013178
for <krb5-bugs@mit.edu>; Fri, 18 Apr 2003 23:40:21 -0700
Received: (from liebman@localhost)
by gateway.la.zod.com (8.12.8/8.12.8/Submit) id h3J6eL7P013176
for krb5-bugs@mit.edu; Fri, 18 Apr 2003 23:40:21 -0700
Date: Fri, 18 Apr 2003 23:40:21 -0700
From: "Christopher B. Liebman" <liebman@gateway.la.zod.com>
Message-Id: <200304190640.h3J6eL7P013176@gateway.la.zod.com>
To: krb5-bugs@mit.edu
Subject: patch for cygwin

To: krb5-bugs@mit.edu
Subject:
From: liebman
Reply-To: liebman
Cc:
X-send-pr-version: 3.99


Show quoted text
>Submitter-Id: net
>Originator: Christopher B. Liebman
>Organization:
None
Show quoted text
>Confidential: no
>Synopsis: patch to compile with cygwin
>Severity: non-critical
>Priority: low
>Category: krb5-misc
>Class: sw-bug
>Release: krb5-1.2.8
>Environment:
System: CYGWIN_NT-5.0 XYZZY 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 unknown unknown Cygwin


Show quoted text
>Description:
some compile problems relating to the definition of errno and
issues renaming files that are open
Show quoted text
>How-To-Repeat:
compile on Windows under cygwin
Show quoted text
>Fix:

diff -u -r krb5-1.2.8-dist/src/lib/krb4/in_tkt.c krb5-1.2.8/src/lib/krb4/in_tkt.c
--- krb5-1.2.8-dist/src/lib/krb4/in_tkt.c 2001-01-26 20:43:32.000000000 -0800
+++ krb5-1.2.8/src/lib/krb4/in_tkt.c 2003-04-18 21:45:36.000000000 -0700
@@ -35,6 +35,9 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifdef __CYGWIN__
+#include <errno.h>
+#endif

extern int krb_debug;

diff -u -r krb5-1.2.8-dist/src/lib/krb4/send_to_kdc.c krb5-1.2.8/src/lib/krb4/send_to_kdc.c
--- krb5-1.2.8-dist/src/lib/krb4/send_to_kdc.c 2000-05-17 00:13:44.000000000 -0700
+++ krb5-1.2.8/src/lib/krb4/send_to_kdc.c 2003-04-18 21:15:46.000000000 -0700
@@ -18,7 +18,9 @@
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
-
+#ifdef __CYGWIN__
+#include <errno.h>
+#endif
#define S_AD_SZ sizeof(struct sockaddr_in)

#ifdef HAVE_STDLIB_H
diff -u -r krb5-1.2.8-dist/src/lib/krb5/rcache/rc_io.c krb5-1.2.8/src/lib/krb5/rcache/rc_io.c
--- krb5-1.2.8-dist/src/lib/krb5/rcache/rc_io.c 2001-10-29 17:21:32.000000000 -0800
+++ krb5-1.2.8/src/lib/krb5/rcache/rc_io.c 2003-04-18 21:15:46.000000000 -0700
@@ -262,6 +262,18 @@
krb5_rc_io_open(context, new, fn);
free(fn);
#else
+#ifdef __CYGWIN__
+ close(new->fd);
+/* unlink(new->fn);*/
+ close(old->fd);
+ if (rename(old->fn,new->fn) == -1) /* MUST be atomic! */
+ return KRB5_RC_IO_UNKNOWN;
+ fn = new->fn;
+ new->fn = NULL; /* avoid clobbering */
+ krb5_rc_io_close(context, new);
+ krb5_rc_io_open(context, new, fn);
+ free(fn);
+#else
if (rename(old->fn,new->fn) == -1) /* MUST be atomic! */
return KRB5_RC_IO_UNKNOWN;
fn = new->fn;
@@ -274,6 +286,7 @@
new->fd = dup(old->fd);
#endif
#endif
+#endif
return 0;
}

diff -u -r krb5-1.2.8-dist/src/util/ss/help.c krb5-1.2.8/src/util/ss/help.c
--- krb5-1.2.8-dist/src/util/ss/help.c 2000-05-01 08:53:38.000000000 -0700
+++ krb5-1.2.8/src/util/ss/help.c 2003-04-18 21:40:16.000000000 -0700
@@ -12,7 +12,11 @@
#include "ss_internal.h"
#include "copyright.h"

+#ifdef __CYGWIN__
+#include <errno.h>
+#else
extern int errno;
+#endif

void ss_help (argc, argv, sci_idx, info_ptr)
int argc;
diff -u -r krb5-1.2.8-dist/src/util/ss/pager.c krb5-1.2.8/src/util/ss/pager.c
--- krb5-1.2.8-dist/src/util/ss/pager.c 1995-04-27 09:41:16.000000000 -0700
+++ krb5-1.2.8/src/util/ss/pager.c 2003-04-18 21:15:46.000000000 -0700
@@ -17,7 +17,11 @@
static char MORE[] = "more";
extern char *_ss_pager_name;
extern char *getenv();
+#ifdef __CYGWIN__
+#include <errno.h>
+#else
extern int errno;
+#endif

/*
* this needs a *lot* of work....
diff -u -r krb5-1.2.8-dist/src/util/ss/parse.c krb5-1.2.8/src/util/ss/parse.c
--- krb5-1.2.8-dist/src/util/ss/parse.c 1994-08-18 13:48:42.000000000 -0700
+++ krb5-1.2.8/src/util/ss/parse.c 2003-04-18 21:15:46.000000000 -0700
@@ -6,7 +6,9 @@

#include "ss_internal.h"
#include "copyright.h"
-
+#ifdef __CYGWIN__
+#include <errno.h>
+#endif

enum parse_mode { WHITESPACE, TOKEN, QUOTED_STRING };

Download (untitled) / with headers
text/plain 4.5KiB
From liebman@zod.com Sat Apr 19 03:02:57 2003
Received: from pacific-carrier-annex.mit.edu (PACIFIC-CARRIER-ANNEX.MIT.EDU [18.7.21.83]) by krbdev.mit.edu (8.9.3) with ESMTP
id DAA10892; Sat, 19 Apr 2003 03:02:57 -0400 (EDT)
Received: from smtp015.mail.yahoo.com (smtp015.mail.yahoo.com [216.136.173.59])
by pacific-carrier-annex.mit.edu (8.12.4/8.9.2) with SMTP id h3J72vIQ024559
for <krb5-bugs@mit.edu>; Sat, 19 Apr 2003 03:02:57 -0400 (EDT)
Received: from 66-215-26-54.pas-mres.charterpipeline.net (HELO XYZZY) (cbliebman@66.215.26.54 with login)
by smtp.mail.vip.sc5.yahoo.com with SMTP; 19 Apr 2003 07:02:56 -0000
Message-ID: <003901c30641$b0020870$0401010a@XYZZY>
From: "Christopher B. Liebman" <liebman@zod.com>
To: <krb5-bugs@mit.edu>
Subject: patch to compile/run on cygwin
Date: Sat, 19 Apr 2003 00:02:48 -0700
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

To: krb5-bugs@mit.edu
Subject:
From: liebman
Reply-To: liebman
Cc:
X-send-pr-version: 3.99


Show quoted text
>Submitter-Id: net
>Originator: Christopher B. Liebman
>Organization:
None
Show quoted text
>Confidential: no
>Synopsis: patch to compile with cygwin
>Severity: non-critical
>Priority: low
>Category: krb5-misc
>Class: sw-bug
>Release: krb5-1.2.8
>Environment:
System: CYGWIN_NT-5.0 XYZZY 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 unknown
unknown Cygwin


Show quoted text
>Description:
some compile problems relating to the definition of errno and
issues renaming files that are open
Show quoted text
>How-To-Repeat:
compile on Windows under cygwin
Show quoted text
>Fix:

diff -u -r krb5-1.2.8-dist/src/lib/krb4/in_tkt.c
krb5-1.2.8/src/lib/krb4/in_tkt.c
--- krb5-1.2.8-dist/src/lib/krb4/in_tkt.c 2001-01-26
20:43:32.000000000 -0800
+++ krb5-1.2.8/src/lib/krb4/in_tkt.c 2003-04-18 21:45:36.000000000 -0700
@@ -35,6 +35,9 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifdef __CYGWIN__
+#include <errno.h>
+#endif

extern int krb_debug;

diff -u -r krb5-1.2.8-dist/src/lib/krb4/send_to_kdc.c
krb5-1.2.8/src/lib/krb4/send_to_kdc.c
--- krb5-1.2.8-dist/src/lib/krb4/send_to_kdc.c 2000-05-17
00:13:44.000000000 -0700
+++ krb5-1.2.8/src/lib/krb4/send_to_kdc.c 2003-04-18
21:15:46.000000000 -0700
@@ -18,7 +18,9 @@
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
-
+#ifdef __CYGWIN__
+#include <errno.h>
+#endif
#define S_AD_SZ sizeof(struct sockaddr_in)

#ifdef HAVE_STDLIB_H
diff -u -r krb5-1.2.8-dist/src/lib/krb5/rcache/rc_io.c
krb5-1.2.8/src/lib/krb5/rcache/rc_io.c
--- krb5-1.2.8-dist/src/lib/krb5/rcache/rc_io.c 2001-10-29
17:21:32.000000000 -0800
+++ krb5-1.2.8/src/lib/krb5/rcache/rc_io.c 2003-04-18
21:15:46.000000000 -0700
@@ -262,6 +262,18 @@
krb5_rc_io_open(context, new, fn);
free(fn);
#else
+#ifdef __CYGWIN__
+ close(new->fd);
+/* unlink(new->fn);*/
+ close(old->fd);
+ if (rename(old->fn,new->fn) == -1) /* MUST be atomic! */
+ return KRB5_RC_IO_UNKNOWN;
+ fn = new->fn;
+ new->fn = NULL; /* avoid clobbering */
+ krb5_rc_io_close(context, new);
+ krb5_rc_io_open(context, new, fn);
+ free(fn);
+#else
if (rename(old->fn,new->fn) == -1) /* MUST be atomic! */
return KRB5_RC_IO_UNKNOWN;
fn = new->fn;
@@ -274,6 +286,7 @@
new->fd = dup(old->fd);
#endif
#endif
+#endif
return 0;
}

diff -u -r krb5-1.2.8-dist/src/util/ss/help.c krb5-1.2.8/src/util/ss/help.c
--- krb5-1.2.8-dist/src/util/ss/help.c 2000-05-01 08:53:38.000000000 -0700
+++ krb5-1.2.8/src/util/ss/help.c 2003-04-18 21:40:16.000000000 -0700
@@ -12,7 +12,11 @@
#include "ss_internal.h"
#include "copyright.h"

+#ifdef __CYGWIN__
+#include <errno.h>
+#else
extern int errno;
+#endif

void ss_help (argc, argv, sci_idx, info_ptr)
int argc;
diff -u -r krb5-1.2.8-dist/src/util/ss/pager.c
krb5-1.2.8/src/util/ss/pager.c
--- krb5-1.2.8-dist/src/util/ss/pager.c 1995-04-27 09:41:16.000000000 -0700
+++ krb5-1.2.8/src/util/ss/pager.c 2003-04-18 21:15:46.000000000 -0700
@@ -17,7 +17,11 @@
static char MORE[] = "more";
extern char *_ss_pager_name;
extern char *getenv();
+#ifdef __CYGWIN__
+#include <errno.h>
+#else
extern int errno;
+#endif

/*
* this needs a *lot* of work....
diff -u -r krb5-1.2.8-dist/src/util/ss/parse.c
krb5-1.2.8/src/util/ss/parse.c
--- krb5-1.2.8-dist/src/util/ss/parse.c 1994-08-18 13:48:42.000000000 -0700
+++ krb5-1.2.8/src/util/ss/parse.c 2003-04-18 21:15:46.000000000 -0700
@@ -6,7 +6,9 @@

#include "ss_internal.h"
#include "copyright.h"
-
+#ifdef __CYGWIN__
+#include <errno.h>
+#endif

enum parse_mode { WHITESPACE, TOKEN, QUOTED_STRING };
To: rt@krbdev.mit.edu
Cc: krb5-prs@mit.edu
Subject: Re: [krbdev.mit.edu #1432] patch to compile with cygwin
From: Sam Hartman <hartmans@mit.edu>
Date: Sat, 19 Apr 2003 23:37:10 -0400
RT-Send-Cc:
If you want your patch to be considered, please describe in sufficient
detail what it does that we can easily evaluate it and see why each
change is necessary.

Also, please make sure it applies cleanly to recent development
snapshots such as 1.3 alpha2.
From: "Christopher B. Liebman" <cbliebman@yahoo.com>
To: <rt-comment@krbdev.mit.edu>
Subject: Re: [krbdev.mit.edu #1432] patch to compile with cygwin
Date: Sat, 19 Apr 2003 23:18:32 -0700
RT-Send-Cc:
There are two issues that this patch fixes:

1) Cygwin implements error as a function that returns an int. There are
locations in krb5 that declare errno as "extern int errno" the patch
includes errno.h instead. Maybe a better fix is to have configure look to
see if errno.h exists and include it?

2) Cygwin has the same issues as Windows/DOS with renaming a file while it's
still open. This patch uses almost exactly the same code to fix this issue
manifesting in the replay cache code.

-- Chris

Show quoted text
----- Original Message -----
From: "Sam Hartman via RT" <rt-comment@krbdev.mit.edu>
To: <liebman@zod.com>
Cc: <krb5-prs@mit.edu>
Sent: Saturday, April 19, 2003 8:37 PM
Subject: Re: [krbdev.mit.edu #1432] patch to compile with cygwin


> If you want your patch to be considered, please describe in sufficient
> detail what it does that we can easily evaluate it and see why each
> change is necessary.
>
> Also, please make sure it applies cleanly to recent development
> snapshots such as 1.3 alpha2.
>
To: rt-comment@krbdev.mit.edu
Cc: krb5-prs@MIT.EDU
Subject: Re: [krbdev.mit.edu #1432] patch to compile with cygwin
From: Ken Raeburn <raeburn@MIT.EDU>
Date: Wed, 23 Apr 2003 21:10:59 -0400
RT-Send-Cc:
Download (untitled) / with headers
text/plain 1.2KiB
"\"\"Christopher B. Liebman\" via RT\"" <rt-comment@krbdev.mit.edu> writes:

Show quoted text
> There are two issues that this patch fixes:
>
> 1) Cygwin implements error as a function that returns an int. There are
> locations in krb5 that declare errno as "extern int errno" the patch
> includes errno.h instead. Maybe a better fix is to have configure look to
> see if errno.h exists and include it?

Declaring errno explicitly is just wrong, because any ANSI C platform
is allowed to do this. (At worst, we could declare it *if* the system
errno.h doesn't; I don't think anything more recent than SunOS 4 fails
to declare it.) We probably don't lose on UNIX platforms just because
the macro versions -- when there are any -- are syntactically
compatible with use in declarations as well as expression, which is
not required by ANSI C.

We do still have many such declarations in the 1.3 branch.

While we're at it, some of the krb4 code declares errmsg() right along
with errno, but I don't think it exists or is used.

Show quoted text
> 2) Cygwin has the same issues as Windows/DOS with renaming a file while it's
> still open. This patch uses almost exactly the same code to fix this issue
> manifesting in the replay cache code.

Makes sense....

Ken
Subject: patch to compile with cygwin
I just checked in appl/gssftp/ftpd/ChangeLog version 1.102 and ftpd.c
version 1.68 to remove some errno references. (Tried to abort the
checkin, but these got checked in anyways.)
I've checked in changes to the current code to eliminate most (all?) of
the errno declarations. Some of those reported in 1.2.8 had already
been fixed, and there were others in application code that were not
reported.
I think the patch in 1434 looks like a better fix to the rcache problem,
so nothing left to do for this one.