/[smeserver]/rpms/sudo/sme9/sudo-1.8.6p3-ldapsearchuidfix.patch
ViewVC logotype

Contents of /rpms/sudo/sme9/sudo-1.8.6p3-ldapsearchuidfix.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Thu Feb 4 19:44:18 2021 UTC (3 years, 8 months ago) by jpp
Branch: MAIN
CVS Tags: sudo-1_8_6p3-30_el6_sme, sudo-1_8_6p3-29_el6_9, HEAD
Sudo

1 diff -up sudo-1.8.6p3/plugins/sudoers/ldap.c.ldapsearchuidfix sudo-1.8.6p3/plugins/sudoers/ldap.c
2 --- sudo-1.8.6p3/plugins/sudoers/ldap.c.ldapsearchuidfix 2015-12-14 10:13:16.940861298 +0100
3 +++ sudo-1.8.6p3/plugins/sudoers/ldap.c 2015-12-14 10:13:16.942861298 +0100
4 @@ -1149,8 +1149,8 @@ sudo_ldap_build_pass1(struct passwd *pw)
5 if (ldap_conf.search_filter)
6 sz += strlen(ldap_conf.search_filter);
7
8 - /* Then add (|(sudoUser=USERNAME)(sudoUser=ALL)) + NUL */
9 - sz += 29 + sudo_ldap_value_len(pw->pw_name);
10 + /* Then add (|(sudoUser=USERNAME)(sudoUser=#uid)(sudoUser=ALL)) + NUL */
11 + sz += 29 + (12 + MAX_UID_T_LEN) + sudo_ldap_value_len(pw->pw_name);
12
13 /* Add space for primary and supplementary groups and gids */
14 if ((grp = sudo_getgrgid(pw->pw_gid)) != NULL) {
15 @@ -1200,6 +1200,12 @@ sudo_ldap_build_pass1(struct passwd *pw)
16 (void) sudo_ldap_value_cat(buf, pw->pw_name, sz);
17 (void) strlcat(buf, ")", sz);
18
19 + /* Append user uid */
20 + (void) snprintf(gidbuf, sizeof(gidbuf), "%u", (unsigned int)pw->pw_uid);
21 + (void) strlcat(buf, "(sudoUser=#", sz);
22 + (void) strlcat(buf, gidbuf, sz);
23 + (void) strlcat(buf, ")", sz);
24 +
25 /* Append primary group and gid */
26 if (grp != NULL) {
27 (void) strlcat(buf, "(sudoUser=%", sz);

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed