bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: split off module fchownat from module openat


From: Jim Meyering
Subject: Re: split off module fchownat from module openat
Date: Tue, 01 Nov 2011 08:25:42 +0100

Bruno Haible wrote:
> Hi Jim, Eric,
>
> Here is a proposed patch to split fchownat() off from the module 'openat'.
>
> The immediate motivation is that on MSVC, there is no <pwd.h> and no
> <grp.h>, therefore code that fiddles with owners and groups leads to
> many more compilation problems than code that just deals with files
> and directories. And the module 'getcwd' depends on 'openat'.
>
> The long-standing motivation is that a program that just needs to open
> a file should not contain (or need to compile) code for changing
> ownership, access modes, or for creating or removing files or directories.
>
> For this reason, I'll submit more patches like this, until the module
> 'openat' really only provides openat().
>
> This patch is tested on a number of platforms (Linux, MacOS X, FreeBSD,
> OpenBSD, NetBSD, Cygwin, etc.)
>
>
> 2011-10-31  Bruno Haible  <address@hidden>
>
>       New module 'fchownat', split off from module 'openat'.
>       * lib/openat.h (chownat, lchownat): Enable only if GNULIB_FCHOWNAT is
>       defined.
>       * m4/fchownat.m4: New file, extracted from m4/openat.m4.
>       * m4/openat.m4 (gl_FUNC_OPENAT): Don't set GNULIB_FCHOWNAT. Don't
>       invoke gl_FUNC_FCHOWNAT.
>       (gl_FUNC_FCHOWNAT_DEREF_BUG, gl_FUNC_FCHOWNAT_EMPTY_FILENAME_BUG,
>       gl_FUNC_FCHOWNAT): Moved to m4/fchownat.m4.
>       * modules/fchownat: New file, extracted from modules/openat.
>       * modules/openat (Files): Remove lib/fchownat.c.
>       (Depends-on): Remove lchown.
>       (configure.ac): Remove AC_LIBOBJ of fchownat.
>       * modules/fchownat-tests: New file, extracted from modules/openat-tests.
>       * modules/openat-tests (Files): Remove tests/test-fchownat.c,
>       tests/test-chown.h, tests/test-lchown.h, tests/nap.h.
>       (Depends-on): Remove mgetgroups, usleep, stat-time.
>       (configure.ac): Remove test for getegid.
>       (Makefile.am): Remove rules for test-fchownat.
>       * doc/posix-functions/fchownat.texi: Mention module 'fchownat' instead
>       of module 'openat'.
>       * NEWS: Mention the change.

I'm glad you found the time to work on this.
That change looks fine.  I'll test via coreutils once it's pushed.

Thank you.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]