jailkit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Jailkit-dev] [bug #46320] uid length problem


From: Martin Lonkwitz
Subject: [Jailkit-dev] [bug #46320] uid length problem
Date: Thu, 29 Oct 2015 09:07:28 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36

URL:
  <http://savannah.nongnu.org/bugs/?46320>

                 Summary: uid length problem
                 Project: Jailkit
            Submitted by: mawelo
            Submitted on: Do 29 Okt 2015 09:07:26 GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Dear all,

I found this problem using NIS on Linux with big UID-values.
 
file: passwdparser.c
function: struct passwd *internal_getpwuid(const char *filename, uid_t uid)

"char find" works with a char array fixed length set to 10 but forgot to
include the '\0' byte.
So here my suggestion to fix this:

struct passwd *internal_getpwuid(const char *filename, uid_t uid) {
  static struct passwd retpw;
  char find[11], *line;     // 10 bytes plus 1 byte for \0 
 memset(find,0,11);      //  filled with 0 byte
 snprintf(find,11,"%d",(int)uid);

It's not 100% okay cause we assume to have a 32 bit integer here....so there
is maybe the need for a much better solution.

Best Regards,
Martin




    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?46320>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]