diff options
author | Garming Sam <garming@catalyst.net.nz> | 2014-02-26 12:31:03 +1300 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-05-07 19:49:18 +0200 |
commit | fa48d527b565838b3d29b567ae5bc9be8395d8dc (patch) | |
tree | 716a7b546a5f595ffe033b95b5b1e61eec837a0c | |
parent | b2ce4e75496dca9cc51dd858b569ee2b7e80eed2 (diff) | |
download | samba-fa48d527b565838b3d29b567ae5bc9be8395d8dc.tar.gz samba-fa48d527b565838b3d29b567ae5bc9be8395d8dc.tar.xz samba-fa48d527b565838b3d29b567ae5bc9be8395d8dc.zip |
param: replace P_OCTAL variable setting with s3 version which uses sscanf
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | lib/param/loadparm.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index 33960da2a7..bf0cbc0e9d 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -1449,7 +1449,11 @@ static bool set_variable(TALLOC_CTX *mem_ctx, int parmnum, void *parm_ptr, break; case P_OCTAL: - *(int *)parm_ptr = strtol(pszParmValue, NULL, 8); + i = sscanf(pszParmValue, "%o", (int *)parm_ptr); + if ( i != 1 ) { + DEBUG ( 0, ("Invalid octal number %s\n", pszParmName )); + return false; + } break; case P_BYTES: |