ports/50540: Port print/muttprint ver 0.64 works incorrectly in multiuser environment

Alex Semenyaka alexs at snark.ratmir.ru
Wed Apr 2 11:30:14 UTC 2003


>Number:         50540
>Category:       ports
>Synopsis:       Port print/muttprint ver 0.64 works incorrectly in multiuser environment
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 02 03:30:12 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Alex Semenyaka
>Release:        FreeBSD 4.8-RC i386
>Organization:
Ratmir
>Environment:
System: FreeBSD snark.ratmir.ru 4.8-RC FreeBSD 4.8-RC #7: Sun Mar 30 07:23:48 MSD 2003 root at snark.ratmir.ru:/usr/obj/usr/src/sys/SNARK i386

>Description:

Muttprint creates a temporary file with the fixed hard-coded name 
``/tmp/muttprint-geometry-ver''. This name as can see does not depends on
the environment muttprint was run (i.e. user id, configuration options and
so on). The main problems that the file is the same for all users. If the port
is used by a user with umask 077, for example, than this will be the only user
(except with root) who will be able to use this port.

>How-To-Repeat:

1) install muttprint
2) log in as the user A
3) set up umask 077
4) print anything with muttprint
5) log in as the user B
6) try to print anything with muttprint

>Fix:

Just form the name of the temporary file on the base of user ID. Since muttprint
is the Perl script the fix is extremely simple:

--- /usr/local/bin/muttprint	Wed Apr  2 15:09:38 2003
+++ muttprint	Wed Apr  2 15:06:22 2003
@@ -1534,3 +1534,3 @@
 sub GetGeometryVersion {
-	my $tempfile = "/tmp/muttprint-geometry-ver.$<";
+	my $tempfile = "/tmp/muttprint-geometry-ver";
 	my $geometryVersion;
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list