From: Stephen Tweedie (sct@dcs.ed.ac.uk)
Date: 04/24/93


From: sct@dcs.ed.ac.uk (Stephen Tweedie)
Subject: Re: [Q] Why can't non-root format a floppy?
Date: Sat, 24 Apr 1993 19:49:11 GMT

In article <C5wAM9.F7y@crdnns.crd.ge.com>, davidsen@ariel.crd.GE.COM (william E Davidsen) writes:

> I set the devices rw to group (664) and group disk, and I'm in group
> disk, but I can't low level format. However, I *can* write the floppy if
> I format as root, so the permissions would seem to work.

> Anyone got a clue on this?

Yup. The formatting support in the Linux kernel is pretty primitive,
and needs a lot of support from a formatting application to avoid
going wrong. Because of this, formatting is a superuser-only
operation.

You could just make the "fdformat" command suid-root. This will mean
that normal users can format the floppy, but will prevent them from
the hazards of directly accessing the formating system calls.

I'm not sure whether or not fdformat correctly checks that the calling
user has access to the disk device, though; however, it would not be
difficult to implement this if necessary.

Cheers,
 Stephen Tweedie.