[Prev][Next][Index][Thread]

QCAM 0.1 now available



Scott Laird writes:

 > This program *must* be run as root to allow access to the parallel
 > port.  This program should *not* be run SUID root, as it does very
 > little error checking.

There's little difference between running it while logged in as root
vs running it SUID root.  Security concerns are reasonable.  I
modified qcam.c so that it resets the userid just after getting the
I/O permissions.  It's possible to call setuid(0) before resetting
permissions, but it's not necessary to reset permissions because they
only apply to the current process, and it's going away.

   /* Attempt to get permission to access IO ports.  Must be root */

   if (ioperm(qcport, 3, 1)) {
     fprintf(stderr, "%s: can't get ioperm.  Exiting.\n",argv[0]);
     exit(1);
   }

+  setuid(getuid());

Now the makefile needs an ``install'' procedure which includes:

	chown root qcam
	chmod u+s qcam

-russ <nelson@crynwr.com>    http://www.crynwr.com/~nelson
Crynwr Software   | Crynwr Software sells packet driver support | PGP ok
11 Grant St.      | +1 315 268 1925 voice | Good government is a contradiction
Potsdam, NY 13676 | +1 315 268 9201 FAX   | in terms.  Ask me for details.

Follow-Ups: References: