[PATCH] NetSessDel - Avoid building list of sessions

Shekhar Amlekar samlekar at in.ibm.com
Tue Sep 10 10:01:24 CEST 2013


Hi Volker,

Thanks for the review! Please find attached the patch-set again. I've 
incorporated your comments in the first two patches.

regards,
shekhar.





From:   Volker Lendecke <Volker.Lendecke at sernet.de>
To:     Shekhar Amlekar/India/IBM at IBMIN, 
Cc:     samba-technical at lists.samba.org
Date:   09/06/2013 04:27 PM
Subject:        Re: [PATCH] NetSessDel - Avoid building list of sessions



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 &&
            !strequal(session->remote_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
snippet:

        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.

Thanks,

Volker

-- 
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
******************************************************************


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-smbd-session-add-filters-to-gather_sessioninfo.patch
Type: application/octet-stream
Size: 1782 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20130910/41af9515/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-s3-smbd-session-Added-a-routine-find_sessions.patch
Type: application/octet-stream
Size: 2184 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20130910/41af9515/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-s3-rpc_server-srvsvc-use-find_sessions-in-NetSes.patch
Type: application/octet-stream
Size: 1889 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20130910/41af9515/attachment-0002.obj>


More information about the samba-technical mailing list