diff options
author | Jeremy Allison <jra@samba.org> | 2011-05-03 14:08:27 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-05-04 12:12:14 -0700 |
commit | 0dcc75f2df9d9e151f97448e54a34f2899657490 (patch) | |
tree | 6e2bfce99fbcedbf086934562f68c8cd4b8c02e9 /source3/modules | |
parent | 8ff244ec2d0a57bc4cd9dbbf1f14dea42ae9a068 (diff) | |
download | samba-0dcc75f2df9d9e151f97448e54a34f2899657490.tar.gz samba-0dcc75f2df9d9e151f97448e54a34f2899657490.tar.xz samba-0dcc75f2df9d9e151f97448e54a34f2899657490.zip |
Remove magic numbers. Standardize on macro. Move from safe_strcat to strlcat.
Diffstat (limited to 'source3/modules')
-rw-r--r-- | source3/modules/vfs_afsacl.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/modules/vfs_afsacl.c b/source3/modules/vfs_afsacl.c index 06ce6f5f8d..4fdfdd997c 100644 --- a/source3/modules/vfs_afsacl.c +++ b/source3/modules/vfs_afsacl.c @@ -30,7 +30,7 @@ #include <afs/venus.h> #include <afs/prs_fs.h> -#define MAXSIZE 2048 +#define MAXSIZE 2049 extern const struct dom_sid global_sid_World; extern const struct dom_sid global_sid_Builtin_Administrators; @@ -234,10 +234,10 @@ static bool parse_afs_acl(struct afs_acl *acl, const char *acl_str) int nplus, nminus; int aces; - char str[MAXSIZE+1]; + char str[MAXSIZE]; char *p = str; - strncpy(str, acl_str, MAXSIZE); + strlcpy(str, acl_str, MAXSIZE); if (sscanf(p, "%d", &nplus) != 1) return False; @@ -313,16 +313,16 @@ static bool unparse_afs_acl(struct afs_acl *acl, char *acl_str) } fstr_sprintf(line, "%d\n", positives); - safe_strcat(acl_str, line, MAXSIZE); + strlcat(acl_str, line, MAXSIZE); fstr_sprintf(line, "%d\n", negatives); - safe_strcat(acl_str, line, MAXSIZE); + strlcat(acl_str, line, MAXSIZE); ace = acl->acelist; while (ace != NULL) { fstr_sprintf(line, "%s\t%d\n", ace->name, ace->rights); - safe_strcat(acl_str, line, MAXSIZE); + strlcat(acl_str, line, MAXSIZE); ace = ace->next; } return True; @@ -897,7 +897,7 @@ static NTSTATUS afs_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, { struct afs_acl old_afs_acl, new_afs_acl; struct afs_acl dir_acl, file_acl; - char acl_string[2049]; + char acl_string[MAXSIZE]; struct afs_iob iob; int ret = -1; char *name = NULL; |