00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "includes.h"
00022 #include "web/swat_proto.h"
00023
00024 extern struct in_addr loopback_ip;
00025
00026 #ifdef WITH_WINBIND
00027
00028
00029
00030 BOOL winbindd_running(void)
00031 {
00032 return winbind_ping();
00033 }
00034 #endif
00035
00036
00037
00038 BOOL nmbd_running(void)
00039 {
00040 int fd, count, flags;
00041 struct in_addr *ip_list;
00042
00043 if ((fd = open_socket_in(SOCK_DGRAM, 0, 3,
00044 interpret_addr("127.0.0.1"), True)) != -1) {
00045 if ((ip_list = name_query(fd, "__SAMBA__", 0,
00046 True, True, loopback_ip,
00047 &count, &flags, NULL)) != NULL) {
00048 SAFE_FREE(ip_list);
00049 close(fd);
00050 return True;
00051 }
00052 close (fd);
00053 }
00054
00055 return False;
00056 }
00057
00058
00059
00060
00061 BOOL smbd_running(void)
00062 {
00063 NTSTATUS status;
00064 struct cli_state *cli;
00065
00066 if ((cli = cli_initialise()) == NULL)
00067 return False;
00068
00069 status = cli_connect(cli, global_myname(), &loopback_ip);
00070 if (!NT_STATUS_IS_OK(status)) {
00071 cli_shutdown(cli);
00072 return False;
00073 }
00074
00075 cli_shutdown(cli);
00076 return True;
00077 }