From owner-freebsd-bugs Wed Nov 18 21:39:57 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA12472 for freebsd-bugs-outgoing; Wed, 18 Nov 1998 21:39:57 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA12465 for ; Wed, 18 Nov 1998 21:39:56 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id VAA11896; Wed, 18 Nov 1998 21:40:01 -0800 (PST) Received: from nnd.itfs.nsk.su (nnd.itfs.nsk.su [193.124.36.42]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA12141 for ; Wed, 18 Nov 1998 21:36:18 -0800 (PST) (envelope-from nnd@nnd.itfs.nsk.su) Received: (from nnd@localhost) by nnd.itfs.nsk.su (8.9.1/8.9.1) id LAA17771; Thu, 19 Nov 1998 11:35:33 +0600 (NS) (envelope-from nnd) Message-Id: <199811190535.LAA17771@nnd.itfs.nsk.su> Date: Thu, 19 Nov 1998 11:35:33 +0600 (NS) From: nnd@nnd.itfs.nsk.su Reply-To: nnd@nnd.itfs.nsk.su To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/8756: 'pw' command additional feature request Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 8756 >Category: bin >Synopsis: 'pw' command additional feature request >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Nov 18 21:40:01 PST 1998 >Last-Modified: >Originator: Nickolay N. Dudorov >Organization: STE Infoteka >Release: FreeBSD 3.0-BETA i386 >Environment: Any FreeBSD system with 'pw' command >Description: When I as an ISP add new users with 'pw' command I initialize their home-dir through some skeleton directory containing f.e. Maildir and dot.qmail for their mailbox. It is very useful to set 'sunlnk' flag for Maildir components (new, cur, tmp) and 'schg' flag for .qmail file. But this flags are not sets when 'pw' copies skeleton to user home directory. >How-To-Repeat: Create some skeleton and set some flags for it's files and after that do 'pw user add' with this skeleton specified. All flags will be lost in new user home directory. >Fix: The next patch change the 'pw' in such a way that it preserve all the flags for files and directories inside skeleton directory while copiing them to user home directory. I also change one call to 'chown' to 'fchown' call, which can be some kind of optimization :-) =================================================================== diff -rubN pw/cpdir.c pw.new/cpdir.c --- pw/cpdir.c Fri Oct 10 13:23:30 1997 +++ pw.new/cpdir.c Thu Nov 19 11:10:10 1998 @@ -98,8 +98,9 @@ while ((b = read(infd, copybuf, 4096)) > 0) write(outfd, copybuf, b); close(infd); + fchown(outfd, uid, gid); + fchflags(outfd, st.st_flags); close(outfd); - chown(dst, uid, gid); } } } >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message