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>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Wed, Sep 18, 2002 at 08:20:46AM +0200, Johan Karlsson wrote:
> Hi
>
> On Tue, Sep 17, 2002 at 16:38 (-0700) +0000, Tom Rhodes wrote:
> > trhodes 2002/09/17 16:38:33 PDT
> >
> > Modified files: (Branch: RELENG_4)
> > bin/chmod chmod.1 chmod.c
> > Log:
> > MFC: 'h' missing in getopt() call
>
> I'm still missing the functional change in rev 1.21 of chmod.c
>
> This cut-n-pasted part of that change has not yet been MFCed.
>
> ====
> @@ -102,9 +103,10 @@ main(argc, argv)
> /*
> * In System V (and probably POSIX.2) the -h option
> * causes chmod to change the mode of the symbolic
> - * link. 4.4BSD's symbolic links don't have modes,
> - * so it's an undocumented noop. Do syntax checking,
> - * though.
> + * link. 4.4BSD's symbolic links didn't have modes,
> + * so it was an undocumented noop. In FreeBSD 3.0,
> + * lchmod(2) is introduced and this option does real
> + * work.
> */
> hflag = 1;
> break;
> @@ -148,6 +150,11 @@ done: argv += optind;
> } else
> fts_options = FTS_LOGICAL;
>
> + if (hflag)
> + change_mode = lchmod;
> + else
> + change_mode = chmod;
> +
> mode = *argv;
> if (*mode >= '0' && *mode <= '7') {
> errno = 0;
> @@ -190,14 +197,17 @@ done: argv += optind;
> * don't point to anything and ones that we found
> * doing a physical walk.
> */
> - continue;
> + if (!hflag)
> + continue;
> + /* else */
> + /* FALLTHROUGH */
> default:
> break;
> }
> newmode = oct ? omode : getmode(set, p->fts_statp->st_mode);
> if ((newmode & ALLPERMS) == (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 = 1;
> } else {
> =======
>
>
> Bruce, Ruslan, is this something that should be MFCed as well
> or do we only want to document the faked support for -h?
>
> /Johan K
>
>
> >
> > PR: 41926
> > Submitted by: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
> > Reviewed by: johan, bde, jhb
> > Approved by: re (jhb)
> >
> > 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
>
I don't object this be MDCed, I just think it's too late now in
the release cycle.
Cheers,
--
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
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)
iD8DBQE9iFf0Ukv4P6juNwoRAhFHAJ0UL14O/JPgUcbIJI+yI/IkGO6CMwCfURJK
siR7omkNcDLpLxf9finzeBw=
=PJ+B
-----END PGP SIGNATURE-----
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020918103948.GA75692>
