Index: source/smbd/open.c =================================================================== --- source/smbd/open.c (revision 1561) +++ source/smbd/open.c (working copy) @@ -71,7 +71,7 @@ int fd_close(struct connection_struct *c static void check_for_pipe(const char *fname) { /* special case of pipe opens */ - char s[10]; + pstring s; StrnCpy(s,fname,sizeof(s)-1); strlower_m(s); if (strstr(s,"pipe/")) { Index: source/smbd/posix_acls.c =================================================================== --- source/smbd/posix_acls.c (revision 1561) +++ source/smbd/posix_acls.c (working copy) @@ -180,7 +180,7 @@ static char *create_pai_buf(canon_ace *f entry_offset = pai_buf + PAI_ENTRIES_BASE; - for (ace_list = dir_ace_list; ace_list; ace_list = ace_list->next) { + for (ace_list = file_ace_list; ace_list; ace_list = ace_list->next) { if (ace_list->inherited) { uint8 type_val = (unsigned char)ace_list->owner_type; uint32 entry_val = get_entry_val(ace_list); @@ -191,7 +191,7 @@ static char *create_pai_buf(canon_ace *f } } - for (ace_list = file_ace_list; ace_list; ace_list = ace_list->next) { + for (ace_list = dir_ace_list; ace_list; ace_list = ace_list->next) { if (ace_list->inherited) { uint8 type_val = (unsigned char)ace_list->owner_type; uint32 entry_val = get_entry_val(ace_list); Index: source/lib/util_str.c =================================================================== --- source/lib/util_str.c (revision 1561) +++ source/lib/util_str.c (working copy) @@ -1391,6 +1391,7 @@ char *strstr_m(const char *src, const ch void strlower_m(char *s) { size_t len; + int errno_save; /* this is quite a common operation, so we want it to be fast. We optimise for the ascii case, knowing that all our @@ -1408,11 +1409,13 @@ void strlower_m(char *s) /* I assume that lowercased string takes the same number of bytes * as source string even in UTF-8 encoding. (VIV) */ len = strlen(s) + 1; + errno_save = errno; errno = 0; unix_strlower(s,len,s,len); /* Catch mb conversion errors that may not terminate. */ if (errno) s[len-1] = '\0'; + errno = errno_save; } /** @@ -1422,6 +1425,7 @@ void strlower_m(char *s) void strupper_m(char *s) { size_t len; + int errno_save; /* this is quite a common operation, so we want it to be fast. We optimise for the ascii case, knowing that all our @@ -1439,11 +1443,13 @@ void strupper_m(char *s) /* I assume that lowercased string takes the same number of bytes * as source string even in multibyte encoding. (VIV) */ len = strlen(s) + 1; + errno_save = errno; errno = 0; unix_strupper(s,len,s,len); /* Catch mb conversion errors that may not terminate. */ if (errno) s[len-1] = '\0'; + errno = errno_save; } /**