Here are the patches I sorted and improved from Svante's one[1].
Thank him for the original works. What I did are,

* Make the PATH_MAX hack clearer. (I don't know whether you really
  like this way. If not, I can change it.)

* Fix new compiling error of missing HOST_NAME_MAX in pam_xauth.c

* Use tcgetattr/tcsetattr instead of Linux-specific ioctl.

One problem I can't solve is in libpam/pam_modutil_priv.c.

In that file, it tries to lower the fsuid (Linux-specific) to
constrain the privileges of the program and get back then.
As far as I can understand, this avoids changing euid but not
being able to get back. I can't find a way to do that perfectly
on Hurd, or in a portable way. Svante's patch can pass the
tests. But the codes are not very elegant for its bad indents
and not checking the return value, which is complained by
compiler a lot. However, I don't have a better solution for this.
So please discuss how to handle this.

These are the patches for pam codes. As for the debian packaging
problems, I'll send another mails about it.

Thanks.

Yuqian Yang (2):
  (GNU/Hurd) add max length hack.
  (GNU/Hurd) port Linux-specific api.

 examples/tty_conv.c                           |  7 ++--
 libpam/include/pam_hurd_max_stub.h            | 11 +++++
 libpam/pam_modutil_priv.c                     | 40 +++++++++++++++++++
 modules/pam_debug/tst-pam_debug-retval.c      |  1 +
 modules/pam_deny/tst-pam_deny-retval.c        |  1 +
 modules/pam_echo/tst-pam_echo-retval.c        |  1 +
 .../pam_faildelay/tst-pam_faildelay-retval.c  |  1 +
 .../pam_localuser/tst-pam_localuser-retval.c  |  1 +
 .../pam_mkhomedir/tst-pam_mkhomedir-retval.c  |  1 +
 modules/pam_nologin/tst-pam_nologin-retval.c  |  1 +
 modules/pam_permit/tst-pam_permit-retval.c    |  1 +
 modules/pam_rootok/tst-pam_rootok-retval.c    |  1 +
 modules/pam_warn/tst-pam_warn-retval.c        |  1 +
 modules/pam_xauth/pam_xauth.c                 |  4 ++
 tests/tst-dlopen.c                            |  4 +-
 15 files changed, 69 insertions(+), 7 deletions(-)
 create mode 100644 libpam/include/pam_hurd_max_stub.h

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1029097#35

-- 
Yuqian Yang <crup...@crupest.life>

Reply via email to