Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] useless set*id binaries
Date: Sat, 28 Jan 2012 01:49:15
Message-Id: 201201272049.16394.vapier@gentoo.org
In Reply to: Re: [gentoo-dev] useless set*id binaries by Samuli Suominen
1 On Friday 27 January 2012 20:07:45 Samuli Suominen wrote:
2 > On 01/28/2012 02:41 AM, Mike Frysinger wrote:
3 > > On Friday 27 January 2012 19:18:07 Samuli Suominen wrote:
4 > >> On 01/28/2012 02:14 AM, Mike Frysinger wrote:
5 > >>> along these lines, why is cdrtools set*id ? if we have a "cdrom"
6 > >>> group, and we assign our cdroms/dvdroms to that group, then we already
7 > >>> have access control in place and can skip the set*id.
8 > >>
9 > >> cdrtools can't probe the drives without the binary being setuid, or the
10 > >> user belonging to the 'disk' group (and even that is not enough in some
11 > >> cases if the permissions vary)
12 > >
13 > > the drives are owned by the "cdrom" group and have group +rw. so if the
14 > > user is in the "cdrom" group, why can't they probe the drives ?
15 > >
16 > > "disk" owns the non-removable hard drives.
17 > >
18 > > $ ls -l /dev/sr0 /dev/sg0 /dev/sg6
19 > > crw-rw---- 1 root disk 21, 0 Jan 6 23:07 /dev/sg0
20 > > crw-rw---- 1 root cdrom 21, 6 Jan 6 23:07 /dev/sg6
21 > > brw-rw---- 1 root cdrom 11, 0 Jan 17 22:28 /dev/sr0
22 > > -mike
23 >
24 > i dont know why, but it does probe also non-removable disks... it probes
25 > per bus, iirc
26 >
27 > you can try it easily yourself:
28
29 this is a failure in cdrecord (not that surprising). it aborts after the first
30 EACCES it gets on /dev/sg# instead of continuing on. granting set*id to a
31 binary because they can't be bothered to try the next device is dumb.
32
33 $ sudo mv /dev/sg[0-5] ~/
34 $ sudo chmod 755 /usr/bin/cdrecord
35 $ cdrecord -scanbus
36
37 Cdrecord-ProDVD-ProBD-Clone 3.01a06 (x86_64-unknown-linux-gnu) Copyright (C)
38 1995-2011 Joerg Schilling
39 TOC Type: 1 = CD-ROM
40 Linux sg driver version: 3.5.34
41 Using libscg version 'schily-0.9'.
42 Using libscg transport code version 'schily-scsi-linux-sg.c-1.95'
43 Driveropts: 'burnfree'
44 SCSI buffer size: 32768
45 scsibus7:
46 7,0,0 700) 'TSSTcorp' 'CDDVDW SH-S222L ' 'SB03' Removable CD-ROM
47 7,1,0 701) *
48 7,2,0 702) *
49 7,3,0 703) *
50 7,4,0 704) *
51 7,5,0 705) *
52 7,6,0 706) *
53 7,7,0 707) *
54 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] useless set*id binaries Samuli Suominen <ssuominen@g.o>