Re: Build infrastructure for storing NTLM creds in kernel keyring

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

 



I pulled down your latest code and it doesn't appear to be patched. Am
I missing something?

----------------[snip]---------------
struct command {
int (*action)(int argc, char *argv[]);
const char name[MAX_COMMAND_SIZE];
const char *format;
};
----------------[snip]---------------

Now, under each field we will allocate exactly MAX_COMMAND_SIZE bytes.
During the comparison we will not walk outside the allocated area.

----------------[snip]---------------
n = strnlen(argv[1], MAX_COMMAND_SIZE);

for (cmd = commands; cmd->action; cmd++) {
 if (memcmp(cmd->name, argv[1], n) != 0)
  continue;
----------------[snip]---------------

Regards,
Igor Druzhinin

----- Original Message ----- From: "Jeff Layton" <jlayton@xxxxxxxxx>
To: "Igor Druzhinin" <jaxbrigs@xxxxxxxxx>
Cc: <linux-cifs@xxxxxxxxxxxxxxx>; <dhowells@xxxxxxxxxx>
Sent: Thursday, August 05, 2010 10:03 PM
Subject: Re: Build infrastructure for storing NTLM creds in kernel keyring


On Thu, 5 Aug 2010 19:43:57 +0400
"Igor Druzhinin" <jaxbrigs@xxxxxxxxx> wrote:

> First, it looks like there are some problems with newlines. The new
> files that were added seem to have CR+LF line terminators. There are
> also quite a few whitespace problems in there -- spaces leading tabs,
> etc. In general, we follow kernel coding style with cifs-utils, so
> running your patches through checkpatch.pl in the kernel sources is a
> good idea.

Checked and patched.

> Also, I don't see much need for the MULTI_LANG ifdef's. Is there any
> reason not to make it always use MULTI_LANG? If so, I'd remove the code
> that's ifdef'ed out.

Now I am still not sure of the correctness of my strategy of
internationalization. MULTI_LANG ifdef's will help me to correct necessary
sites in case of its change.


Fair enough then...

> There are also several routines that seem to already be in libc. For
> instance, wstrtolower seems to do the same thing as towlower. I'd
> suggest using libc routines rather than rolling your own where > possible.

As I saw in the GNU libc documentation there is no routines for conversion
string to lowercase.


Ahh you're correct -- towlower only operates on a single character.

> That memcmp is going to walk off the end of "add". Depending on how the
> memory is allocated, it could segfault.

Patched.


I pulled down your latest code and it doesn't appear to be patched. Am
I missing something?

--
Jeff Layton <jlayton@xxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux