s3:smbd: Add the ntstatus to the smb_panic in share_mode_lock_destructor
authorVolker Lendecke <vl@samba.org>
Sat, 5 Sep 2009 17:20:16 +0000 (19:20 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 6 Sep 2009 23:28:32 +0000 (01:28 +0200)
This might help finding why bug 6518 happens

source3/locking/locking.c

index fba871c704e0cb5417e82bdd462524fed165e754..5b17e3b6e8befa7b1cbfefccec37b2a158443b7b 100644 (file)
@@ -782,9 +782,18 @@ static int share_mode_lock_destructor(struct share_mode_lock *lck)
 
                        status = lck->record->delete_rec(lck->record);
                        if (!NT_STATUS_IS_OK(status)) {
+                               char *errmsg;
+
                                DEBUG(0, ("delete_rec returned %s\n",
                                          nt_errstr(status)));
-                               smb_panic("could not delete share entry");
+
+                               if (asprintf(&errmsg, "could not delete share "
+                                            "entry: %s\n",
+                                            nt_errstr(status)) == -1) {
+                                       smb_panic("could not delete share"
+                                                 "entry");
+                               }
+                               smb_panic(errmsg);
                        }
                }
                goto done;
@@ -792,8 +801,15 @@ 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)) {
+               char *errmsg;
+
                DEBUG(0, ("store returned %s\n", nt_errstr(status)));
-               smb_panic("could not store share mode entry");
+
+               if (asprintf(&errmsg, "could not store share mode entry: %s",
+                            nt_errstr(status)) == -1) {
+                       smb_panic("could not store share mode entry");
+               }
+               smb_panic(errmsg);
        }
 
  done: