Skip Menu |
 

From: Paul Fertser <fercerpav@gmail.com>
To: krb5-bugs@mit.edu
Subject: [PATCH] configure: use appropriate default for krb5_cv_sys_rcdir when cross-compiling
Date: Mon, 28 Sep 2015 13:36:03 +0300
CC: Paul Fertser <fercerpav@gmail.com>, "W. Michael Petullo" <mike@flyn.org>
Download (untitled) / with headers
text/plain 1.1KiB
When cross-compiling, looking at what directories are present on the
build machine makes no sense. Default to the temporary directory as
mandated by the FHS instead.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
---
Hello,

Please consider this to be a bug-report. The problem was discovered
when using this library with OpenWrt (as my build Debian machine has
/var/tmp but OpenWrt target doesn't).

src/configure.in | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/configure.in b/src/configure.in
index fd06dcb..f1fedb9 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -757,11 +757,15 @@ AC_CHECK_TYPE(time_t, long)
AC_MSG_CHECKING([for replay cache directory])
AC_CACHE_VAL(krb5_cv_sys_rcdir,
[
-for t_dir in /var/tmp /usr/tmp /var/usr/tmp /tmp ; do
- test -d $t_dir || continue
- krb5_cv_sys_rcdir=$t_dir
- break
-done])
+if test $cross_compiling = yes; then
+ krb5_cv_sys_rcdir=/tmp
+else
+ for t_dir in /var/tmp /usr/tmp /var/usr/tmp /tmp ; do
+ test -d $t_dir || continue
+ krb5_cv_sys_rcdir=$t_dir
+ break
+ done
+fi])
AC_MSG_RESULT($krb5_cv_sys_rcdir)
KRB5_RCTMPDIR=$krb5_cv_sys_rcdir
AC_SUBST(KRB5_RCTMPDIR)
--
2.1.4
/var/tmp also appears to be mandated by the FHS, and is our preference
for replay caches for a reason (we want replay caches to survive a
reboot). So it seems like a better cross-compilation default than
/tmp, although it wouldn't help your use case. Do you know why
/var/tmp is not present on OpenWRT?
Date: Mon, 28 Sep 2015 19:58:14 +0300
From: Paul Fertser <fercerpav@gmail.com>
To: rt@krbdev.mit.edu
Subject: Re: [krbdev.mit.edu #8254] [PATCH] configure: use appropriate default for krb5_cv_sys_rcdir when cross-compiling
RT-Send-Cc:
Hello,

On Mon, Sep 28, 2015 at 12:21:25PM -0400, Greg Hudson via RT wrote:
Show quoted text
> /var/tmp also appears to be mandated by the FHS, and is our preference
> for replay caches for a reason (we want replay caches to survive a
> reboot). So it seems like a better cross-compilation default than
> /tmp, although it wouldn't help your use case. Do you know why
> /var/tmp is not present on OpenWRT?

My guess would be that since this OS is targetting the least capable
boards that usually only have a very limited amount of flash memory
for storage, a decision was made to make /var a symlink to /tmp. That
way only a single instance of tmpfs is mounted. Creating a /var/tmp
subdirectory that would be practically the same as /tmp might have
seemed odd to the develoers.

But now that I see FHS mandates /var/tmp, I'll try to send a patch for
that.

And by the way, OpenWrt is the correct official spelling.

--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav@gmail.com
Date: Mon, 19 Oct 2015 15:12:42 +0300
From: Paul Fertser <fercerpav@gmail.com>
To: rt@krbdev.mit.edu
Subject: Re: [krbdev.mit.edu #8254] [PATCH] configure: use appropriate default for krb5_cv_sys_rcdir when cross-compiling
RT-Send-Cc:
Hello,

On Mon, Sep 28, 2015 at 07:58:14PM +0300, Paul Fertser wrote:
Show quoted text
> But now that I see FHS mandates /var/tmp, I'll try to send a patch for
> that.

The patch was accepted upstream [1].

The change to the configure script proposed here still makes sense,
and I see now that /var/tmp is an appropriate default. Should I resend
the patch with this amendment or can you simply fix it up when
commiting?

[1] http://git.openwrt.org/?p=openwrt.git;a=commitdiff;h=0ea3763504cceffca678c34fc7998952b7d62dc8
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav@gmail.com
From: ghudson@mit.edu
Subject: git commit

Use fixed rcache directory when cross-compiling

When cross-compiling, looking at what directories are present on the
build machine makes no sense. Default to /var/tmp instead.

[ghudson@mit.edu: use /var/tmp instead of /tmp; adjust commit message]

https://github.com/krb5/krb5/commit/db2acb6b06e469c6c12476bec68acc7964626523
Author: Paul Fertser <fercerpav@gmail.com>
Committer: Greg Hudson <ghudson@mit.edu>
Commit: db2acb6b06e469c6c12476bec68acc7964626523
Branch: master
src/configure.in | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
From: tlyu@mit.edu
Subject: git commit

Use fixed rcache directory when cross-compiling

When cross-compiling, looking at what directories are present on the
build machine makes no sense. Default to /var/tmp instead.

[ghudson@mit.edu: use /var/tmp instead of /tmp; adjust commit message]

(cherry picked from commit db2acb6b06e469c6c12476bec68acc7964626523)

https://github.com/krb5/krb5/commit/b32e0380cd37f90a009e4655a29d9fe7c6375fcb
Author: Paul Fertser <fercerpav@gmail.com>
Committer: Tom Yu <tlyu@mit.edu>
Commit: b32e0380cd37f90a009e4655a29d9fe7c6375fcb
Branch: krb5-1.14
src/configure.in | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)