#3786 Few krb5_locator code improvements
Merged by fidencio. Opened by lslebodn.
SSSD/ lslebodn/sssd krb5_locator  into  master

Download 3786.patch
no initial comment

The patches looks mostly good to me, I just don't know why was the port variable changed from long to int?

The patches looks mostly good to me, I just don't know why was the port variable changed from long to int?

There are two different format strings used for port in the function buf_to_addr_port_list

250 
251                 if (port < 0 || port > 65535) {
252                     PLUGIN_DEBUG(("Illegal port number [%ld], assuming "
253                                   "default.\n", port));
254                     port = 0;
255                 }

and

271         }
272 
273         PLUGIN_DEBUG(("Found [%s][%d].\n", addr_str, port));
274 
275         l[c].addr = strdup(addr_str);

And It was changed to int because it's enough for range port < 0 || port > 65535. In another words, there was a compile time warning :-)

OK, but since the port is converted from string using strtol, wouldn't it be better to use long as it was and use the long int conversion in the DEBUG macros? IIRC on most platforms int == long, so maybe this is academic, but for me it would also feel more natural to use long for the output of strtol.

rebased onto 3569f360c6ec101d50720704d6214d196e60611a

OK, but since the port is converted from string using strtol, wouldn't it be better to use long as it was and use the long int conversion in the DEBUG macros? IIRC on most platforms int == long, so maybe this is academic, but for me it would also feel more natural to use long for the output of strtol.

That's valid argument. I fixed that.

Unfortunately the patches don't apply anymore, can you rebase?

rebased onto 2ca9cb611cfcd0dfe1ab3d8f1cff23df2cfa7006

Unfortunately the patches don't apply anymore, can you rebase?

Done

Commit 9680ac9c fixes this pull-request

Pull-Request has been merged by fidencio

Commit aefdf703 fixes this pull-request

Pull-Request has been merged by fidencio

Commit 09dc1d9d fixes this pull-request

Pull-Request has been merged by fidencio

Commit 276f2e34 fixes this pull-request

Pull-Request has been merged by fidencio

Commit 86de91f9 fixes this pull-request

Pull-Request has been merged by fidencio

master:
86de91f
276f2e3
09dc1d9
aefdf70
9680ac9

Metadata