[cl-debian] Bug#477169: post-sysdef-install.lisp: GET-UID broken on ECL and otherwise inconsistent

Luca Capello luca at pca.it
Mon Jun 9 15:45:32 UTC 2008


tags 477169 + pending
thanks

Hi Mark!

Cc:ing Kevin M. Rosenberg (the other c-l-c maintainer) since I'm not
sure he reads the pkg-common-lisp-devel.  And always because of that I'm
sorry for having quoted most of your mail.

On Mon, 21 Apr 2008 16:47:52 +0200, Mark Wooding wrote:
> I recently found that my ECL fails to ASDF-whatever systems.  It fails
> like this:
>
> [metalzone ~]ecl
[...]
>> (asdf:oos 'asdf:load-op :cl-ppcre)
> ; loading system definition from
> /usr/share/common-lisp/systems/cl-ppcre.asd
> ; into #<ASDF0 package>
> ; registering #<SYSTEM :CL-PPCRE 135932064> as CL-PPCRE
> 1000
> Unable to find out user ID
> Broken at EVAL.No restarts available.
> Broken at ASDF:OPERATE.
>>>
>
> Tracking down the problem shows that CLC's fallback implementation of
> GET-UID, in terms of `id', isn't working for whatever reason (presumably
> ECL doesn't do the right output-redirection stuff).
>
> Since ECL has a convenient FFI, it's trivial to implement a working
> GET-UID which doesn't need to mess with running shell commands and doing
> redirection.
>
> While staring at this code, I've noticed inconsistencies in the
> behaviour of GET-UID:
>
>   * SBCL, CMU and Allegro (and now ECL) use the real uid of the process.
>
>   * CLisp uses the uid of the user named by the USER environment
>     variable.
>
>   * Other Lisps call `id -u', which returns the effective uid.
>
> This is clearly an undesirable state of affairs, so the patch below
> makes everyone use the ruid.

Thank you for having tracked down the problem and for the patch as well.

Instead of simply applied it, I splitted into three pieces.

1) fix the ECL error
   commit e23cc4609fae905243441c8107653c4ffb012745 [1]

   ECL must depend at least on the first version of c-l-c that includes
   this fix

2) use (posix:getuid) for CLISP
   commit 2c2bbc99707d8769c7433532ada7723ac47aac0a [2]

   `posix:getuid' is present in CLISP since version 2.36: it was added
   to clisp/modules/syscalls/posix.lisp with CVS revision 1.46 [3]
   (2005-12-04).  Since c-l-c already conflicts with CLISP versions less
   than 2.36, we're OK.

   However, CVS revision 1.79 [4] removed the GET prefix, so we need to
   remember this when packaging newer CLISP versions.

3) use the real uid of the process for other Lisps
   commit 1f3e7d0487df08c5746180c059774c85fbcf40cb [5]

I don't think these changes value a new major version (i.e. 7.0).
Kevin, what do you think about it?  Since I need to fix also some
lintian warnings about c-l-c, I'll upload it in the next days as version
6.15 if no one argues.

Thx, bye,
Gismo / Luca

Footnotes: 
[1] http://git.debian.org/?p=pkg-common-lisp/common-lisp-controller.git;a=commitdiff;h=e23cc4609fae905243441c8107653c4ffb012745
[2] http://git.debian.org/?p=pkg-common-lisp/common-lisp-controller.git;a=commitdiff;h=2c2bbc99707d8769c7433532ada7723ac47aac0a
[3] 2005-09-25  Sam Steingold  <sds at gnu.org>

        * modules/syscalls/calls.c (GETUID, %SETUID, GETGID, %SETGID)
        (GETEUID, %SETEUID, GETEGID, %SETEGID): implemented
        * modules/syscalls/posix.lisp (getuid, getgid, geteuid, getegid):
        exported and DEFSETFed
        * modules/syscalls/configure.in (gid_t, uid_t): AC_CHECK_SIZEOF
        (getegid, geteuid, getgid, getuid, setegid, seteuid, setgid, setuid):
        AC_CHECK_FUNCS

    http://clisp.cvs.sourceforge.net/clisp/clisp/modules/syscalls/posix.lisp?r1=1.45&r2=1.46
[4] 2008-06-05  Sam Steingold  <sds at gnu.org>

        * modules/syscalls/calls.c, modules/syscalls/posix.lisp:
        remove the GET prefix from SETFable functions
        PGID, UID, GID, EUID, EGID, GROUPS

    http://clisp.cvs.sourceforge.net/clisp/clisp/modules/syscalls/posix.lisp?r1=1.78&r2=1.79
[5] http://git.debian.org/?p=pkg-common-lisp/common-lisp-controller.git;a=commitdiff;h=1f3e7d0487df08c5746180c059774c85fbcf40cb
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 314 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-debian/attachments/20080609/340abb43/attachment.sig>


More information about the Cl-debian mailing list