diff options
author | Volker Lendecke <vl@samba.org> | 2011-07-29 14:41:10 -0700 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2011-10-24 19:15:18 +0200 |
commit | cefea3b85ac151068c3e252a72976e3053a63459 (patch) | |
tree | 766c108e29cdd8236b6299529c1dbd7454639a11 | |
parent | f9af343eb84a17cf2a3e31a084d4cdd6d196cb68 (diff) | |
download | samba-cefea3b85ac151068c3e252a72976e3053a63459.tar.gz samba-cefea3b85ac151068c3e252a72976e3053a63459.tar.xz samba-cefea3b85ac151068c3e252a72976e3053a63459.zip |
s3: Make is_executable() available in lib/
(cherry picked from commit 612361bdcaf4256eb54913423e127d0628b35356)
-rw-r--r-- | source3/include/proto.h | 2 | ||||
-rw-r--r-- | source3/lib/util.c | 17 | ||||
-rw-r--r-- | source3/smbd/open.c | 17 |
3 files changed, 18 insertions, 18 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index af43b34071d..b62d7b57ef1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1242,6 +1242,7 @@ const char *strip_hostname(const char *s); bool tevent_req_poll_ntstatus(struct tevent_req *req, struct tevent_context *ev, NTSTATUS *status); +bool is_executable(const char *fname); /* The following definitions come from lib/util_file.c */ @@ -6608,7 +6609,6 @@ NTSTATUS change_dir_owner_to_parent(connection_struct *conn, const char *inherit_from_dir, const char *fname, SMB_STRUCT_STAT *psbuf); -bool is_executable(const char *fname); bool is_stat_open(uint32 access_mask); bool request_timed_out(struct timeval request_time, struct timeval timeout); diff --git a/source3/lib/util.c b/source3/lib/util.c index 238981debc1..343a763f976 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -3075,3 +3075,20 @@ bool tevent_req_poll_ntstatus(struct tevent_req *req, } return ret; } + +/******************************************************************* + Return True if the filename is one of the special executable types. +********************************************************************/ + +bool is_executable(const char *fname) +{ + if ((fname = strrchr_m(fname,'.'))) { + if (strequal(fname,".com") || + strequal(fname,".dll") || + strequal(fname,".exe") || + strequal(fname,".sym")) { + return True; + } + } + return False; +} diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 38e4e16b1de..e0cb944f114 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -660,23 +660,6 @@ static NTSTATUS open_file(files_struct *fsp, return NT_STATUS_OK; } -/******************************************************************* - Return True if the filename is one of the special executable types. -********************************************************************/ - -bool is_executable(const char *fname) -{ - if ((fname = strrchr_m(fname,'.'))) { - if (strequal(fname,".com") || - strequal(fname,".dll") || - strequal(fname,".exe") || - strequal(fname,".sym")) { - return True; - } - } - return False; -} - /**************************************************************************** Check if we can open a file with a share mode. Returns True if conflict, False if not. |