Re: Autoconf help for calife needed
On 28/08/2025 09:21, Andreas Tille wrote:
Hi,
I need some autoconf help with 'calife'. The former maintainer worked
around issues with `--without autoconf` which fails with the new
upstream version which I injected in Salsa[1]. I tried my best with
patching autoconf stuff to get rid of some warnings ... but my best is
not sufficient obviously.
Couldn't resist checking out my surname namesake package.
The build error is:
configure: error: unrecognized option: `--runstatedir=/run'
dh_auto_configure's autoconf [1] behaves differently above compat=10
push @opts, "--runstatedir=/run" if not compat(10);
The existing ./configure doesn't understand 'runstatedir'
Maybe put it back to compat=10 since it's an old package.
Even with compat=10, it configures, but doesn't build, compiler error.
I don't see how this can ever compile with any flags/gcc/c-std/whatever.
Seems that whoami() was refactored but not tested.
Suggested patch below. Compile-tested only, just checked whoami() prints
in syslog.
Happy to offer a cmake patch/MR since it's just a handful of c files and
upstream seems gone.
--PATCH--------------------------
diff --git a/calife.c b/calife.c
index 727324d..2ba999c 100644
--- a/calife.c
+++ b/calife.c
@@ -372,7 +372,7 @@ main (int argc, char * argv [])
}
uid = getuid();
- name = whoami();
+ name = whoami(tty);
/*
* open syslod log file
@@ -787,7 +787,7 @@ exec_shell (char * shell_name)
**/
char *
-whoami (void)
+whoami (char * tty)
{
char * login, * name;
struct passwd *pwd;
diff --git a/conf.h b/conf.h
index c605fe6..8dfc6e5 100644
--- a/conf.h
+++ b/conf.h
@@ -188,7 +188,7 @@ typedef struct cred_t cred_t;
# endif /* HAVE_BASENAME */
void * xalloc (size_t size);
_Noreturn void die (int err, const char * fmt,...) _NORETURN;
- char * whoami(void);
+ char * whoami(char * tty);
#ifdef WITH_PAM
int auth_pam(struct passwd **ppw, const char *pass);
#endif
--END----------------------------
1. /usr/share/perl5/Debian/Debhelper/Buildsystem/autoconf.pm
--
Regards,
Ahmad
Reply to: