Bruno Haible <[EMAIL PROTECTED]> wrote: > Eric Blake asked: >> Should the open-safer module depend on open? > > Yes, I think fcntl-safer should depend on 'open'. > > Jim, your opinion?
Yes, most definitely. There are a few other modules that may call open in such a way (for writing, and with an arbitrary, caller-supplied file name) that using the open module would improve portability/consistency. How about this: [and with this I certainly don't need to add that manual dependency on open for coreutils ] >From 5129caf614ceda1cbefc05aed249699a18bf8a77 Mon Sep 17 00:00:00 2001 From: Jim Meyering <[EMAIL PROTECTED]> Date: Tue, 24 Jun 2008 09:40:36 +0200 Subject: [PATCH] make several modules depend on the "open" module This provides slightly increased consistency when opening-for-write the name of a non-directory spelled with a trailing slash. * modules/chdir-safer: Likewise. * modules/chown: Likewise. * modules/clean-temp: Likewise. * modules/copy-file: Likewise. * modules/fchdir: Likewise. * modules/fcntl-safer: Likewise. * modules/pipe: Likewise. * modules/utime: Likewise. Prompted by Eric Blake and Bruno Haible. --- modules/chdir-safer | 1 + modules/chown | 1 + modules/clean-temp | 2 +- modules/copy-file | 7 ++++--- modules/fchdir | 9 +++++---- modules/fcntl-safer | 1 + modules/pipe | 5 +++-- modules/utime | 4 ++-- 8 files changed, 18 insertions(+), 12 deletions(-) diff --git a/modules/chdir-safer b/modules/chdir-safer index 6324158..95103e8 100644 --- a/modules/chdir-safer +++ b/modules/chdir-safer @@ -9,6 +9,7 @@ m4/chdir-safer.m4 Depends-on: fchdir fcntl +open same-inode stdbool diff --git a/modules/chown b/modules/chown index 9e479a5..cf99210 100644 --- a/modules/chown +++ b/modules/chown @@ -7,6 +7,7 @@ lib/fchown-stub.c m4/chown.m4 Depends-on: +open unistd sys_stat diff --git a/modules/clean-temp b/modules/clean-temp index d884d92..a2e55f2 100644 --- a/modules/clean-temp +++ b/modules/clean-temp @@ -10,6 +10,7 @@ stdbool unistd error fatal-signal +open pathmax tmpdir mkdtemp @@ -32,4 +33,3 @@ GPL Maintainer: Bruno Haible - diff --git a/modules/copy-file b/modules/copy-file index 7e82ce8..5f1c6e9 100644 --- a/modules/copy-file +++ b/modules/copy-file @@ -7,13 +7,14 @@ lib/copy-file.c m4/copy-file.m4 Depends-on: -error -safe-read -full-write acl binary-io +error exit +full-write gettext-h +open +safe-read unistd configure.ac: diff --git a/modules/fchdir b/modules/fchdir index 5bfaacf..7cb47dd 100644 --- a/modules/fchdir +++ b/modules/fchdir @@ -7,13 +7,14 @@ lib/dirent.in.h m4/fchdir.m4 Depends-on: -include_next -dup2 -fcntl -unistd canonicalize-lgpl dirfd +dup2 +fcntl +include_next +open strdup +unistd configure.ac: gl_FUNC_FCHDIR diff --git a/modules/fcntl-safer b/modules/fcntl-safer index ecd0500..937b54f 100644 --- a/modules/fcntl-safer +++ b/modules/fcntl-safer @@ -9,6 +9,7 @@ lib/open-safer.c m4/fcntl-safer.m4 Depends-on: +open unistd-safer configure.ac: diff --git a/modules/pipe b/modules/pipe index 8539a0e..916794e 100644 --- a/modules/pipe +++ b/modules/pipe @@ -8,16 +8,17 @@ lib/w32spawn.h m4/pipe.m4 Depends-on: -wait-process +environ error exit fatal-signal gettext-h +open stdbool strpbrk unistd unistd-safer -environ +wait-process configure.ac: gl_PIPE diff --git a/modules/utime b/modules/utime index dc5dd59..9b17eca 100644 --- a/modules/utime +++ b/modules/utime @@ -9,8 +9,9 @@ m4/utimes.m4 m4/utimes-null.m4 Depends-on: -safe-read +open full-write +safe-read configure.ac: gl_FUNC_UTIME @@ -29,4 +30,3 @@ GPL Maintainer: Jim Meyering - -- 1.5.6.58.g8c87e