* [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