Re: get_date returning false

2005-04-08 Thread Ian Abbott
Hi Derek,
I've tried building getdate in cvs-1.12.11 and in ccvs from the 
repository.  I got the same result in both cases.

If you want to try and reproduce it, you'll probably need to set the TZ 
environment variable.  Mine is set to "Europe/London", but if your libc 
doesn't understand that format, you can try "GMT0BST,M3.5.0,M10.5.0" or 
"GMT0BST" instead.

Here is the result of some of my tests:
$ TZ=Europe/London ./getdate
Enter date, or blank line to exit.
> 2005-4-1 GMT
Bad format - couldn't convert.
> 2005-3-31 GMT
Bad format - couldn't convert.
> 2005-3-30 GMT
Bad format - couldn't convert.
> 2005-4-1 BST
2005-04-01 00:00:00.0
> $
$ TZ=America/New_York ./getdate
Enter date, or blank line to exit.
> 2005-4-1 GMT
2005-03-31 19:00:00.0
> 2005-4-2 GMT
2005-04-01 19:00:00.0
> $
$ TZ=Europe/Kiev ./getdate
Enter date, or blank line to exit.
> 2005-4-1 GMT
2005-04-01 03:00:00.0
> $
$
As you can see, this problem only seems to affect the British (and the 
Irish, as TZ=Europe/Dublin exhibited the same problem).

I'll try reporting the bug to [EMAIL PROTECTED]
Cheers,
Ian.
On 07/04/05 19:05, Derek Price wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
The correct place to report bugs in the getdate library would be
[EMAIL PROTECTED], but could you please verify that you can reproduce
your problem with the version of CVS available from the CVS repository
on cvshome.org before you bother them?  Also, see if you can `cd lib;
make getdate; ./getdate' and then enter your offending date at the
prompt provided.  I cannot reproduce the problem you report using this
method, which might imply a problem with how we are using get_date
rather than with get_date itself, but then you should not have seen
problems from yyparse...  anyway, please let us know what you discover.
Regards,
Derek
Ian Abbott wrote:
| Hi,
|
| I've just started having a problem with "cvs date -u" (version
| 1.12.11):
|
|
| cvs diff: Diffing . Index: ChangeLog cvs diff: internal error: bad
| date 7 Apr 2005 11:50:26 -
| ===
|  RCS file: /work/abbotti/Repository/ampser/ChangeLog,v retrieving
| revision 1.66 *** glibc detected *** malloc(): memory corruption:
| 0x080eff60 *** cvs [diff aborted]: received abort signal
|
|
| I think the memory corruption is a side effect of the "bad date",
| so I'm concentrating on that for now.  I've traced the problem as
| far as the 'get_date' function, called from 'RCS_getrevtime'.
| 'get_date' returned 'false', so 'RCS_getrevtime' never got as far
| as filling in the 'date' string for its caller.
|
| Some debugging info from gdb follows 
|
| Value of 'pc' prior to the call to 'yyparse':
|
| (gdb) p pc $39 = {input = 0xbfffebe0 "2005-4-7 GMT 11:36:56",
| day_ordinal = 1073837632, day_number = 1075498996, local_isdst =
| -1073747276, time_zone = -1073747304, meridian = 2, year = {value =
| 2005, digits = 4}, month = 4, day = 7, hour = 14, minutes = 57,
| seconds = {tv_sec = 7, tv_nsec = 27359}, rel_year = 0,
| rel_month = 0, rel_day = 0, rel_hour = 0, rel_minutes = 0,
| rel_seconds = 0, rel_ns = 0, timespec_seen = false, dates_seen = 0,
| days_seen = 0, local_zones_seen = 0, rels_seen = 0, times_seen = 0,
| zones_seen = 0, local_time_zone_table = {{ name = 0x80e3fb8 "BST",
| type = 264, value = 1}, { name = 0x80e4a70 "GMT", type = 264, value
| = 0}, { name = 0x0, type = 0, value = 0}}}
|
| Value of 'pc' after the call to 'yyparse':
|
| (gdb) p pc $40 = {input = 0xbfffebf6
|
"[EMAIL PROTECTED]@\u\u\032@(\u\u\uO\u\016@ 

|  [EMAIL PROTECTED]", day_ordinal = 1073837632, day_number = 1075498996,
| local_isdst = 0, time_zone = -1073747304, meridian = 2, year =
| {value = 2005, digits = 4}, month = 4, day = 7, hour = 11, minutes
| = 36, seconds = {tv_sec = 56, tv_nsec = 0}, rel_year = 0, rel_month
| = 0, rel_day = 0, rel_hour = 0, rel_minutes = 0, rel_seconds = 0,
| rel_ns = 0, timespec_seen = false, dates_seen = 1, days_seen = 0,
| local_zones_seen = 1, rels_seen = 0, times_seen = 1, zones_seen =
| 0, local_time_zone_table = {{ name = 0x80e3fb8 "BST", type = 264,
| value = 1}, { name = 0x80e4a70 "GMT", type = 264, value = 0}, {
| name = 0x0, type = 0, value = 0}}}
|
| Values of 'Start', 'tm0' and 'tm' after the call to 'mktime':
|
| (gdb) p Start $46 = 1112873816 (gdb) p tm0 $47 = {tm_sec = 56,
| tm_min = 36, tm_hour = 11, tm_mday = 7, tm_mon = 3, tm_year = 105,
| tm_wday = 1075497952, tm_yday = 0, tm_isdst = 0, tm_gmtoff =
| 1075498996, tm_zone = 0x0} (gdb) p tm $48 = {tm_sec = 56, tm_min =
| 36, tm_hour = 12, tm_mday = 7, tm_mon = 3, tm_year = 105, tm_wday =
| 4, tm_yday = 96, tm_isdst = 1, tm_gmtoff = 3600, tm_zone =
| 0x80e3fb8 "BST"}
|
| The following call to 'mktime_ok' returns 0 because tm_hour has
| changed.  This causes 'get_time' to 'goto fail' and return 'false'
| because pc.zones_seen == 0.
|
| Ho

Re: get_date returning false

2005-04-08 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Ian Abbott wrote:
| If you want to try and reproduce it, you'll probably need to set
| the TZ environment variable. Mine is set to "Europe/London", but if
|  your libc doesn't understand that format, you can try
| "GMT0BST,M3.5.0,M10.5.0" or "GMT0BST" instead.
Is one of these formats likely to be portable?  I could add this to
the test suite, then...
Regards,
Derek
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCVp2hLD1OTBfyMaQRAl6hAJ9pV8l2okEtAj/5uOesd5VZlXRRygCfXQVa
E6QR+2IyYGqBKkdoypqTzHY=
=z/Uw
-END PGP SIGNATURE-

___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: PAM in cvs 1.11

2005-04-08 Thread Brian Murphy
Yves Dorfsman wrote:
Hi,
I am on a site where they are changing the way the OS is authenticating
users, moving away from NIS to LDAP. My understanding is that the only way
to get CVS working in pserver mode in that case is to use PAM.
PAM is supported in CVS 1.12, but this customer does not want to run a
non-release version of a software.
From what I can see, it should be relatively easy to put the piece that
deals with PAM from 1.12 and put it in 1.11, and my next step is to try to
do that (copying the relevant pieces in src/server from 1.12 to 1.11). A
few questions:
1) Has anybody else done this already (so that we don't waste our time
re-inventing the wheel) ?
 

I did this originally when I wrote my initial PAM patch. It did not have 
complete support
(session support missing). It should be easy to find on this list.

All the PAM code is surrounded by HAVE_PAM defines and was committed in few
(3-4) patches so it should be possible to port this in a few hours. The 
authentication
support is contained in new functions so can easily just be copied. 
Session support is
added to switch_to_user and is mixed up with other code this is the most 
critical
because order is important here if you want it to work. Then "server" 
contains some
code which shuts down the pam session and cleans up.

There is also the configure script but you will probably just want to 
hard code HAVE_PAM
in your version...

/Brian
___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: get_date returning false

2005-04-08 Thread Ian Abbott
On 08/04/2005 16:05, Derek Price wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Ian Abbott wrote:
| If you want to try and reproduce it, you'll probably need to set
| the TZ environment variable. Mine is set to "Europe/London", but if
|  your libc doesn't understand that format, you can try
| "GMT0BST,M3.5.0,M10.5.0" or "GMT0BST" instead.
Is one of these formats likely to be portable?  I could add this to
the test suite, then...
The TZ environment variable has evolved over the years.  Old Unix 
systems only supported the STD[DST[]] format like my 
"GMT0BST" above, so that format is the most portable, but the daylight 
savings rules are incorrect, except in the US (and Canada?).  The 
"daylight savings rules" part of the TZ variable were added in later 
Unix versions (I first encountered it in IBM AIX).  If the daylight 
savings rules section was left off, the system defaulted to US daylight 
savings rules.  The full format is described in the tzset(3) manpage or 
the environ(5) manpage (for the TZ variable).

The modern "Europe/London" format uses a database of timezone rules over 
history for each geographic and/or political region.  This is known as 
the "tz" or "zoneinfo" database and is used in most modern Unix systems. 
 Read more about it here: .

--
-=( Ian Abbott @ MEV Ltd.E-mail: <[EMAIL PROTECTED]>)=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587 )=-
___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: Feature request/ideas - final patch

2005-04-08 Thread Frank Hemer
> Yes.  It is ok to send intermediate patches.

Ok, here's the next. See src/ChangeLog for details -

Index: src/ChangeLog
===
RCS file: /cvs/ccvs/src/ChangeLog,v
retrieving revision 1.3165.2.5
diff -u -r1.3165.2.5 ChangeLog
--- src/ChangeLog   6 Apr 2005 20:11:52 -   1.3165.2.5
+++ src/ChangeLog   8 Apr 2005 17:56:15 -
@@ -1,3 +1,23 @@
+   * admin.c (admin_fileproc): Undo last commit. TAG_TRUNK test removed.
+   * commit.c (check_fileproc): Imporve comments. TAG_TRUNK test removed.
+   (commit_fileproc): TAG_TRUNK test removed.
+   (remove_file): TAG_TRUNK test removed.
+   * update.c (update_fileproc): TAG_TRUNK test removed.
+   * rcs.c: Improve comments.
+   (RCS_gethead): Remove this fn.
+   (RCS_getversion): TAG_TRUNK test removed.
+   (RCS_gettag): Remove magic conversion.
+   (RCS_nodeisbranch): Properly detect magic for numeric rev.
+   Remove magic conversion.
+   (RCS_whatbranch): Gratious reformatting. Simplify.
+   (translate_tag): Always return non-magic branches for symbolic/extended
+   tags. Add param flag to prevent conversion for non-extended tags.
+   Improve assumption verification.
+   (RCS_extract_tag): Adapt error msg to cvs conventions.
+   (RCS_getprevious): Rootdate comparison fixed.
+   (RCS_getroot): Remove magic conversion.
+   * sanity.sh: More tests added.
+
 2005-04-06  Derek Price  <[EMAIL PROTECTED]>
 
* rcs.c (RCS_getprevious): Remove erroneous FIXME.
Index: src/admin.c
===
RCS file: /cvs/ccvs/src/admin.c,v
retrieving revision 1.107.2.3
diff -u -r1.107.2.3 admin.c
--- src/admin.c 20 Mar 2005 23:41:36 -  1.107.2.3
+++ src/admin.c 8 Apr 2005 17:56:15 -
@@ -659,9 +659,13 @@
char *branch = &admin_data->branch[2];
if (*branch != '\0' && !isdigit ((unsigned char) *branch))
{
-   error (0, 0, "%s: Symbolic name %s is undefined.",
-  rcs->path, admin_data->branch + 2);
-   status = 1;
+   branch = RCS_whatbranch (rcs, admin_data->branch + 2);
+   if (branch == NULL)
+   {
+   error (0, 0, "%s: Symbolic name %s is undefined.",
+ rcs->path, admin_data->branch + 2);
+   status = 1;
+   }
}
if (status == 0)
RCS_setbranch (rcs, branch);
Index: src/commit.c
===
RCS file: /cvs/ccvs/src/commit.c,v
retrieving revision 1.252.2.1
diff -u -r1.252.2.1 commit.c
--- src/commit.c19 Mar 2005 15:32:14 -  1.252.2.1
+++ src/commit.c8 Apr 2005 17:56:15 -
@@ -700,6 +700,8 @@
 Lock_Cleanup ();
 dellist (&mulist);
 
+/* add the commitid to val-tags
+ */
 char *commitid = Xasprintf ("@%s", global_session_id);
 tag_check_valid (commitid, argc, argv, local, aflag, "", true);
 free (commitid);
@@ -890,16 +892,13 @@
   finfo->fullname);
goto out;
}
-   if (status == T_MODIFIED && vers->tag)
+   if (status == T_MODIFIED && vers->tag &&
+   !RCS_isbranch (finfo->rcs, vers->tag))
{
-  if ( (*(vers->tag) != '.' || strcmp (vers->tag+1, TAG_TRUNK))
-&& !RCS_isbranch (finfo->rcs, vers->tag) )
-  {
- error (0, 0,
-   "sticky tag `%s' for file `%s' is not a branch",
-   vers->tag, finfo->fullname);
- goto out;
-  }
+   error (0, 0,
+  "sticky tag `%s' for file `%s' is not a branch",
+  vers->tag, finfo->fullname);
+   goto out;
}
}
if (status == T_MODIFIED && !force_ci && vers->ts_conflict)
@@ -1362,7 +1361,6 @@
 {
char *rev = RCS_getversion (finfo->rcs, write_dirtag, NULL, 1, NULL);
if (rev != NULL
-   && !(*write_dirtag == '.' && !strcmp (write_dirtag+1, TAG_TRUNK))
&& !RCS_nodeisbranch (finfo->rcs, write_dirtag))
write_dirnonbranch = 1;
if (rev != NULL)
@@ -1420,16 +1418,6 @@
 }
 else if (ci->status == T_ADDED)
 {
-
-/* prevent adding files to a branch named TAG_TRUNK as this
-* is a synonym for the trunk itself
-*/
-if (ci->tag && *ci->tag == '.' && !strcmp (ci->tag + 1, TAG_TRUNK))
-   {
-   free (ci->tag);
-   ci->tag = NULL;
-   }
-
if (checkaddfile (finfo->file, finfo->repository, ci->tag, ci->options,
  &finfo->rcs) != 0)
{
@@ -1448,7 +1436,7 @@
/* If numeric, it is on the trunk; check_fileproc enforced
   th

Re: get_date returning false

2005-04-08 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Ian Abbott wrote:
| On 08/04/2005 16:05, Derek Price wrote:
|
|> -BEGIN PGP SIGNED MESSAGE- Hash: SHA1
|>
|> Ian Abbott wrote:
|>
|> | If you want to try and reproduce it, you'll probably need to
|> set | the TZ environment variable. Mine is set to
|> "Europe/London", but if |  your libc doesn't understand that
|> format, you can try | "GMT0BST,M3.5.0,M10.5.0" or "GMT0BST"
|> instead.
|>
|> Is one of these formats likely to be portable?  I could add this
|> to the test suite, then...
|
|
| The TZ environment variable has evolved over the years.  Old Unix
| systems only supported the STD[DST[]] format like
| my "GMT0BST" above, so that format is the most portable, but the
| daylight savings rules are incorrect, except in the US (and
| Canada?).  The "daylight savings rules" part of the TZ variable
| were added in later Unix versions (I first encountered it in IBM
| AIX). If the daylight savings rules section was left off, the
| system defaulted to US daylight savings rules.  The full format is
| described in the tzset(3) manpage or the environ(5) manpage (for
| the TZ variable).
|
| The modern "Europe/London" format uses a database of timezone rules
|  over history for each geographic and/or political region.  This is
|  known as the "tz" or "zoneinfo" database and is used in most
| modern Unix systems.  Read more about it here:
| .
Is there some simple, cross-platform test I could use to fall back on
GMT0BST,M3.5.0,M10.5.0 if the Europe/London timezone isn't defined or
skip the tests entirely if neither zone is enabled?
Regards,
Derek
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCVsf9LD1OTBfyMaQRAuKVAKChyBgUWlHWxRgelTdWtOC/Kkm+/QCglWoS
/58CgqNCha1jO3hXOwKbQJY=
=Rb0u
-END PGP SIGNATURE-

___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: get_date returning false

2005-04-08 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Ian Abbott wrote:
| Hi Derek,
|
| I've tried building getdate in cvs-1.12.11 and in ccvs from the
| repository.  I got the same result in both cases.
|
| If you want to try and reproduce it, you'll probably need to set
| the TZ environment variable.  Mine is set to "Europe/London", but
| if your libc doesn't understand that format, you can try
| "GMT0BST,M3.5.0,M10.5.0" or "GMT0BST" instead.
|
| Here is the result of some of my tests:
|
| $ TZ=Europe/London ./getdate Enter date, or blank line to exit.
|> 2005-4-1 GMT
| Bad format - couldn't convert.
|> 2005-3-31 GMT
| Bad format - couldn't convert.
|> 2005-3-30 GMT
| Bad format - couldn't convert.
|> 2005-4-1 BST
| 2005-04-01 00:00:00.0
|> $
| $ TZ=America/New_York ./getdate Enter date, or blank line to exit.
|> 2005-4-1 GMT
| 2005-03-31 19:00:00.0
|> 2005-4-2 GMT
| 2005-04-01 19:00:00.0
It looks like zones which have a summer daylight counterpart are
failing.  These same dates passed as "EST" fail, though "EDT" passes.
I assume this is what we are seeing with the successful parsing of
Ian's "BST" (British Summer Time):
$ TZ=America/New_York ./getdate >getdate-got
Enter date, or blank line to exit.
~> 2005-3-1 EST
2005-03-01 00:00:00.0
~> 2005-4-1 EST
2005-04-01 00:00:00.0
~> 2005-5-1 EST
Bad format - couldn't convert.
~> 2005-5-1 EDT
2005-05-01 00:00:00.0
~> 2005-5-1 UTC0
2005-04-30 20:00:00.0
~> 2005-6-1 EST
Bad format - couldn't convert.
~> 2005-6-1 EDT
2005-06-01 00:00:00.0
~> 2005-6-1 UTC0
2005-05-31 20:00:00.0
~>
I've checked in a workaround on 1.12.x - I've replaced all three
remaining internal references to "GMT" in the sources with "-".
Let me know if this works for you, and it can be released with
1.12.12.  I don't know whether to expect a getdate fix from GNULIB
yet, but if we do, then I'll roll that in too.
Regards,
Derek
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCVsp+LD1OTBfyMaQRAnjdAKCv3DhIBSCRYoAUpgEuHdL017tkIwCgzw3d
qPT1vZNu3ergz7kD734cG+4=
=EK5D
-END PGP SIGNATURE-

___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: get_date returning false

2005-04-08 Thread Ian Abbott
On 08/04/05 19:16, Derek Price wrote:
I've checked in a workaround on 1.12.x - I've replaced all three
remaining internal references to "GMT" in the sources with "-".
Let me know if this works for you, and it can be released with
1.12.12.  I don't know whether to expect a getdate fix from GNULIB
yet, but if we do, then I'll roll that in too.
Yes, "cvs diff -u" is now working for me.  I tried it with the following 
TZ settings: "GMT", "GMT0", "BST-1", "GMT0BST", 
"GMT0BST,M3.5.0,M10.5.0", "Europe/London", "foobar".  (Glibc defaulted 
to UTC when I used "foobar"!)

--
-=( Ian Abbott @ MEV Ltd.E-mail: <[EMAIL PROTECTED]>)=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587 )=-
___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs


Re: get_date returning false

2005-04-08 Thread Derek Price
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Ian Abbott wrote:
| Hi Derek,
|
| On 08/04/05 19:05, you wrote:
|
|> Is there some simple, cross-platform test I could use to fall
|> back on GMT0BST,M3.5.0,M10.5.0 if the Europe/London timezone
|> isn't defined or skip the tests entirely if neither zone is
|> enabled?
|
|
| No idea, sorry.  Hopefully it won't matter unless the internal use
| of GMT creaps back in!
Anybody have any idea how many platforms won't support the
Large_Place/City timezone format?  Mark?  Larry?  Should I check in
some new tests and see how many nightly test platforms break?  I could
always back them out again.
Cheers,
Derek
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCVuuHLD1OTBfyMaQRAgtDAKDp4bZG4q2reDQqvmzt3xdmT1sQtQCgspkI
nK87dKZ7bGRM7abSMnxdtO0=
=HLnC
-END PGP SIGNATURE-

___
Bug-cvs mailing list
Bug-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-cvs