summaryrefslogtreecommitdiffstats
path: root/source/smbwrapper/shared.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-10-24 06:36:22 +0000
committerAndrew Tridgell <tridge@samba.org>1998-10-24 06:36:22 +0000
commit9d863fb1681a5b03696552e1d93fe339b4bae455 (patch)
tree924ea823b7202d560603d702e93ce9d0d696d2f2 /source/smbwrapper/shared.c
parent552175fdcb78c79833464648b5ccdc91b935e69c (diff)
downloadsamba-9d863fb1681a5b03696552e1d93fe339b4bae455.tar.gz
samba-9d863fb1681a5b03696552e1d93fe339b4bae455.tar.xz
samba-9d863fb1681a5b03696552e1d93fe339b4bae455.zip
make sure that apps can't close one of the internal smbw file
descriptors by catching close attempts on those fds and returning EBADF.
Diffstat (limited to 'source/smbwrapper/shared.c')
-rw-r--r--source/smbwrapper/shared.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/smbwrapper/shared.c b/source/smbwrapper/shared.c
index 7a5cbcee22e..ef139414bc9 100644
--- a/source/smbwrapper/shared.c
+++ b/source/smbwrapper/shared.c
@@ -212,3 +212,10 @@ int smbw_setenv(const char *name, const char *value)
return ret;
}
+/*****************************************************************
+return true if the passed fd is the SMBW_HANDLE
+*****************************************************************/
+int smbw_shared_fd(int fd)
+{
+ return (shared_fd && shared_fd == fd);
+}