lib/util_sock.c: Added strerror() calls to getpeername failures (which seem to be giving IRIX trouble at the moment).
rpc_parse/parse_sec.c: Changed use of ZERO_STRUCTPN to ZERO_STRUCTP which again does zero pointer protection.
smbd/quotas.c: Fixed typo.
Jeremy.
(This used to be commit
b62f008974c96e0302d6c146cf49bc2045bef005)
#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
/* zero a structure given a pointer to the structure */
-#define ZERO_STRUCTP(x) { memset((char *)(x), 0, sizeof(*(x))); }
-
-#define ZERO_STRUCTPN(x) { if (x != NULL) ZERO_STRUCTP(x); }
+#define ZERO_STRUCTP(x) { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); }
/* zero an array - note that sizeof(array) must work - ie. it must not be a
pointer */
}
if (getpeername(fd, &sa, &length) < 0) {
- DEBUG(0,("getpeername failed\n"));
+ DEBUG(0,("getpeername failed. Error was %s\n", strerror(errno) ));
return name_buf;
}
}
if (getpeername(fd, &sa, &length) < 0) {
- DEBUG(0,("getpeername failed\n"));
+ DEBUG(0,("getpeername failed. Error was %s\n", strerror(errno) ));
return addr_buf;
}
{
/* reading */
t->ace = malloc(sizeof(t->ace[0]) * t->num_aces);
- ZERO_STRUCTPN(t->ace);
+ ZERO_STRUCTP(t->ace);
}
if (t->ace == NULL && t->num_aces != 0)
{
/* reading */
t->dacl = malloc(sizeof(*t->dacl));
- ZERO_STRUCTPN(t->dacl);
+ ZERO_STRUCTP(t->dacl);
}
if (t->dacl == NULL)
{
/* reading */
t->sacl = malloc(sizeof(*t->sacl));
- ZERO_STRUCTPN(t->sacl);
+ ZERO_STRUCTP(t->sacl);
}
if (t->sacl == NULL)
{
/* reading */
t->owner_sid = malloc(sizeof(*t->owner_sid));
- ZERO_STRUCTPN(t->owner_sid);
+ ZERO_STRUCTP(t->owner_sid);
}
if (t->owner_sid == NULL)
{
/* reading */
t->grp_sid = malloc(sizeof(*t->grp_sid));
- ZERO_STRUCTPN(t->grp_sid);
+ ZERO_STRUCTP(t->grp_sid);
}
if (t->grp_sid == NULL)
{
/* reading */
sec->sec = malloc(sizeof(*sec->sec));
- ZERO_STRUCTPN(sec->sec);
+ ZERO_STRUCTP(sec->sec);
if (sec->sec == NULL)
{
#include <ufs/quota.h>
/****************************************************************************
-try to get the disk space from disk quotas - OFS1 version
+try to get the disk space from disk quotas - OSF1 version
****************************************************************************/
BOOL disk_quotas(char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)