~ubuntu-branches/ubuntu/trusty/libnss-ldap/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/patches/00uid_t.patch

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-11-06 01:24:42 UTC
  • mfrom: (1.1.8 upstream) (11.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091106012442-5nynms8vz39j8o6i
Tags: 264-2ubuntu1
* Merge from debian testing, remaining changes:
  + debian/control: update Maintainer field now that in main
  + debian/control: Depends on ldap-auth-config
  + debian/control: Removed Depends on po-debconf and debconf (debconf
    handled by ldap-auth-config now)
  + removed the following files:
    - debian/config
    - debian/libnss-ldap.postinst
    - debian/libnss-ldap.postrm
    - debian/patches/00debian_conf.patch
    - debian/po
    - debian/templates
  + debian/LDAP-Permissions.txt: use /etc/ldap.conf
  + debian/README.Debian: use /etc/ldap.conf
  + debian/rules: don't use --with-ldap-conf-file and --with-ldap-secret-file
  + debian/libnss-ldap.install: removed usr/share/libnss-ldap/ldap.conf
  + debian/libnss-ldap.dirs: removed usr/share/libnss-ldap
  + debian/control: move nscd to Suggests
  + debian/patches/series, debian/patches/00fix-ethers-truncation.patch:
    Fix lookups for hostname by MAC address (http://bugzilla.padl.com/show_bug.cgi?id=388) (LP: #315241)
* Remaining changes from debian unstable for LP: #155947
  + added debian/nssldap-update-ignoreusers which update
    nss_initgroups_ignoreusers in /etc/ldap.conf based on
    nss_initgroups_minimum_uid
  + add manpage for nssldap-update-ignoreusers
  + debian/libnss-ldap.install: added usr/sbin/nssldap-update-ignoreusers
    and usr/share/man/man8/nssldap-update-ignoreusers.8
  + added debian/libnss-ldap.init to call nssldap-update-ignoreusers on
    shutdown
  + debian/rules: install initscript
  + debian/libnss-ldap.dirs: added var/lib/libnss-ldap
  + debian/patches/01_minimum_uid.patch: update ldap.conf and manpage for
    nss_initgroups_ignoreusers and nss_initgroups_minimum_uid updates

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# * Fixed possible overflow in uid/gid handling, Closes: #354093
2
 
--- libnss-ldap-255.orig/ldap-pwd.c
3
 
+++ libnss-ldap-255/ldap-pwd.c
4
 
@@ -86,9 +86,11 @@
5
 
   struct passwd *pw = (struct passwd *) result;
6
 
   char *uid, *gid;
7
 
   NSS_STATUS stat;
8
 
-  char tmpbuf[sizeof "-4294967295"];
9
 
+  char tmpbuf[ sizeof( uid_t ) * 8 / 3 + 2 ];
10
 
   size_t tmplen;
11
 
   char *tmp;
12
 
+  
13
 
+  tmpbuf[ sizeof(tmpbuf) - 1 ] = '\0';
14
 
 
15
 
   if (_nss_ldap_oc_check (e, "shadowAccount") == NSS_SUCCESS)
16
 
     {
17
 
@@ -117,7 +119,7 @@
18
 
     return stat;
19
 
 
20
 
   tmp = tmpbuf;
21
 
-  tmplen = sizeof (tmpbuf);
22
 
+  tmplen = sizeof (tmpbuf) - 1;
23
 
   stat =
24
 
     _nss_ldap_assign_attrval (e, AT (uidNumber), &uid, &tmp, &tmplen);
25
 
   if (stat != NSS_SUCCESS)
26
 
@@ -125,7 +127,7 @@
27
 
   pw->pw_uid = (*uid == '\0') ? UID_NOBODY : (uid_t) atol (uid);
28
 
 
29
 
   tmp = tmpbuf;
30
 
-  tmplen = sizeof (tmpbuf);
31
 
+  tmplen = sizeof (tmpbuf) - 1;
32
 
   stat =
33
 
     _nss_ldap_assign_attrval (e, ATM (LM_PASSWD, gidNumber), &gid, &tmp,
34
 
                               &tmplen);