From owner-freebsd-questions@FreeBSD.ORG Thu Feb 7 18:07:20 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55DC916A417 for ; Thu, 7 Feb 2008 18:07:20 +0000 (UTC) (envelope-from gahr@gahr.ch) Received: from cpanel03.rubas-s03.net (cpanel03.rubas-s03.net [195.182.222.73]) by mx1.freebsd.org (Postfix) with ESMTP id D798E13C469 for ; Thu, 7 Feb 2008 18:07:19 +0000 (UTC) (envelope-from gahr@gahr.ch) Received: from 80-218-191-236.dclient.hispeed.ch ([80.218.191.236] helo=gahrtop.localhost) by cpanel03.rubas-s03.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1JNB9a-0002OY-PE for freebsd-questions@freebsd.org; Thu, 07 Feb 2008 19:07:18 +0100 Message-ID: <47AB48CF.1020804@gahr.ch> Date: Thu, 07 Feb 2008 19:07:11 +0100 From: Pietro Cerutti User-Agent: Thunderbird 2.0.0.9 (X11/20071121) MIME-Version: 1.0 To: User Questions X-Enigmail-Version: 0.95.5 OpenPGP: id=9571F78E; url=http://www.gahr.ch/pgp Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig7A3FC675188BF95AFFD97EE5" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel03.rubas-s03.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gahr.ch X-Source: X-Source-Args: X-Source-Dir: Subject: cp -p X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2008 18:07:20 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7A3FC675188BF95AFFD97EE5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi list, here's the situation: HostServer exports via NFS /www, which belongs to user:www (uid=3D1001, gid=3D80). The directory has the segid flag set: drwsr-xr-x 13 user www 512 Feb 7 00:58 www HostClient mounts the exported directory on /share/www. HostClient doesn't know anything about gid 80. Now, on HostClient, user copies aFile to /share/www using the -p flag of cp(1). > cp -p aFile /share/www/ > ls -l -rw------- 1 user user 2981888 Feb 7 01:09 /www/aFile As shown, the setgid flag of /www hasn't worked. Now in man cp, I can read the following: "If the source file has its set-user-ID bit on and the user ID cannot be preserved, the set-user-ID bit is not preserved in the copy's permissions. If the source file has its set-group-ID bit on and the group ID cannot be preserved, the set-group-ID bit is not preserved in the copy's permissions. If the source file has both its set-user-ID and set-group-ID bits on, and either the user ID or group ID cannot be preserved, neither the set-user-ID nor set-group-ID bits are preserved in the copy's permissions." I cannot find anywhere information such as "If the /*destination*/ file directory has its set-group-ID bit on and the group-ID cannot be preserved, the set-group-ID bit is not preserved in the copy's permission= s." Assuming that this is the correct and expected behavior, why is it like this? Thank you, --=20 Pietro Cerutti PGP Public Key: http://gahr.ch/pgp --------------enig7A3FC675188BF95AFFD97EE5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHq0jTwMJqmJVx944RCtXZAJ4ly0WsDGcy0i2LlXcCwzzFWE2KLgCgodop SBflmiZjcEP0M7wf+gdiJL0= =A2Ez -----END PGP SIGNATURE----- --------------enig7A3FC675188BF95AFFD97EE5--