diff options
author | Volker Lendecke <vl@samba.org> | 2011-07-29 16:14:39 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2011-07-29 16:43:17 +0200 |
commit | 0102c6e2bc289352ab726d68956c126727cf8d81 (patch) | |
tree | c8c70d9814e7f8cf41dfccb831199935d0ab642f /source3/lib | |
parent | 6d67d41444aef527215d985bdcdb0f214de875f9 (diff) | |
download | samba-0102c6e2bc289352ab726d68956c126727cf8d81.tar.gz samba-0102c6e2bc289352ab726d68956c126727cf8d81.tar.bz2 samba-0102c6e2bc289352ab726d68956c126727cf8d81.zip |
s3: Make is_executable() available in lib/
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/util.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index b8fc319a6f..b320931146 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2238,3 +2238,20 @@ char *valid_share_pathname(TALLOC_CTX *ctx, const char *dos_pathname) return ptr; } + +/******************************************************************* + 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; +} |