1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3: Make is_executable() available in lib/

This commit is contained in:
Volker Lendecke 2011-07-29 16:14:39 +02:00
parent 6d67d41444
commit 0102c6e2bc
4 changed files with 18 additions and 18 deletions

View File

@ -606,6 +606,7 @@ bool tevent_req_poll_ntstatus(struct tevent_req *req,
bool any_nt_status_not_ok(NTSTATUS err1, NTSTATUS err2, NTSTATUS *result);
int timeval_to_msec(struct timeval t);
char *valid_share_pathname(TALLOC_CTX *ctx, const char *dos_pathname);
bool is_executable(const char *fname);
/* The following definitions come from lib/util_cmdline.c */

View File

@ -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;
}

View File

@ -698,23 +698,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.

View File

@ -589,7 +589,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);