From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 13 Dec 2004 17:37:04 +0300 From: "Konstantin A. Lepikhov" To: ALT Devel discussion list Message-ID: <20041213143704.GB7433@lks.home> Mail-Followup-To: ALT Devel discussion list References: <20041212215603.GA29983@lks.home> <20041213104917.GF6127@basalt.office.altlinux.org> <20041213105739.GA10215@lks.home> <20041213110217.GJ6127@basalt.office.altlinux.org> Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="KDt/GgjP6HVcx58l" Content-Disposition: inline In-Reply-To: <20041213110217.GJ6127@basalt.office.altlinux.org> X-Operation-System: ALT Linux Sisyphus (20041029) 2.6.9-wks26-up-alt2 User-Agent: Mutt/1.5.6+cvs20041102i X-AV-Checked: ClamAV using ClamSMTP Subject: [devel] Re: NMU: cdrecord X-BeenThere: devel@altlinux.ru X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ALT Devel discussion list List-Id: ALT Devel discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Dec 2004 14:35:56 -0000 Archived-At: List-Archive: List-Post: --KDt/GgjP6HVcx58l Content-Type: multipart/mixed; boundary="SkvwRMAIpAhPCcCJ" Content-Disposition: inline --SkvwRMAIpAhPCcCJ Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Dmitry! Monday 13, at 02:02:17 PM you wrote: > On Mon, Dec 13, 2004 at 01:57:39PM +0300, Konstantin A. Lepikhov wrote: > > > > =D5 ldv@ =C5=D3=D4=D8 =D6=C5=CC=C1=CE=C9=C5 =D3=C4=C5=CC=C1=D4=D8 = =DC=D4=CF =D7 =F3=C9=DA=C9=C6/updates? > > >=20 > > > =EE=C5=D4, =DC=D4=CF =D6=C5 2.6-only change: > > >=20 > > OK =C1 =C5=D3=CC=C9 =D1 =D3=C4=C5=CC=C1=C0 =CF=C2=D7=D1=DA=CB=D5 =CE=C1= kernel_version? >=20 > =F4=CF=C7=C4=C1 =CD=CF=D6=C5=D4=C5 =D7=DA=D1=D4=D8 =D0=C5=D2=C5=C8=CF=C4= =D1=DD=C9=CA =C6=CC=C1=C7 =CD=C1=CE=D4=C5=CA=CE=C5=D2=C1 =D0=C1=CB=C5=D4=C1. =EE=C9=CB=D4=CF =CE=C5 =D0=D2=CF=D4=C9=D7 =D4=C1=CB=CF=C7=CF =D0=C1=D4=DE= =C1? =E5=D3=CC=C9 =CE=C5=D4, =D1 =D7=D9=CB=CC=C1=C4=D9=D7=C1=C0 =D7 =F3=C9= =DA=C9=C6 =C9 backports --=20 WBR, Konstantin chat with =3D=3D>ICQ: 109916175 Lepikhov, speak to =3D=3D>JID: lakostis@jabber.org aka L.A. Kostis write to =3D=3D>mailto:lakostis@pisem.net.nospam =2E..The information is like the bank... (c) EC8OR --SkvwRMAIpAhPCcCJ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="cdrtools-2.01a37-skipcheck_priv.patch" Content-Transfer-Encoding: quoted-printable --- cdrtools-2.01a37/cdrecord/cdrecord.c.skipcheck_priv 2004-12-13 14:45:02= +0300 +++ cdrtools-2.01a37/cdrecord/cdrecord.c 2004-12-13 14:52:03 +0300 @@ -242,7 +242,7 @@ LOCAL void print_drflags __PR((cdr_t *dp 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)); =20 struct exargs { SCSI *scgp; @@ -465,8 +465,10 @@ main(ac, av) } /* * XXX Below this point we do not need root privilleges anymore. + * + * XXX Skip this on Linux kernel >=3D 2.6.9 */ - if (geteuid() !=3D getuid()) { /* AIX does not like to do this */ + if (geteuid() !=3D getuid() && !linuxcheck()) { /* AIX does not like to d= o this */ /* If we are not root */ #ifdef HAVE_SETREUID if (setreuid(-1, getuid()) < 0) @@ -982,8 +984,10 @@ if (lverbose > 2) * 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 >=3D 2.6.9 */ - if (oeuid !=3D getuid()) { + if (oeuid !=3D getuid() && !linuxcheck()) { if (setreuid(-1, oeuid) < 0) errmsg("Could set back effective uid.\n"); } @@ -1000,8 +1004,10 @@ if (lverbose > 2) #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 >=3D 2.6.9 */ - if (geteuid() !=3D getuid()) { /* AIX does not like to do this */ + if (geteuid() !=3D 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,34 @@ set_wrmode(dp, wmode, tflags) } dsp->ds_wrmode =3D WM_NONE; } +/* + * Kludge for checking linux kernel version + * enabling this hack only for >=3D 2.6.9 kernel + * + */ +#if defined(linux) || defined(__linux) || defined(__linux__) +#ifdef HAVE_UNAME +#include +#endif +#endif + +LOCAL BOOL +linuxcheck() +{ +#if defined(linux) || defined(__linux) || defined(__linux__) +#ifdef HAVE_UNAME + struct utsname un; + if (uname(&un) >=3D 0) { + if ((un.release[0] =3D=3D '2' && un.release[1] =3D=3D '.') && + (un.release[2] =3D=3D '6' && un.release[3] >=3D 9)) { + errmsgno(EX_BAD, + "Warning: Running on Linux-%s\n", un.release); + errmsgno(EX_BAD, + "Enabling compatability hack!\n"); + return (TRUE); + } + } +#endif + return (FALSE); +#endif +} --SkvwRMAIpAhPCcCJ-- --KDt/GgjP6HVcx58l Content-Type: application/x-pkcs7-signature Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIIIoAYJKoZIhvcNAQcCoIIIkTCCCI0CAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3DQEHAaCC BiQwggLdMIICRq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