-/*
+/*
Unix SMB/CIFS implementation.
Samba utility functions
Copyright (C) Andrew Tridgell 1992-1998
}
/*******************************************************************
- Convert a name to a gid_t if possible. Return -1 if not a group.
+ Convert a name to a gid_t if possible. Return -1 if not a group.
********************************************************************/
gid_t nametogid(const char *name)
}
/*******************************************************************
- Utility function used to decide if the last component
+ Utility function used to decide if the last component
of a path matches a (possibly wildcarded) entry in a namelist.
********************************************************************/
}
/*******************************************************************
- Strip a '/' separated list into an array of
- name_compare_enties structures suitable for
+ Strip a '/' separated list into an array of
+ name_compare_enties structures suitable for
passing to is_in_path(). We do this for
- speed so we can pre-parse all the names in the list
+ speed so we can pre-parse all the names in the list
and don't do it for each call to is_in_path().
We also check if the entry contains a wildcard to
remove a potentially expensive call to mask_match
(*ppname_array) = NULL;
- if((namelist_in == NULL ) || ((namelist_in != NULL) && (*namelist_in == '\0')))
+ if((namelist_in == NULL ) || ((namelist_in != NULL) && (*namelist_in == '\0')))
return;
namelist = talloc_strdup(talloc_tos(), namelist_in);
/*****************************************************************
Zero a memory area then free it. Used to catch bugs faster.
-*****************************************************************/
+*****************************************************************/
void zero_free(void *p, size_t size)
{
/*****************************************************************
Set our open file limit to a requested max and return the limit.
-*****************************************************************/
+*****************************************************************/
int set_maxfiles(int requested_max)
{
return requested_max;
}
- /*
+ /*
* Set the fd limit to be real_max_open_files + MAX_OPEN_FUDGEFACTOR to
- * account for the extra fd we need
+ * account for the extra fd we need
* as well as the log files and standard
* handles etc. Save the limit we want to set in case
* we are running on an OS that doesn't support this limit (AIX)
support our default request of 10,000 open files. JRA. */
if(setrlimit(RLIMIT_NOFILE, &rlp)) {
- DEBUG(3,("set_maxfiles: setrlimit for RLIMIT_NOFILE for %d max files failed with error %s\n",
+ DEBUG(3,("set_maxfiles: setrlimit for RLIMIT_NOFILE for %d max files failed with error %s\n",
(int)rlp.rlim_max, strerror(errno) ));
/* Set failed - restore original value from get. */
saved_current_limit = rlp.rlim_cur = MIN(requested_max,rlp.rlim_max);
if(setrlimit(RLIMIT_NOFILE, &rlp)) {
- DEBUG(0,("set_maxfiles: setrlimit for RLIMIT_NOFILE for %d files failed with error %s\n",
+ DEBUG(0,("set_maxfiles: setrlimit for RLIMIT_NOFILE for %d files failed with error %s\n",
(int)rlp.rlim_cur, strerror(errno) ));
/* just guess... */
return saved_current_limit;
/*****************************************************************
malloc that aborts with smb_panic on fail or zero size.
- *****************************************************************/
+ *****************************************************************/
void *smb_xmalloc_array(size_t size, unsigned int count)
{
int get_safe_IVAL(const char *buf_base, size_t buf_len, char *ptr, size_t off, int failval)
{
/*
- * Note we use off+3 here, not off+4 as IVAL accesses
+ * Note we use off+3 here, not off+4 as IVAL accesses
* ptr[0] ptr[1] ptr[2] ptr[3] NOT ptr[4].
*/
if (!is_offset_safe(buf_base, buf_len, ptr, off+3)) {