CVE-2020-1472(ZeroLogon): libcli/auth: add netlogon_creds_random_challenge()
[Samba.git] / source3 / utils / status.c
blob36f7030e4f41bb39ab97a59d392c3d52b8e49860
1 /*
2 Unix SMB/CIFS implementation.
3 status reporting
4 Copyright (C) Andrew Tridgell 1994-1998
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 Revision History:
21 12 aug 96: Erik.Devriendt@te6.siemens.be
22 added support for shared memory implementation of share mode locking
24 21-Jul-1998: rsharpe@ns.aus.com (Richard Sharpe)
25 Added -L (locks only) -S (shares only) flags and code
30 * This program reports current SMB connections
33 #include "includes.h"
34 #include "lib/util/server_id.h"
35 #include "smbd/globals.h"
36 #include "system/filesys.h"
37 #include "popt_common.h"
38 #include "dbwrap/dbwrap.h"
39 #include "dbwrap/dbwrap_open.h"
40 #include "../libcli/security/security.h"
41 #include "session.h"
42 #include "locking/proto.h"
43 #include "messages.h"
44 #include "librpc/gen_ndr/open_files.h"
45 #include "smbd/smbd.h"
46 #include "librpc/gen_ndr/notify.h"
47 #include "conn_tdb.h"
48 #include "serverid.h"
49 #include "status_profile.h"
50 #include "smbd/notifyd/notifyd.h"
51 #include "cmdline_contexts.h"
52 #include "locking/leases_db.h"
54 #define SMB_MAXPIDS 2048
55 static uid_t Ucrit_uid = 0; /* added by OH */
56 static struct server_id Ucrit_pid[SMB_MAXPIDS]; /* Ugly !!! */ /* added by OH */
57 static int Ucrit_MaxPid=0; /* added by OH */
58 static unsigned int Ucrit_IsActive = 0; /* added by OH */
60 static bool verbose, brief;
61 static bool shares_only; /* Added by RJS */
62 static bool locks_only; /* Added by RJS */
63 static bool processes_only;
64 static bool show_brl;
65 static bool numeric_only;
66 static bool do_checks = true;
68 const char *username = NULL;
70 /* added by OH */
71 static void Ucrit_addUid(uid_t uid)
73 Ucrit_uid = uid;
74 Ucrit_IsActive = 1;
77 static unsigned int Ucrit_checkUid(uid_t uid)
79 if ( !Ucrit_IsActive )
80 return 1;
82 if ( uid == Ucrit_uid )
83 return 1;
85 return 0;
88 static unsigned int Ucrit_checkPid(struct server_id pid)
90 int i;
92 if ( !Ucrit_IsActive )
93 return 1;
95 for (i=0;i<Ucrit_MaxPid;i++) {
96 if (server_id_equal(&pid, &Ucrit_pid[i])) {
97 return 1;
101 return 0;
104 static bool Ucrit_addPid( struct server_id pid )
106 if ( !Ucrit_IsActive )
107 return True;
109 if ( Ucrit_MaxPid >= SMB_MAXPIDS ) {
110 d_printf("ERROR: More than %d pids for user %s!\n",
111 SMB_MAXPIDS, uidtoname(Ucrit_uid));
113 return False;
116 Ucrit_pid[Ucrit_MaxPid++] = pid;
118 return True;
121 static int print_share_mode(struct file_id fid,
122 const struct share_mode_data *d,
123 const struct share_mode_entry *e,
124 void *private_data)
126 bool resolve_uids = *((bool *)private_data);
127 static int count;
129 if (do_checks && !is_valid_share_mode_entry(e)) {
130 return 0;
133 if (count==0) {
134 d_printf("Locked files:\n");
135 d_printf("Pid User(ID) DenyMode Access R/W Oplock SharePath Name Time\n");
136 d_printf("--------------------------------------------------------------------------------------------------\n");
138 count++;
140 if (do_checks && !serverid_exists(&e->pid)) {
141 /* the process for this entry does not exist any more */
142 return 0;
145 if (Ucrit_checkPid(e->pid)) {
146 struct server_id_buf tmp;
147 d_printf("%-11s ", server_id_str_buf(e->pid, &tmp));
148 if (resolve_uids) {
149 d_printf("%-14s ", uidtoname(e->uid));
150 } else {
151 d_printf("%-9u ", (unsigned int)e->uid);
153 switch (map_share_mode_to_deny_mode(e->share_access,
154 e->private_options)) {
155 case DENY_NONE: d_printf("DENY_NONE "); break;
156 case DENY_ALL: d_printf("DENY_ALL "); break;
157 case DENY_DOS: d_printf("DENY_DOS "); break;
158 case DENY_READ: d_printf("DENY_READ "); break;
159 case DENY_WRITE:d_printf("DENY_WRITE "); break;
160 case DENY_FCB: d_printf("DENY_FCB "); break;
161 default: {
162 d_printf("unknown-please report ! "
163 "e->share_access = 0x%x, "
164 "e->private_options = 0x%x\n",
165 (unsigned int)e->share_access,
166 (unsigned int)e->private_options );
167 break;
170 d_printf("0x%-8x ",(unsigned int)e->access_mask);
171 if ((e->access_mask & (FILE_READ_DATA|FILE_WRITE_DATA))==
172 (FILE_READ_DATA|FILE_WRITE_DATA)) {
173 d_printf("RDWR ");
174 } else if (e->access_mask & FILE_WRITE_DATA) {
175 d_printf("WRONLY ");
176 } else {
177 d_printf("RDONLY ");
180 if((e->op_type & (EXCLUSIVE_OPLOCK|BATCH_OPLOCK)) ==
181 (EXCLUSIVE_OPLOCK|BATCH_OPLOCK)) {
182 d_printf("EXCLUSIVE+BATCH ");
183 } else if (e->op_type & EXCLUSIVE_OPLOCK) {
184 d_printf("EXCLUSIVE ");
185 } else if (e->op_type & BATCH_OPLOCK) {
186 d_printf("BATCH ");
187 } else if (e->op_type & LEVEL_II_OPLOCK) {
188 d_printf("LEVEL_II ");
189 } else if (e->op_type == LEASE_OPLOCK) {
190 NTSTATUS status;
191 uint32_t lstate;
193 status = leases_db_get(
194 &e->client_guid,
195 &e->lease_key,
196 &d->id,
197 &lstate, /* current_state */
198 NULL, /* breaking */
199 NULL, /* breaking_to_requested */
200 NULL, /* breaking_to_required */
201 NULL, /* lease_version */
202 NULL); /* epoch */
204 if (NT_STATUS_IS_OK(status)) {
205 d_printf("LEASE(%s%s%s)%s%s%s ",
206 (lstate & SMB2_LEASE_READ)?"R":"",
207 (lstate & SMB2_LEASE_WRITE)?"W":"",
208 (lstate & SMB2_LEASE_HANDLE)?"H":"",
209 (lstate & SMB2_LEASE_READ)?"":" ",
210 (lstate & SMB2_LEASE_WRITE)?"":" ",
211 (lstate & SMB2_LEASE_HANDLE)?"":" ");
212 } else {
213 d_printf("LEASE STATE UNKNOWN");
215 } else {
216 d_printf("NONE ");
219 d_printf(" %s %s%s %s",
220 d->servicepath, d->base_name,
221 (d->stream_name != NULL) ? d->stream_name : "",
222 time_to_asc((time_t)e->time.tv_sec));
225 return 0;
228 static void print_brl(struct file_id id,
229 struct server_id pid,
230 enum brl_type lock_type,
231 enum brl_flavour lock_flav,
232 br_off start,
233 br_off size,
234 void *private_data)
236 static int count;
237 unsigned int i;
238 static const struct {
239 enum brl_type lock_type;
240 const char *desc;
241 } lock_types[] = {
242 { READ_LOCK, "R" },
243 { WRITE_LOCK, "W" },
244 { UNLOCK_LOCK, "U" }
246 const char *desc="X";
247 const char *sharepath = "";
248 char *fname = NULL;
249 struct share_mode_lock *share_mode;
250 struct server_id_buf tmp;
251 struct file_id_buf ftmp;
253 if (count==0) {
254 d_printf("Byte range locks:\n");
255 d_printf("Pid dev:inode R/W start size SharePath Name\n");
256 d_printf("--------------------------------------------------------------------------------\n");
258 count++;
260 share_mode = fetch_share_mode_unlocked(NULL, id);
261 if (share_mode) {
262 bool has_stream = share_mode->data->stream_name != NULL;
264 fname = talloc_asprintf(NULL, "%s%s%s",
265 share_mode->data->base_name,
266 has_stream ? ":" : "",
267 has_stream ?
268 share_mode->data->stream_name :
269 "");
270 } else {
271 fname = talloc_strdup(NULL, "");
272 if (fname == NULL) {
273 return;
277 for (i=0;i<ARRAY_SIZE(lock_types);i++) {
278 if (lock_type == lock_types[i].lock_type) {
279 desc = lock_types[i].desc;
283 d_printf("%-10s %-15s %-4s %-9jd %-9jd %-24s %-24s\n",
284 server_id_str_buf(pid, &tmp),
285 file_id_str_buf(id, &ftmp),
286 desc,
287 (intmax_t)start, (intmax_t)size,
288 sharepath, fname);
290 TALLOC_FREE(fname);
291 TALLOC_FREE(share_mode);
294 static const char *session_dialect_str(uint16_t dialect)
296 static fstring unkown_dialect;
298 switch(dialect){
299 case SMB2_DIALECT_REVISION_000:
300 return "NT1";
301 case SMB2_DIALECT_REVISION_202:
302 return "SMB2_02";
303 case SMB2_DIALECT_REVISION_210:
304 return "SMB2_10";
305 case SMB2_DIALECT_REVISION_222:
306 return "SMB2_22";
307 case SMB2_DIALECT_REVISION_224:
308 return "SMB2_24";
309 case SMB3_DIALECT_REVISION_300:
310 return "SMB3_00";
311 case SMB3_DIALECT_REVISION_302:
312 return "SMB3_02";
313 case SMB3_DIALECT_REVISION_310:
314 return "SMB3_10";
315 case SMB3_DIALECT_REVISION_311:
316 return "SMB3_11";
319 fstr_sprintf(unkown_dialect, "Unknown (0x%04x)", dialect);
320 return unkown_dialect;
323 static int traverse_connections(const struct connections_key *key,
324 const struct connections_data *crec,
325 void *private_data)
327 TALLOC_CTX *mem_ctx = (TALLOC_CTX *)private_data;
328 struct server_id_buf tmp;
329 char *timestr = NULL;
330 int result = 0;
331 const char *encryption = "-";
332 const char *signing = "-";
334 if (crec->cnum == TID_FIELD_INVALID)
335 return 0;
337 if (do_checks &&
338 (!process_exists(crec->pid) || !Ucrit_checkUid(crec->uid))) {
339 return 0;
342 timestr = timestring(mem_ctx, crec->start);
343 if (timestr == NULL) {
344 return -1;
347 if (smbXsrv_is_encrypted(crec->encryption_flags)) {
348 switch (crec->cipher) {
349 case SMB_ENCRYPTION_GSSAPI:
350 encryption = "GSSAPI";
351 break;
352 case SMB2_ENCRYPTION_AES128_CCM:
353 encryption = "AES-128-CCM";
354 break;
355 case SMB2_ENCRYPTION_AES128_GCM:
356 encryption = "AES-128-GCM";
357 break;
358 default:
359 encryption = "???";
360 result = -1;
361 break;
365 if (smbXsrv_is_signed(crec->signing_flags)) {
366 if (crec->dialect >= SMB3_DIALECT_REVISION_302) {
367 signing = "AES-128-CMAC";
368 } else if (crec->dialect >= SMB2_DIALECT_REVISION_202) {
369 signing = "HMAC-SHA256";
370 } else {
371 signing = "HMAC-MD5";
375 d_printf("%-12s %-7s %-13s %-32s %-12s %-12s\n",
376 crec->servicename, server_id_str_buf(crec->pid, &tmp),
377 crec->machine,
378 timestr,
379 encryption,
380 signing);
382 TALLOC_FREE(timestr);
384 return result;
387 static int traverse_sessionid(const char *key, struct sessionid *session,
388 void *private_data)
390 TALLOC_CTX *mem_ctx = (TALLOC_CTX *)private_data;
391 fstring uid_gid_str;
392 struct server_id_buf tmp;
393 char *machine_hostname = NULL;
394 int result = 0;
395 const char *encryption = "-";
396 const char *signing = "-";
398 if (do_checks &&
399 (!process_exists(session->pid) ||
400 !Ucrit_checkUid(session->uid))) {
401 return 0;
404 Ucrit_addPid(session->pid);
406 if (numeric_only) {
407 fstr_sprintf(uid_gid_str, "%-12u %-12u",
408 (unsigned int)session->uid,
409 (unsigned int)session->gid);
410 } else {
411 if (session->uid == -1 && session->gid == -1) {
413 * The session is not fully authenticated yet.
415 fstrcpy(uid_gid_str, "(auth in progress)");
416 } else {
418 * In theory it should not happen that one of
419 * session->uid and session->gid is valid (ie != -1)
420 * while the other is not (ie = -1), so we a check for
421 * that case that bails out would be reasonable.
423 const char *uid_name = "-1";
424 const char *gid_name = "-1";
426 if (session->uid != -1) {
427 uid_name = uidtoname(session->uid);
428 if (uid_name == NULL) {
429 return -1;
432 if (session->gid != -1) {
433 gid_name = gidtoname(session->gid);
434 if (gid_name == NULL) {
435 return -1;
438 fstr_sprintf(uid_gid_str, "%-12s %-12s",
439 uid_name, gid_name);
443 machine_hostname = talloc_asprintf(mem_ctx, "%s (%s)",
444 session->remote_machine,
445 session->hostname);
446 if (machine_hostname == NULL) {
447 return -1;
450 if (smbXsrv_is_encrypted(session->encryption_flags)) {
451 switch (session->cipher) {
452 case SMB2_ENCRYPTION_AES128_CCM:
453 encryption = "AES-128-CCM";
454 break;
455 case SMB2_ENCRYPTION_AES128_GCM:
456 encryption = "AES-128-GCM";
457 break;
458 default:
459 encryption = "???";
460 result = -1;
461 break;
463 } else if (smbXsrv_is_partially_encrypted(session->encryption_flags)) {
464 switch (session->cipher) {
465 case SMB_ENCRYPTION_GSSAPI:
466 encryption = "partial(GSSAPI)";
467 break;
468 case SMB2_ENCRYPTION_AES128_CCM:
469 encryption = "partial(AES-128-CCM)";
470 break;
471 case SMB2_ENCRYPTION_AES128_GCM:
472 encryption = "partial(AES-128-GCM)";
473 break;
474 default:
475 encryption = "???";
476 result = -1;
477 break;
481 if (smbXsrv_is_signed(session->signing_flags)) {
482 if (session->connection_dialect >= SMB3_DIALECT_REVISION_302) {
483 signing = "AES-128-CMAC";
484 } else if (session->connection_dialect >= SMB2_DIALECT_REVISION_202) {
485 signing = "HMAC-SHA256";
486 } else {
487 signing = "HMAC-MD5";
489 } else if (smbXsrv_is_partially_signed(session->signing_flags)) {
490 if (session->connection_dialect >= SMB3_DIALECT_REVISION_302) {
491 signing = "partial(AES-128-CMAC)";
492 } else if (session->connection_dialect >= SMB2_DIALECT_REVISION_202) {
493 signing = "partial(HMAC-SHA256)";
494 } else {
495 signing = "partial(HMAC-MD5)";
500 d_printf("%-7s %-25s %-41s %-17s %-20s %-21s\n",
501 server_id_str_buf(session->pid, &tmp),
502 uid_gid_str,
503 machine_hostname,
504 session_dialect_str(session->connection_dialect),
505 encryption,
506 signing);
508 TALLOC_FREE(machine_hostname);
510 return result;
514 static bool print_notify_rec(const char *path, struct server_id server,
515 const struct notify_instance *instance,
516 void *private_data)
518 struct server_id_buf idbuf;
520 d_printf("%s\\%s\\%x\\%x\n", path, server_id_str_buf(server, &idbuf),
521 (unsigned)instance->filter,
522 (unsigned)instance->subdir_filter);
524 return true;
527 enum {
528 OPT_RESOLVE_UIDS = 1000,
531 int main(int argc, const char *argv[])
533 int c;
534 int profile_only = 0;
535 bool show_processes, show_locks, show_shares;
536 bool show_notify = false;
537 bool resolve_uids = false;
538 poptContext pc = NULL;
539 struct poptOption long_options[] = {
540 POPT_AUTOHELP
542 .longName = "processes",
543 .shortName = 'p',
544 .argInfo = POPT_ARG_NONE,
545 .arg = NULL,
546 .val = 'p',
547 .descrip = "Show processes only",
550 .longName = "verbose",
551 .shortName = 'v',
552 .argInfo = POPT_ARG_NONE,
553 .arg = NULL,
554 .val = 'v',
555 .descrip = "Be verbose",
558 .longName = "locks",
559 .shortName = 'L',
560 .argInfo = POPT_ARG_NONE,
561 .arg = NULL,
562 .val = 'L',
563 .descrip = "Show locks only",
566 .longName = "shares",
567 .shortName = 'S',
568 .argInfo = POPT_ARG_NONE,
569 .arg = NULL,
570 .val = 'S',
571 .descrip = "Show shares only",
574 .longName = "notify",
575 .shortName = 'N',
576 .argInfo = POPT_ARG_NONE,
577 .arg = NULL,
578 .val = 'N',
579 .descrip = "Show notifies",
582 .longName = "user",
583 .shortName = 'u',
584 .argInfo = POPT_ARG_STRING,
585 .arg = &username,
586 .val = 'u',
587 .descrip = "Switch to user",
590 .longName = "brief",
591 .shortName = 'b',
592 .argInfo = POPT_ARG_NONE,
593 .arg = NULL,
594 .val = 'b',
595 .descrip = "Be brief",
598 .longName = "profile",
599 .shortName = 'P',
600 .argInfo = POPT_ARG_NONE,
601 .arg = NULL,
602 .val = 'P',
603 .descrip = "Do profiling",
606 .longName = "profile-rates",
607 .shortName = 'R',
608 .argInfo = POPT_ARG_NONE,
609 .arg = NULL,
610 .val = 'R',
611 .descrip = "Show call rates",
614 .longName = "byterange",
615 .shortName = 'B',
616 .argInfo = POPT_ARG_NONE,
617 .arg = NULL,
618 .val = 'B',
619 .descrip = "Include byte range locks"
622 .longName = "numeric",
623 .shortName = 'n',
624 .argInfo = POPT_ARG_NONE,
625 .arg = NULL,
626 .val = 'n',
627 .descrip = "Numeric uid/gid"
630 .longName = "fast",
631 .shortName = 'f',
632 .argInfo = POPT_ARG_NONE,
633 .arg = NULL,
634 .val = 'f',
635 .descrip = "Skip checks if processes still exist"
638 .longName = "resolve-uids",
639 .shortName = 0,
640 .argInfo = POPT_ARG_NONE,
641 .arg = NULL,
642 .val = OPT_RESOLVE_UIDS,
643 .descrip = "Try to resolve UIDs to usernames"
645 POPT_COMMON_SAMBA
646 POPT_TABLEEND
648 TALLOC_CTX *frame = talloc_stackframe();
649 int ret = 0;
650 struct messaging_context *msg_ctx = NULL;
651 char *db_path;
652 bool ok;
654 sec_init();
655 smb_init_locale();
657 setup_logging(argv[0], DEBUG_STDERR);
658 lp_set_cmdline("log level", "0");
660 if (getuid() != geteuid()) {
661 d_printf("smbstatus should not be run setuid\n");
662 ret = 1;
663 goto done;
666 if (getuid() != 0) {
667 d_printf("smbstatus only works as root!\n");
668 ret = 1;
669 goto done;
673 pc = poptGetContext(NULL, argc, argv, long_options,
674 POPT_CONTEXT_KEEP_FIRST);
676 while ((c = poptGetNextOpt(pc)) != -1) {
677 switch (c) {
678 case 'p':
679 processes_only = true;
680 break;
681 case 'v':
682 verbose = true;
683 break;
684 case 'L':
685 locks_only = true;
686 break;
687 case 'S':
688 shares_only = true;
689 break;
690 case 'N':
691 show_notify = true;
692 break;
693 case 'b':
694 brief = true;
695 break;
696 case 'u':
697 Ucrit_addUid(nametouid(poptGetOptArg(pc)));
698 break;
699 case 'P':
700 case 'R':
701 profile_only = c;
702 break;
703 case 'B':
704 show_brl = true;
705 break;
706 case 'n':
707 numeric_only = true;
708 break;
709 case 'f':
710 do_checks = false;
711 break;
712 case OPT_RESOLVE_UIDS:
713 resolve_uids = true;
714 break;
718 /* setup the flags based on the possible combincations */
720 show_processes = !(shares_only || locks_only || profile_only) || processes_only;
721 show_locks = !(shares_only || processes_only || profile_only) || locks_only;
722 show_shares = !(processes_only || locks_only || profile_only) || shares_only;
724 if ( username )
725 Ucrit_addUid( nametouid(username) );
727 if (verbose) {
728 d_printf("using configfile = %s\n", get_dyn_CONFIGFILE());
731 msg_ctx = cmdline_messaging_context(get_dyn_CONFIGFILE());
732 if (msg_ctx == NULL) {
733 fprintf(stderr, "Could not initialize messaging, not root?\n");
734 ret = -1;
735 goto done;
738 if (!lp_load_global(get_dyn_CONFIGFILE())) {
739 fprintf(stderr, "Can't load %s - run testparm to debug it\n",
740 get_dyn_CONFIGFILE());
741 ret = -1;
742 goto done;
745 switch (profile_only) {
746 case 'P':
747 /* Dump profile data */
748 ok = status_profile_dump(verbose);
749 ret = ok ? 0 : 1;
750 goto done;
751 case 'R':
752 /* Continuously display rate-converted data */
753 ok = status_profile_rates(verbose);
754 ret = ok ? 0 : 1;
755 goto done;
756 default:
757 break;
760 if ( show_processes ) {
761 d_printf("\nSamba version %s\n",samba_version_string());
762 d_printf("%-7s %-12s %-12s %-41s %-17s %-20s %-21s\n", "PID", "Username", "Group", "Machine", "Protocol Version", "Encryption", "Signing");
763 d_printf("----------------------------------------------------------------------------------------------------------------------------------------\n");
765 sessionid_traverse_read(traverse_sessionid, frame);
767 if (processes_only) {
768 goto done;
772 if ( show_shares ) {
773 if (brief) {
774 goto done;
777 d_printf("\n%-12s %-7s %-13s %-32s %-12s %-12s\n", "Service", "pid", "Machine", "Connected at", "Encryption", "Signing");
778 d_printf("---------------------------------------------------------------------------------------------\n");
780 connections_forall_read(traverse_connections, frame);
782 d_printf("\n");
784 if ( shares_only ) {
785 goto done;
789 if ( show_locks ) {
790 int result;
791 struct db_context *db;
793 db_path = lock_path(talloc_tos(), "locking.tdb");
794 if (db_path == NULL) {
795 d_printf("Out of memory - exiting\n");
796 ret = -1;
797 goto done;
800 db = db_open(NULL, db_path, 0,
801 TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDONLY, 0,
802 DBWRAP_LOCK_ORDER_1, DBWRAP_FLAG_NONE);
804 if (!db) {
805 d_printf("%s not initialised\n", db_path);
806 d_printf("This is normal if an SMB client has never "
807 "connected to your server.\n");
808 TALLOC_FREE(db_path);
809 exit(0);
810 } else {
811 TALLOC_FREE(db);
812 TALLOC_FREE(db_path);
815 if (!locking_init_readonly()) {
816 d_printf("Can't initialise locking module - exiting\n");
817 ret = 1;
818 goto done;
821 result = share_entry_forall(print_share_mode, &resolve_uids);
823 if (result == 0) {
824 d_printf("No locked files\n");
825 } else if (result < 0) {
826 d_printf("locked file list truncated\n");
829 d_printf("\n");
831 if (show_brl) {
832 brl_forall(print_brl, NULL);
835 locking_end();
838 if (show_notify) {
839 struct notify_context *n;
841 n = notify_init(talloc_tos(), msg_ctx,
842 NULL, NULL);
843 if (n == NULL) {
844 goto done;
846 notify_walk(n, print_notify_rec, NULL);
847 TALLOC_FREE(n);
850 done:
851 poptFreeContext(pc);
852 TALLOC_FREE(frame);
853 return ret;