Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Sep 2002 13:39:48 +0300
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Johan Karlsson <johan@FreeBSD.org>
Cc:        Tom Rhodes <trhodes@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, bde@FreeBSD.org, jhb@FreeBSD.org
Subject:   Re: cvs commit: src/bin/chmod chmod.1 chmod.c
Message-ID:  <20020918103948.GA75692@sunbay.com>
In-Reply-To: <20020918062046.GB8620@numeri.campus.luth.se>
References:  <200209172338.g8HNcXjJ026355@freefall.freebsd.org> <20020918062046.GB8620@numeri.campus.luth.se>

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

--IS0zKkzwUGydFO0o
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Sep 18, 2002 at 08:20:46AM +0200, Johan Karlsson wrote:
> Hi
>=20
> On Tue, Sep 17, 2002 at 16:38 (-0700) +0000, Tom Rhodes wrote:
> > trhodes     2002/09/17 16:38:33 PDT
> >=20
> >   Modified files:        (Branch: RELENG_4)
> >     bin/chmod            chmod.1 chmod.c=20
> >   Log:
> >   MFC: 'h' missing in getopt() call
>=20
> I'm still missing the functional change in rev 1.21 of chmod.c
>=20
> This cut-n-pasted part of that change has not yet been MFCed.
>=20
> =3D=3D=3D=3D
> @@ -102,9 +103,10 @@ main(argc, argv)
>                         /*
>                          * In System V (and probably POSIX.2) the -h opti=
on
>                          * causes chmod to change the mode of the symbolic
> -                        * link.  4.4BSD's symbolic links don't have mode=
s,
> -                        * so it's an undocumented noop.  Do syntax check=
ing,
> -                        * though.
> +                        * link.  4.4BSD's symbolic links didn't have mod=
es,
> +                        * so it was an undocumented noop.  In FreeBSD 3.=
0,
> +                        * lchmod(2) is introduced and this option does r=
eal
> +                        * work.
>                          */
>                         hflag =3D 1;
>                         break;
> @@ -148,6 +150,11 @@ done:      argv +=3D optind;
>         } else
>                 fts_options =3D FTS_LOGICAL;
> =20
> +       if (hflag)
> +               change_mode =3D lchmod;
> +       else
> +               change_mode =3D chmod;
> +
>         mode =3D *argv;
>         if (*mode >=3D '0' && *mode <=3D '7') {
>                 errno =3D 0;
> @@ -190,14 +197,17 @@ done:     argv +=3D optind;
>                          * don't point to anything and ones that we found
>                          * doing a physical walk.
>                          */
> -                       continue;
> +                       if (!hflag)
> +                               continue;
> +                       /* else */
> +                       /* FALLTHROUGH */
>                 default:
>                         break;
>                 }
>                 newmode =3D oct ? omode : getmode(set, p->fts_statp->st_m=
ode);
>                 if ((newmode & ALLPERMS) =3D=3D (p->fts_statp->st_mode & =
ALLPERMS))
>                         continue;
> -               if (chmod(p->fts_accpath, newmode) && !fflag) {
> +               if ((*change_mode)(p->fts_accpath, newmode) && !fflag) {
>                         warn("%s", p->fts_path);
>                         rval =3D 1;
>                 } else {
> =3D=3D=3D=3D=3D=3D=3D
>=20
>=20
> Bruce, Ruslan, is this something that should be MFCed as well
> or do we only want to document the faked support for -h?
>=20
> /Johan K
>=20
>=20
> >  =20
> >   PR:             41926
> >   Submitted by:   Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
> >   Reviewed by:    johan, bde, jhb
> >   Approved by:    re (jhb)
> >  =20
> >   Revision   Changes    Path
> >   1.17.2.11  +1 -1      src/bin/chmod/chmod.1
> >   1.16.2.4   +3 -3      src/bin/chmod/chmod.c
>=20
I don't object this be MDCed, I just think it's too late now in
the release cycle.


Cheers,
--=20
Ruslan Ermilov		Sysadmin and DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

--IS0zKkzwUGydFO0o
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE9iFf0Ukv4P6juNwoRAhFHAJ0UL14O/JPgUcbIJI+yI/IkGO6CMwCfURJK
siR7omkNcDLpLxf9finzeBw=
=PJ+B
-----END PGP SIGNATURE-----

--IS0zKkzwUGydFO0o--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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