Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Mar 2010 01:49:30 GMT
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/144920: [patch] [pkg_install] Remove useless chmod after mkdtemp(3) call
Message-ID:  <201003210149.o2L1nUG4078244@www.freebsd.org>
Resent-Message-ID: <201003210150.o2L1o1eJ019924@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         144920
>Category:       bin
>Synopsis:       [patch] [pkg_install] Remove useless chmod after mkdtemp(3) call
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 21 01:50:01 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Garrett Cooper
>Release:        9-CURRENT
>Organization:
Cisco Systems, Inc.
>Environment:
>Description:
There's a useless chmod(2) to 0700 after a mkdtemp(3) call in make_playpen in lib/pen.c. According to mkdtemp(3), this is automatically being done by default:

     The mkdtemp() function makes the same replacement to the template as in
     mktemp() and creates the template directory, mode 0700.
>How-To-Repeat:

>Fix:
See patch.

Patch attached with submission follows:

==== //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/lib/pen.c#1 - /scratch/freebsd/perforce/pkg_install-enhancements/usr.sbin/pkg_install/lib/pen.c ====
@@ -113,10 +113,6 @@
 	cleanup(0);
 	errx(2, "%s: can't mktemp '%s'", __func__, pen);
     }
-    if (chmod(pen, 0700) == FAIL) {
-	cleanup(0);
-	errx(2, "%s: can't mkdir '%s'", __func__, pen);
-    }
 
     if (Verbose) {
 	if (sz) {


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003210149.o2L1nUG4078244>