diff options
author | Andrew Bartlett <abartlet@samba.org> | 2001-11-25 02:35:37 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2001-11-25 02:35:37 +0000 |
commit | adc7a6048c13342b79b6228beafb5142c50f318d (patch) | |
tree | f5d9f53878ac4aff6aa706bcbb0c36de5e1b686c /source/libsmb/smberr.c | |
parent | ea0331354e5968aa0a25c0b12379a56c72d7946b (diff) | |
download | samba-adc7a6048c13342b79b6228beafb5142c50f318d.tar.gz |
Add a new torture test to extract a NT->DOS error map from an NT member of a
samba domain.
The PDC must be running a special authenticaion module that spits out NT errors
based on username.
Andrew Bartlett
Diffstat (limited to 'source/libsmb/smberr.c')
-rw-r--r-- | source/libsmb/smberr.c | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/source/libsmb/smberr.c b/source/libsmb/smberr.c index a43e4764e86..d0aa8f6024d 100644 --- a/source/libsmb/smberr.c +++ b/source/libsmb/smberr.c @@ -156,7 +156,51 @@ const struct /**************************************************************************** -return a SMB error string from a SMB buffer +return a SMB error name from a class and code +****************************************************************************/ +char *smb_dos_err_name(uint8 class, uint16 num) +{ + static pstring ret; + int i,j; + + for (i=0;err_classes[i].class;i++) + if (err_classes[i].code == class) { + if (err_classes[i].err_msgs) { + err_code_struct *err = err_classes[i].err_msgs; + for (j=0;err[j].name;j++) + if (num == err[j].code) { + return err[j].name; + } + } + slprintf(ret, sizeof(ret) - 1, "%d",num); + return ret; + } + + slprintf(ret, sizeof(ret) - 1, "Error: Unknown error class (%d,%d)",class,num); + return(ret); +} + + +/**************************************************************************** +return a SMB error class name as a string. +****************************************************************************/ +char *smb_dos_err_class(uint8 class) +{ + static pstring ret; + int i; + + for (i=0;err_classes[i].class;i++) { + if (err_classes[i].code == class) { + return err_classes[i].class; + } + } + + slprintf(ret, sizeof(ret) - 1, "Error: Unknown class (%d)",class); + return(ret); +} + +/**************************************************************************** +return a SMB string from an SMB buffer ****************************************************************************/ char *smb_dos_errstr(char *inbuf) { |