summaryrefslogtreecommitdiff
path: root/source3/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
commit4140f2bfc141ee9a91723d274344769f8b11a5f9 (patch)
tree10570387473b06026ce76564bdb8b3f7a23c4b69 /source3/smbwrapper/shared.c
parentf9881e8e74041bc022716f01767a174e7a36b38e (diff)
downloadsamba-4140f2bfc141ee9a91723d274344769f8b11a5f9.tar.gz
samba-4140f2bfc141ee9a91723d274344769f8b11a5f9.tar.bz2
samba-4140f2bfc141ee9a91723d274344769f8b11a5f9.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. (This used to be commit 9d863fb1681a5b03696552e1d93fe339b4bae455)
Diffstat (limited to 'source3/smbwrapper/shared.c')
-rw-r--r--source3/smbwrapper/shared.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/smbwrapper/shared.c b/source3/smbwrapper/shared.c
index 7a5cbcee22..ef139414bc 100644
--- a/source3/smbwrapper/shared.c
+++ b/source3/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);
+}