From f888868f46a5418bac9ab528497136c152895305 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 12 May 1998 00:55:32 +0000 Subject: This is a security audit change of the main source. It removed all ocurrences of the following functions : sprintf strcpy strcat The replacements are slprintf, safe_strcpy and safe_strcat. It should not be possible to use code in Samba that uses sprintf, strcpy or strcat, only the safe_equivalents. Once Andrew has fixed the slprintf implementation then this code will be moved back to the 1.9.18 code stream. Jeremy. (This used to be commit 2d774454005f0b54e5684cf618da7060594dfcbb) --- source3/smbd/quotas.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/smbd/quotas.c') diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c index df85f79b9b..ee08e48e65 100644 --- a/source3/smbd/quotas.c +++ b/source3/smbd/quotas.c @@ -138,7 +138,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize) struct stat sbuf; dev_t devno ; static dev_t devno_cached = 0 ; - static char name[MNTMAXSTR] ; + static pstring name; struct q_request request ; struct qf_header header ; static int quota_default = 0 ; @@ -172,7 +172,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize) } - strcpy(name,mnt->mnt_dir) ; + pstrcpy(name,mnt->mnt_dir) ; endmntent(fd) ; if ( ! found ) @@ -249,10 +249,10 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize) struct quotctl command; int file; struct mnttab mnt; - static char name[MNT_LINE_MAX] ; + static pstring name; #else struct mntent *mnt; - static char name[MNTMAXSTR] ; + static pstring name; #endif FILE *fd; struct stat sbuf; @@ -283,8 +283,8 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize) } } - strcpy(name,mnt.mnt_mountp) ; - strcat(name,"/quotas") ; + pstrcpy(name,mnt.mnt_mountp) ; + pstrcat(name,"/quotas") ; fclose(fd) ; #else if ((fd = setmntent(MOUNTED, "r")) == NULL) @@ -302,7 +302,7 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize) } } - strcpy(name,mnt->mnt_fsname) ; + pstrcpy(name,mnt->mnt_fsname) ; endmntent(fd) ; #endif -- cgit