Bug#295449: Patch to get CAserial and CAcreateserial working again

2005-05-23 Thread Tim Woodall

The included patch fixes the problem where CAserial no longer works.

Note that you now have to give either CAserial or CAcreateserial (or
both) in order to use a serial number file.

The first hunk of the patch fixes the actual bug report. The second hunk
fixes a bug where there is more than one dot in the CAfile path/filename
or the dot is not in the filename but is in a directory name.

Patched against openssl-0.9.7e (sarge)

Tim.


--- x509.c.orig 2005-05-23 23:53:14.0 +0100
+++ x509.c  2005-05-24 00:50:52.0 +0100
@@ -593,15 +593,17 @@
if ((x=X509_new()) == NULL) goto end;
ci=x->cert_info;

-   if (sno == NULL)
+   if (sno == NULL && CAserial==NULL && !CA_createserial)
{
sno = ASN1_INTEGER_new();
if (!sno || !rand_serial(NULL, sno))
goto end;
}

-		if (!X509_set_serialNumber(x, sno)) 
-			goto end;

+   if (sno != NULL)
+			if (!X509_set_serialNumber(x, sno)) 
+goto end;

+

if (!X509_set_issuer_name(x,req->req_info->subject)) goto end;
if (!X509_set_subject_name(x,req->req_info->subject)) goto end;
@@ -1061,12 +1063,16 @@
if (serialfile == NULL)
{
BUF_strlcpy(buf,CAfile,len);
-   for (p=buf; *p; p++)
+   for (p=buf+strlen(buf)-1; p>buf; p--)
+   {
+   if (*p == '/')
+   break;
if (*p == '.')
{
*p='\0';
break;
}
+   }
BUF_strlcat(buf,POSTFIX,len);
}
else



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#409243: Happens for me too

2007-04-29 Thread Tim Woodall

I've had exactly the same problem.

Upgraded to etch with 2.4 kernel - everything working fine.

Upgraded to 2.6 kernel - won't boot.

In the rescue shell, vgchange -ay vg0 gives "no volumes group found".

Everything is at the latest version in etch.

partition table is /dev/hda1 for /boot
/dev/hda2 for lvm2

I had another identical machine that I'd also upgraded to etch with no
problem. The difference is that the other machine was set up with the
two partitions on raid1.
(Only one harddisk, the second disk is missing, I set it up like this so
that I could eventually have the machine on raid1 once I get a bigger
case)

So I picked the initrd from the working machine and tried it on the
failing machine. I got an error about cannot run fsck on /dev/hda1 but
the machine eventually booted up fine.

I rebuilt /boot on raid1 and hacked /dev/hda2 to be /dev/md1
without actually rebuilding which seems to have worked.

So now the machine boots fine in both 2.4 and 2.6 kernels.

[EMAIL PROTECTED]:~$ cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 hda2[1]
  78011520 blocks [2/1] [_U]

md0 : active raid1 hda1[1]
  136448 blocks [2/1] [_U]

unused devices: 

feynman:~# pvdisplay
  --- Physical volume ---
  PV Name   /dev/md1
  VG Name   vg0
  PV Size   74.39 GB / not usable 0
  Allocatable   yes
  PE Size (KByte)   4096
  Total PE  19045
  Free PE   4045
  Allocated PE  15000
  PV UUID   F06AQv-OVlE-iWtJ-31S6-uHKM-yyN7-wFQTZv

feynman:~# vgdisplay
  --- Volume group ---
  VG Name   vg0
  System ID
  Formatlvm2
  Metadata Areas1
  Metadata Sequence No  1384
  VG Access read/write
  VG Status resizable
  MAX LV0
  Cur LV7
  Open LV   7
  Max PV0
  Cur PV1
  Act PV1
  VG Size   74.39 GB
  PE Size   4.00 MB
  Total PE  19045
  Alloc PE / Size   15000 / 58.59 GB
  Free  PE / Size   4045 / 15.80 GB
  VG UUID   qmBCTP-vIh6-h5AU-jT8a-o31r-48HB-heEAio

feynman:~# mdadm -D /dev/md0
/dev/md0:
Version : 00.90.03
  Creation Time : Sat Apr 28 19:06:01 2007
 Raid Level : raid1
 Array Size : 136448 (133.27 MiB 139.72 MB)
Device Size : 136448 (133.27 MiB 139.72 MB)
   Raid Devices : 2
  Total Devices : 1
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Sun Apr 29 08:21:25 2007
  State : clean, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

   UUID : 08972485:1bf5fbf2:efc3b31c:59f53a25 (local to host 
feynman.home.woodall.me.uk)
 Events : 0.52

Number   Major   Minor   RaidDevice State
   0   000  removed
   1   311  active sync   /dev/hda1

feynman:~# mdadm -D /dev/md1
/dev/md1:
Version : 00.90.03
  Creation Time : Mon Jan  1 21:52:19 2007
 Raid Level : raid1
 Array Size : 78011520 (74.40 GiB 79.88 GB)
Device Size : 78011520 (74.40 GiB 79.88 GB)
   Raid Devices : 2
  Total Devices : 1
Preferred Minor : 1
Persistence : Superblock is persistent

Update Time : Sun Apr 29 15:40:42 2007
  State : clean, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

   UUID : 98098d82:05ea0a3f:656f116f:b86d5f02
 Events : 0.12638

Number   Major   Minor   RaidDevice State
   0   000  removed
   1   321  active sync   /dev/hda2

Tim.



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#409243: Info received (Happens for me too)

2007-04-29 Thread Tim Woodall

I've just found this comment attached to bug#381351:

"I just did a bit of investigation into a slimilar issue - it seems that 
the image created by initramfs-tools doesn't work with LVM if mdadm is 
not installed."


I suspect that this was my problem as I didn't have mdadm installed.

It may be the original reporters problem as well.

Tim.



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#312844: console-tools: Same problem attempting to build the keyboard map for psion-5mx kernel

2006-04-01 Thread Tim Woodall
Package: console-tools
Version: 1:0.2.3dbs-56
Followup-For: Bug #312844

I'm having exactly the same problem while attempting to build a kernel
for the psion 5mx (http://linux-7110.sourceforge.net/)

This contains a number of special keycodes for controlling things like
backlight, contrast, power off etc.
The codes are thing like:
altgr   keycode  61 = 0xf03 # Backlight

loadkeys --mktable keymap_psion_us.map >keymap_psion_us.c

For console-tools_0.2.3-23.3 this build the map file correctly.
For console-tools_0.2.3dbs-56 this replaces all the 0xff0? values with
0xf020

-   0xf200, 0xf117, 0xf114, 0xf200, 0xf118, 0xff03, 0xf10d, 0xfc00,
+   0xf200, 0xf117, 0xf114, 0xf200, 0xf118, 0xf020, 0xf10d, 0xfc00,

And console-tools_0.2.3dbs-60 has the same problem except that it
additionally requires you to run this as root otherwise you get:
$ ./console-tools_0.2.3dbs-60/bin/loadkeys --mktable keymap_psion_us.map
Couldnt get a file descriptor referring to the console
KDGKBMODE: Bad file descriptor
loadkeys: error reading keyboard mode
$

The following patch to the function add_number fixes this issue (but may
cause other problems)

--- ksyms.c.orig2006-04-01 09:32:27.0 +0100
+++ ksyms.c 2006-04-01 10:02:15.0 +0100
@@ -1826,7 +1826,7 @@
}
if (kbd_mode != K_UNICODE && KTYP(code) < syms_size)
return code;
-   return ksymtocode(codetoksym(code));
+   return code;
 }

 int

The cause here is that the 0xf03 in the map file is being converted into
a symbol and then back into the code. And it therefore rejected if there
is no mapping for this character.

I also don't understand why there are all the:
ioctl(fd, KDGKBMODE, &kbd_mode);

when we are running with --mktable. AFAICT we shouldn't even be touching
the console (nor require running as root).

I think this is probably the underlying cause although I'm not
completely clear how this should be fixed. I think that if we are
running with --mktable we should not be looking at the console at all
but maybe need to consider whether -u was on the commandline?

(When I'm building the psion-5mx kernel I'm doing a cross compile. So
not only is loadkeys looking at the console on the wrong machine, it's
the wrong architecture and hardware as well)

Tim.


-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.4.27-3-686
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)

Versions of packages console-tools depends on:
ii  console-common 0.7.49Basic infrastructure for text cons
ii  debconf1.4.30.13 Debian configuration management sy
ii  libc6  2.3.2.ds1-22  GNU C Library: Shared libraries an
ii  libconsole 1:0.2.3dbs-56 Shared libraries for Linux console
ii  sysvinit   2.86.ds1-1System-V like init

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#312844: console-tools: Same problem attempting to build the keyboard map for psion-5mx kernel

2006-04-01 Thread Tim Woodall

I've now constructed a patch that fixes this problem for me. (I don't
think this will fix the original problem as that was running loadkeys
without --mktable)

I now do:

LD_PRELOAD=./libconsole.so ./loadkeys -u --mktable keymap_psion_us.map 
>keymap_psion_us.patch.c

and the mapfile is created correctly and there is no attempt to access
the console.

(This patch is against sarge. If you want it against unstable then let
me know and I'll do that)

Tim.

diff -aur console-tools-0.2.3.orig/include/lct/ksyms.h 
console-tools-0.2.3/include/lct/ksyms.h
--- console-tools-0.2.3.orig/include/lct/ksyms.h2006-04-01 
10:44:24.0 +0100
+++ console-tools-0.2.3/include/lct/ksyms.h 2006-04-01 10:46:07.0 
+0100
@@ -21,8 +21,8 @@
 extern const int charsets_size;

 extern int set_charset(const char *name);
-extern int add_number(int code);
-extern int add_capslock(int code);
+extern int add_number(int code, const int *kbd_mode);
+extern int add_capslock(int code, const int *kbd_mode);
 extern const char *codetoksym(int code);
 extern void list_charsets(FILE *f);

diff -aur console-tools-0.2.3.orig/kbdtools/analyze.l 
console-tools-0.2.3/kbdtools/analyze.l
--- console-tools-0.2.3.orig/kbdtools/analyze.l 2006-04-01 10:42:22.0 
+0100
+++ console-tools-0.2.3/kbdtools/analyze.l  2006-04-01 10:59:26.0 
+0100
@@ -6,10 +6,11 @@
 #include 
 #include "loadkeys.h"

-extern int ksymtocode(char *s);
+extern int ksymtocode(char *s, const int *kbd_mode);

 extern int line_nr;
 extern int verbose;  /* loadkeys.y */
+extern const int *p_kbd_mode;/* loadkeys.y */
 extern char pathname[];  /* idem */
 intyylval;
 intrvalct;
@@ -88,7 +89,7 @@
 \+ {return(PLUS);}
 {Unicode}  {yylval=strtol(yytext+1,NULL,16) ^ 
0xf000;return(UNUMBER);}
 {Decimal}|{Octal}|{Hex}{yylval=strtol(yytext,NULL,0);return(NUMBER);}
-{Literal}
{return((yylval=ksymtocode(yytext))==-1?ERROR:LITERAL);}
+{Literal}{return((yylval=ksymtocode(yytext, 
p_kbd_mode))==-1?ERROR:LITERAL);}
 {Charset}  {return(CHARSET);}
 {Keymaps}  {return(KEYMAPS);}
 {Keycode}  {return(KEYCODE);}
diff -aur console-tools-0.2.3.orig/kbdtools/loadkeys.y 
console-tools-0.2.3/kbdtools/loadkeys.y
--- console-tools-0.2.3.orig/kbdtools/loadkeys.y2006-04-01 
10:46:55.0 +0100
+++ console-tools-0.2.3/kbdtools/loadkeys.y 2006-04-01 11:09:36.0 
+0100
@@ -85,6 +85,9 @@
 int lk_pop(void);/* idem */
 extern int infile_stack_ptr; /* idem */

+static int kbd_mode = K_RAW; /* Default kbd mode if 
running with -m */
+const int *p_kbd_mode;
+
 #ifndef KT_LETTER
 #define KT_LETTER KT_LATIN
 #endif
@@ -285,17 +288,17 @@
}
;
 rvalue : NUMBER
-   {$$=add_number($1);}
+   {$$=add_number($1, p_kbd_mode);}
| LITERAL
-   {$$=add_number($1);}
+   {$$=add_number($1, p_kbd_mode);}
| UNUMBER
-   {$$=add_number($1);}
+   {$$=add_number($1, p_kbd_mode);}
 | PLUS NUMBER
-{$$=add_capslock($2);}
+{$$=add_capslock($2, p_kbd_mode);}
| PLUS UNUMBER
-   {$$=add_capslock($2);}
+   {$$=add_capslock($2, p_kbd_mode);}
 | PLUS LITERAL
-{$$=add_capslock($2);}
+{$$=add_capslock($2, p_kbd_mode);}
;
 %%

@@ -380,6 +383,7 @@
case 'm':
  optm = 1;
  quiet = 1;
+ p_kbd_mode = &kbd_mode;
  break;
case 's':
  opts = 1;
@@ -389,6 +393,7 @@
  break;
case 'u':
set_charset("unicode");
+   kbd_mode = K_UNICODE;
break;
case 'v':
  verbose++;
diff -aur console-tools-0.2.3.orig/lib/ksyms.c console-tools-0.2.3/lib/ksyms.c
--- console-tools-0.2.3.orig/lib/ksyms.c2006-04-01 09:32:27.0 
+0100
+++ console-tools-0.2.3/lib/ksyms.c 2006-04-01 10:49:16.0 +0100
@@ -1711,12 +1711,12 @@
 /* Functions for loadkeys. */

 int
-ksymtocode(const char *s) {
+ksymtocode(const char *s, const int *kbd_mode) {
int i;
int j;
int keycode;
static int fd = -1;
-   int kbd_mode;
+   int lcl_kbd_mode;
int syms_start = 0;
sym *p;

@@ -1725,21 +1725,25 @@
return -1;
}

-   if (fd < 0)
-   fd = get_console_fd(NULL);
-   ioctl(fd, KDGKBMODE, &kbd_mode);
+   if(kbd_mode)
+   lcl_kbd_mode = *kbd_mode;
+   else {
+   if (fd < 0)
+   fd = get_console_fd(NULL);
+   io

Bug#312844: loadkeys -m -u for building psion kernel already fixed in Sid.

2006-04-01 Thread Tim Woodall

I've discovered that the version of loadkeys in Sid already fixes the
problem building the keyboard map for the psion if you supply the -u
option. Still have the problem that you must be root (patch in bug
#341956 that fixes this)

Has the original poster tried using loadkeys with the -u flag? Or the
version from Sid with the -u flag? This might also fix their problem.

Tim.

--
God said, "div D = rho, div B = 0, curl E = - @B/@t, curl H = J + @D/@t,"
and there was light.

 http://tjw.hn.org/  http://www.locofungus.btinternet.co.uk/


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#341956: Also resolves issues in bug #312844

2006-04-01 Thread Tim Woodall

The version in Sid, together with this patch, also fixes the problems
I've reported in Bug #312844

Tim.

--
God said, "div D = rho, div B = 0, curl E = - @B/@t, curl H = J + @D/@t,"
and there was light.

 http://tjw.hn.org/  http://www.locofungus.btinternet.co.uk/


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#341956: Same problem in package kbd.

2006-04-01 Thread Tim Woodall

Identical problem, fixed by same patch, in package kbd.

(Patch is same change, but the above patch will not apply to the source
in kbd - the indenting is different)

Can this bug also be attached to package kbd? Or does a new bug need
opening?

Tim.



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#345362: Data is stale - problems with belkin driver.

2006-04-03 Thread Tim Woodall

Bother - what I meant to say in that last message and forgot is the
following that is extremely annoying:

Apr  3 22:54:49 pauli upsd[981]: Data for UPS [belkin] is stale - check driver
Apr  3 22:54:50 pauli upsmon[985]: Poll UPS [EMAIL PROTECTED] failed - Data 
stale
Apr  3 22:54:50 pauli upsmon[985]: Communications with UPS [EMAIL PROTECTED] 
lost
Apr  3 22:54:51 pauli upsd[981]: UPS [belkin] data is no longer stale
Apr  3 22:54:55 pauli upsmon[985]: Communications with UPS [EMAIL PROTECTED] 
established
Apr  3 22:54:55 pauli upsmon[985]: UPS [EMAIL PROTECTED] on battery
Apr  3 22:54:55 pauli upsmon[985]: UPS [EMAIL PROTECTED] battery is low
Apr  3 22:54:55 pauli upsd[981]: Client [EMAIL PROTECTED] set FSD on UPS 
[belkin]
Apr  3 22:54:55 pauli upsmon[985]: Executing automatic power-fail shutdown

This has happened to me twice. And on neither occasion was the ups on
battery even for a moment. Nor was the battery low. I suspect that this
was reading bad data from the ups when it reestablished the connection.

Tim.

--
God said, "div D = rho, div B = 0, curl E = - @B/@t, curl H = J + @D/@t,"
and there was light.

 http://tjw.hn.org/  http://www.locofungus.btinternet.co.uk/


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#345362: Seen similar problem with belkin driver

2006-04-03 Thread Tim Woodall

I'm seeing a similar problem with the belkin driver attached to the
serial port.

Nut Version: 2.0.1-4
pauli:/etc/nut# uname -a
Linux pauli.home.woodall.me.uk 2.4.27-3-k6 #1 Wed Feb 8 12:52:54 UTC
2006 i586 GNU/Linux

In my case this seems to be caused by using the scanner which is
attached by an old ISA scsi port (g_NCR5380).

I've tried renice -20 on all the ups drivers and monitor but even that
didn't help.

What's a bit strange is that ssh etc still seems responsive while the
scan is in progress. It just appears that it's the belkin driver that
can't talk to the serial port while the scanner is running. (Note: I get
the same problem if I attempt to run a ppp link over the serial link
while using the scanner)

I'm not too worried, this problem doesn't happen when I use an adaptec
2940 card - only reason I'm using the g_NCR5380 card is because it's an
old machine with only 3 pci slots which are already filled - anyone know
where I can get an old ISA bus video card from? ;-)

Hope this might be of some use tracking down the problem.


Tim.


--
God said, "div D = rho, div B = 0, curl E = - @B/@t, curl H = J + @D/@t,"
and there was light.

 http://tjw.hn.org/  http://www.locofungus.btinternet.co.uk/


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]