From: "Konstantin A. Lepikhov" <lakostis@anti-leasure.ru>
To: ALT Linux kernel packages development <devel-kernel@altlinux.ru>
Subject: [d-kernel] Re: Запись на CD/DVD и ядро 2.6.10-std26-up-alt1
Date: Wed, 5 Jan 2005 12:33:54 +0300
Message-ID: <20050105093354.GA23345@lks.home> (raw)
In-Reply-To: <20050105153642.3ca0a364.taf@altlinux.ru>
[-- 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 --]
prev parent reply other threads:[~2005-01-05 9:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-05 7:36 [d-kernel] " Alexei Takaseev
2005-01-05 8:39 ` [d-kernel] " Konstantin A. Lepikhov
2005-01-05 9:33 ` Konstantin A. Lepikhov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050105093354.GA23345@lks.home \
--to=lakostis@anti-leasure.ru \
--cc=devel-kernel@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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