s3: Make is_executable() available in lib/
authorVolker Lendecke <vl@samba.org>
Fri, 29 Jul 2011 21:41:10 +0000 (14:41 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 24 Oct 2011 17:15:18 +0000 (19:15 +0200)
(cherry picked from commit 612361bdcaf4256eb54913423e127d0628b35356)

source3/include/proto.h
source3/lib/util.c
source3/smbd/open.c

index af43b34071d299cb77d818fdc32ef4f7b2a602e2..b62d7b57ef138a7294d2ea713d80a61228444c4f 100644 (file)
@@ -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);
index 238981debc1263cf3a607966f080495dd9748214..343a763f976cab2d473da6a4059f75b1dc23d2d5 100644 (file)
@@ -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;
+}
index 38e4e16b1de414900d885b79fd9f3543102e8d82..e0cb944f114bddabd92879280c4dcdead3ad5198 100644 (file)
@@ -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.