[PATCH] smbcontrol smbd ping

Olaf Flebbe o.flebbe at science-computing.de
Thu Aug 20 02:32:37 MDT 2009


====== Problem
1) Ping messages to smbd launched by

smbcontrol smbd ping

are answered by all daemons.

Essentialy it is the same as
smbcontrol all ping.


2) smbcontrol <largeinteger> ping

triggers weird behaviour. try 2147483649 for instance.

====== Analysis

1) is introduced as a side effect by change 
where all samba daemons annouce itself to the connections.tdb
This seems o.k. to me.

IMHO smbcontrol smbd ping should send a MSG_PING to the smbd alone, 
rather to the virtual process id meaning "broadcast".

Distinguishing between smbd/winbind(d)/nmbd and numerical pid was a 
little bit crude. So I left the work distinguishing between strings and 
arguments to interpret_pid().

smbd or nmbd seems to have different names in its pid file name, 
depending on its argument, so it is neccessary to change it here, too.

Looking at the code of interpret_pid() showed (2).


The pid member of server_id has the type pid_t. pid_t  is a signed 
quantity, so I changed the scanf to %d rather %u. Furthermore we should 
test for an integer overflow.

Appended patch against v3-4-test branch of git://git.samba.org/samba.git

Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-make-smbcontrol-smbd-ping-work.patch
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20090820/5b4051af/attachment.ksh>

More information about the samba-technical mailing list