replace some magic error number with descriptive defines; meaning of the numbers
found in Samba/Linux smbfs
This commit is contained in:
parent
488fc89a73
commit
12ce0f9377
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: smb.h,v 1.3 2002/01/04 02:39:38 deberg Exp $ */
|
||||
/* $NetBSD: smb.h,v 1.4 2003/02/18 10:09:29 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000-2001 Boris Popov
|
||||
@ -324,13 +324,19 @@ enum smb_dialects {
|
||||
#define ERRnofiles 18 /* no more files found in file search */
|
||||
#define ERRbadshare 32 /* Share mode can't be granted */
|
||||
#define ERRlock 33 /* A lock request conflicts with existing lock */
|
||||
#define ERRbaddevice 66 /* Bad Device Type */
|
||||
#define ERRbadnetname 67 /* Bad Network Name */
|
||||
#define ERRfilexists 80 /* The file named in the request already exists */
|
||||
#define ERRinvname 123 /* Invalid Name */
|
||||
#define ERRdirnempty 145 /* Directory Not Empty */
|
||||
#define ERReexists 183 /* Already Exists */
|
||||
|
||||
/*
|
||||
* Error codes for the ERRSRV class
|
||||
*/
|
||||
#define ERRerror 1 /* Non-specific error code */
|
||||
#define ERRbadpw 2 /* Bad password */
|
||||
#define ERRsrvbaddevice 3 /* Reserved - Bad Device Type */
|
||||
#define ERRaccess 4 /* The client doesn't have enough access rights */
|
||||
#define ERRinvnid 5 /* The Tid specified in a command is invalid */
|
||||
#define ERRinvnetname 6 /* Invalid server name in the tree connect */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: smb_subr.c,v 1.5 2003/02/15 23:02:30 jdolecek Exp $ */
|
||||
/* $NetBSD: smb_subr.c,v 1.6 2003/02/18 10:09:28 jdolecek Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000-2001 Boris Popov
|
||||
@ -230,8 +230,8 @@ smb_maperror(int eclass, int eno)
|
||||
case ERRbadfile:
|
||||
case ERRbadpath:
|
||||
case ERRremcd:
|
||||
case 66: /* nt returns it when share not available */
|
||||
case 67: /* observed from nt4sp6 when sharename wrong */
|
||||
case ERRbaddevice: /* nt returns it when share not available */
|
||||
case ERRbadnetname: /* observed from nt4sp6 when sharename wrong */
|
||||
return ENOENT;
|
||||
case ERRnofids:
|
||||
return EMFILE;
|
||||
@ -260,11 +260,11 @@ smb_maperror(int eclass, int eno)
|
||||
return EDEADLK;
|
||||
case ERRfilexists:
|
||||
return EEXIST;
|
||||
case 123: /* dunno what is it, but samba maps as noent */
|
||||
case ERRinvname: /* dunno what is it, but samba maps as noent */
|
||||
return ENOENT;
|
||||
case 145: /* samba */
|
||||
case ERRdirnempty: /* samba */
|
||||
return ENOTEMPTY;
|
||||
case 183:
|
||||
case ERReexists:
|
||||
return EEXIST;
|
||||
}
|
||||
break;
|
||||
@ -281,7 +281,7 @@ smb_maperror(int eclass, int eno)
|
||||
case ERRinvnetname:
|
||||
SMBERROR("NetBIOS name is invalid\n");
|
||||
return EAUTH;
|
||||
case 3: /* reserved and returned */
|
||||
case ERRsrvbaddevice: /* reserved and returned */
|
||||
return EIO;
|
||||
case 2239: /* NT: account exists but disabled */
|
||||
return EPERM;
|
||||
|
Loading…
Reference in New Issue
Block a user