ALT Linux kernel packages development
 help / color / mirror / Atom feed
* [d-kernel] Запись на CD/DVD и ядро 2.6.10-std26-up-alt1
@ 2005-01-05  7:36 Alexei Takaseev
  2005-01-05  8:39 ` [d-kernel] " Konstantin A. Lepikhov
  2005-01-05  9:33 ` Konstantin A. Lepikhov
  0 siblings, 2 replies; 3+ messages in thread
From: Alexei Takaseev @ 2005-01-05  7:36 UTC (permalink / raw)
  To: ALT Linux kernel packages development

[-- Attachment #1: Type: text/plain, Size: 881 bytes --]


Приветстсвую!

Имеем:

DVD_RW ND-2510A
cdrecord-2.01-alt3a37
ядро 2.6.10-std26-up-alt1

При попытке записи на болванку из-под пользователя имеем:

[taf@metamorph temp]$ cdrecord dev=2,0,0 speed=4 blank=fast
Cdrecord-Clone 2.01a37 (i586-alt-linux-gnu) Copyright (C) 1995-2004 JЖrg
Schilling scsidev: '2,0,0'
scsibus: 2 target: 0 lun: 0
Linux sg driver version: 3.5.31
Using libscg version 'schily-0.8'.
cdrecord: Cannot allocate memory. Cannot get SCSI I/O buffer.
[taf@metamorph temp]$

Вывод strace прилагается.

Момент, когда поломалось поймать вряд ли смогу уже. До этого на ядре
2.6.9 запись работала.

Кстати, если запустить писалку из-под рута, то очистка диска
производитья будет, а вот запись не пойдет - нак на 0 и будет стоять. А
потом, где-то через две минуты стояния машина виснет намертво, помогает
только Reset.

Картина аналогична и если пытаться писать через k3b.

[-- Attachment #2: trace --]
[-- Type: application/octet-stream, Size: 3763 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [d-kernel] Re: Запись на CD/DVD и ядро 2.6.10-std26-up-alt1
  2005-01-05  7:36 [d-kernel] Запись на CD/DVD и ядро 2.6.10-std26-up-alt1 Alexei Takaseev
@ 2005-01-05  8:39 ` Konstantin A. Lepikhov
  2005-01-05  9:33 ` Konstantin A. Lepikhov
  1 sibling, 0 replies; 3+ messages in thread
From: Konstantin A. Lepikhov @ 2005-01-05  8:39 UTC (permalink / raw)
  To: ALT Linux kernel packages development

Hi Alexei!

Wednesday 05, at 03:36:42 PM you wrote:

<skip>
> При попытке записи на болванку из-под пользователя имеем:
> 
> [taf@metamorph temp]$ cdrecord dev=2,0,0 speed=4 blank=fast
> Cdrecord-Clone 2.01a37 (i586-alt-linux-gnu) Copyright (C) 1995-2004 JЖrg
> Schilling scsidev: '2,0,0'
> scsibus: 2 target: 0 lun: 0
> Linux sg driver version: 3.5.31
> Using libscg version 'schily-0.8'.
> cdrecord: Cannot allocate memory. Cannot get SCSI I/O buffer.
это из-за моего кривого патча для cdrecord. Сегодня обновлю его.

-- 
WBR, Konstantin	      chat with ==>ICQ: 109916175
     Lepikhov,	      speak  to ==>JID: lakostis@jabber.org
aka L.A. Kostis       write  to ==>mailto:lakostis@pisem.net.nospam

...The information is like the bank... 			  (c) EC8OR


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [d-kernel] Re: Запись на CD/DVD и ядро 2.6.10-std26-up-alt1
  2005-01-05  7:36 [d-kernel] Запись на CD/DVD и ядро 2.6.10-std26-up-alt1 Alexei Takaseev
  2005-01-05  8:39 ` [d-kernel] " Konstantin A. Lepikhov
@ 2005-01-05  9:33 ` Konstantin A. Lepikhov
  1 sibling, 0 replies; 3+ messages in thread
From: Konstantin A. Lepikhov @ 2005-01-05  9:33 UTC (permalink / raw)
  To: ALT Linux kernel packages development


[-- Attachment #1.1: Type: text/plain, Size: 722 bytes --]

Hi Alexei!

Wednesday 05, at 03:36:42 PM you wrote:

<skip>
> [taf@metamorph temp]$ cdrecord dev=2,0,0 speed=4 blank=fast
> Cdrecord-Clone 2.01a37 (i586-alt-linux-gnu) Copyright (C) 1995-2004 JЖrg
> Schilling scsidev: '2,0,0'
> scsibus: 2 target: 0 lun: 0
> Linux sg driver version: 3.5.31
> Using libscg version 'schily-0.8'.
> cdrecord: Cannot allocate memory. Cannot get SCSI I/O buffer.
> [taf@metamorph temp]$
попробуйте пересобрать вот с приложенным патчем.

-- 
WBR, Konstantin	      chat with ==>ICQ: 109916175
     Lepikhov,	      speak  to ==>JID: lakostis@jabber.org
aka L.A. Kostis       write  to ==>mailto:lakostis@pisem.net.nospam

...The information is like the bank... 			  (c) EC8OR

[-- Attachment #1.2: cdrtools-2.01a37-skipcheck_priv.patch --]
[-- Type: text/plain, Size: 2594 bytes --]

--- cdrtools-2.01a37/cdrecord/cdrecord.c.skipcheck_priv	2004-12-14 00:00:12 +0300
+++ cdrtools-2.01a37/cdrecord/cdrecord.c	2005-01-05 12:24:06 +0300
@@ -242,7 +242,7 @@
 LOCAL	void	print_wrmodes	__PR((cdr_t *dp));
 LOCAL	BOOL	check_wrmode	__PR((cdr_t *dp, int wmode, int tflags));
 LOCAL	void	set_wrmode	__PR((cdr_t *dp, int wmode, int tflags));
-LOCAL	void	linuxcheck	__PR((void));
+LOCAL	BOOL	linuxcheck	__PR((void));
 
 struct exargs {
 	SCSI	*scgp;
@@ -465,8 +465,10 @@
 	}
 	/*
 	 * XXX Below this point we do not need root privilleges anymore.
+	 *
+	 * XXX Skip this on Linux kernel >= 2.6.9
 	 */
-	if (geteuid() != getuid()) {	/* AIX does not like to do this */
+	if (geteuid() != getuid() && !linuxcheck()) {	/* AIX does not like to do this */
 					/* If we are not root		*/
 #ifdef	HAVE_SETREUID
 		if (setreuid(-1, getuid()) < 0)
@@ -982,8 +984,10 @@
 		 * Note that we need to find a more general way that works
 		 * even on OS that do not support getreuid() which is *BSD
 		 * and SUSv3 only.
+		 *
+		 * XXX Skip this on Linux kernel >= 2.6.9
 		 */
-		if (oeuid != getuid()) {
+		if (oeuid != getuid() && !linuxcheck()) {
 			if (setreuid(-1, oeuid) < 0)
 				errmsg("Could set back effective uid.\n");
 		}
@@ -1000,8 +1004,10 @@
 #if defined(USE_POSIX_PRIORITY_SCHEDULING) && defined(HAVE_SETREUID)
 		/*
 		 * XXX Below this point we never need root privilleges anymore.
+		 *
+		 * XXX Skip this on Linux kernel >= 2.6.9
 		 */
-		if (geteuid() != getuid()) {	/* AIX does not like to do this */
+		if (geteuid() != getuid() && !linuxcheck()) {	/* AIX does not like to do this */
 						/* If we are not root		*/
 			if (setreuid(-1, getuid()) < 0)
 				comerr("Panic cannot set back effective uid.\n");
@@ -4619,3 +4625,37 @@
 	}
 	dsp->ds_wrmode = WM_NONE;
 }
+/*
+ * Kludge for checking linux kernel version
+ * enabling this hack only for >= 2.6.9 kernel
+ *
+ */
+#if    defined(linux) || defined(__linux) || defined(__linux__)
+#ifdef HAVE_UNAME
+#include <sys/utsname.h>
+#endif
+#endif
+
+LOCAL BOOL
+linuxcheck()
+{
+#if    defined(linux) || defined(__linux) || defined(__linux__)
+#ifdef HAVE_UNAME
+	static struct utsname un;
+	int a=0, b=0, c=0, n;
+
+	uname(&un);
+	n=sscanf(un.release, "%d.%d.%d", &a, &b, &c);
+	if (n == 3) {
+		if (a == 2 && b == 6 && c >= 9 ) { 
+			errmsgno(EX_BAD,
+			"Warning: Linux kernel version is %d.%d.%d\n", a, b, c);
+			errmsgno(EX_BAD,
+			"Enabling compatibility hack!\n");
+			return (TRUE);
+		}
+	}
+#endif
+	return (FALSE);
+#endif
+}

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 2212 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-01-05  9:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-05  7:36 [d-kernel] Запись на CD/DVD и ядро 2.6.10-std26-up-alt1 Alexei Takaseev
2005-01-05  8:39 ` [d-kernel] " Konstantin A. Lepikhov
2005-01-05  9:33 ` Konstantin A. Lepikhov

ALT Linux kernel packages development

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel-kernel/0 devel-kernel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel-kernel devel-kernel/ http://lore.altlinux.org/devel-kernel \
		devel-kernel@altlinux.org devel-kernel@altlinux.ru devel-kernel@altlinux.com
	public-inbox-index devel-kernel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git