[PATCH] NetSessDel - Avoid building list of sessions

Volker Lendecke Volker.Lendecke at SerNet.DE
Fri Sep 6 12:58:00 CEST 2013

Hi, Shekhar!

On Sun, Jun 30, 2013 at 09:40:01AM +0530, Shekhar Amlekar wrote:
> Hi,
> Please find attached patches that make changes to the NetSessDel  
> implementation. It avoids building the list of sessions when a session 
> needs to be deleted.
> Request your review and comments.

This looks very good, thanks!

One question: In gather_sessioninfo there's this snippet:

        /* filter the session if required */

        if (sesslist->filter_user &&
            (sesslist->filter_user[0] != '\0') &&
            !strequal(session->username, sesslist->filter_user)) {
                return 0;

        if (sesslist->filter_machine &&
                      sesslist->filter_machine)) {
                return 0;

Why is the if-condition different for user and machine? Why
does machine not have the

(sesslist->filter_user[0] != '\0') piece?

One cosmetic comment: In find_sessions, there is the

        status = sessionid_traverse_read(gather_sessioninfo, (void *)&sesslist);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(3, ("Session traverse failed\n"));

It would be great if we could print nt_errstr(status) in the
debug message.



SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de

visit us on it-sa:IT security exhibitions in Nürnberg, Germany
October 8th - 10th 2013, hall 12, booth 333
free tickets available via code 270691 on: www.it-sa.de/gutschein

More information about the samba-technical mailing list