On systems without 'setfsuid', use 'setreuid' instead. The patch originates from the Debian project for GNU/Hurd. Authors: Steve Langasek Upstream status: A ticket was opened to request apply the patch, ticket: 'https://fedorahosted.org/linux-pam/ticket/64'. --- Linux-PAM-1.2.1/libpam/pam_modutil_priv.c 2015-03-24 06:02:32.000000000 -0600 +++ pam_modutil_priv-mod.c 2016-09-20 13:36:53.150663205 -0500 @@ -14,7 +14,9 @@ #include #include #include +#ifdef HAVE_SYS_FSUID_H #include +#endif /* HAVE_SYS_FSUID_H */ /* * Two setfsuid() calls in a row are necessary to check @@ -22,17 +24,55 @@ */ static int change_uid(uid_t uid, uid_t *save) { +#ifdef HAVE_SYS_FSUID_H uid_t tmp = setfsuid(uid); if (save) *save = tmp; return (uid_t) setfsuid(uid) == uid ? 0 : -1; +#else + uid_t euid = geteuid(); + uid_t ruid = getuid(); + if (save) + *save = ruid; + if (ruid == uid && uid != 0) + if (setreuid(euid, uid)) + return -1; + else { + setreuid(0, -1); + if (setreuid(-1, uid)) { + setreuid(-1, 0); + setreuid(0, -1); + if (setreuid(-1, uid)) + return -1; + } + } +#endif } static int change_gid(gid_t gid, gid_t *save) { +#ifdef HAVE_SYS_FSUID_H gid_t tmp = setfsgid(gid); if (save) *save = tmp; return (gid_t) setfsgid(gid) == gid ? 0 : -1; +#else + gid_t egid = getegid(); + gid_t rgid = getgid(); + if (save) + *save = rgid; + if (rgid == gid) + if (setregid(egid, gid)) + return -1; + else { + setregid(0, -1); + if (setregid(-1, gid)) { + setregid(-1, 0); + setregid(0, -1); + if (setregid(-1, gid)) + return -1; + } + } +#endif } static int cleanup(struct pam_modutil_privs *p) ption value='range'>range
path: root/NEWS
AgeCommit message (Expand)Author
2024-04-18news: Add entry for nss-certs being added to %base-packages....* etc/news.scm: New entry. * NEWS: Update news. Change-Id: I40e0b859f2af0bb0e652925a53d6447ea6fbacfb Maxim Cournoyer
2023-03-28NEWS: Mention new rpm format....* NEWS (Package management): Mention new rpm format. Maxim Cournoyer
2022-12-18Update NEWS.Ludovic Courtès
2022-12-17Update NEWS.Marius Bakke
2022-12-02Update NEWS.Ludovic Courtès
2022-11-23NEWS: Update it....* NEWS: Shepherd is already at 0.9.3 now. Jonathan Brielmaier
2022-11-16Update NEWS.Maxim Cournoyer
2022-10-13NEWS: Update it....* NEWS: Add an entry about 'guix shell' --emulate-fhs option. Mathieu Othacehe
2022-10-07Update NEWS....* NEWS: Add new entry for installation script improvements. Maxim Cournoyer
2022-09-28Update NEWS....* NEWS: Add new services for the 1.4.0. Mathieu Othacehe
2022-09-26NEWS: Update it....* NEWS: Add an entry about WSL images. Mathieu Othacehe
2022-09-24Update NEWS.Ludovic Courtès
2022-09-23Update NEWS.Maxim Cournoyer
2022-09-19Update NEWS....* NEWS: Mention Shepherd 0.9.2 upgrade. Mathieu Othacehe
2022-09-16Update NEWS....Entries extracted from: git log 3eadcdc63..version-1.4.0 * NEWS: Update entries for v1.4.0 Mathieu Othacehe
2022-09-15Update NEWS....This covers the commits made between v1.3.0..3eadcdc6^. * NEWS: New entries for the 1.4.0 upcoming release. Maxim Cournoyer
2022-09-14Update NEWS....These news were extracted from the output of: git log --reverse v1.3.0..03eb0b1be2cfedd0d9a66fef0edc53a17f7653a5. * NEWS: Update entries for v1.4.0. Maxim Cournoyer