]> git.michaelhowe.org Git - packages/o/openafs.git/commit
userok.c: Fix fixed-size on-stack path buffers
authorJeffrey Hutzelman <jhutz@cmu.edu>
Tue, 18 Jun 2013 16:35:36 +0000 (12:35 -0400)
committerStephan Wiesand <stephan.wiesand@desy.de>
Fri, 6 Nov 2015 12:27:46 +0000 (07:27 -0500)
commit9ef3a6ae65bb80d320525ad561e10f960269d182
tree1043556d3c50400e50a31ef9d107d2b8449efd57
parentc1c7f4b58b1eefe7b14e33dd07d75e50d8da609f
userok.c: Fix fixed-size on-stack path buffers

Several functions in src/auth/userok.c construct pathnames in fixed
size buffers on their stacks.  Those buffers are simultaneously too
small for the purpose for which they are used and too large to be
placed on the stack.  This change replaces these fixed-size buffers
with dynamically-allocated buffers which are either exactly the right
size (due to asprintf) or have size AFSDIR_PATH_MAX.

FIXES 130719

Reviewed-on: http://gerrit.openafs.org/9986
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 68e02987f62e1c507ddf7fd35847338b130c243d)

This file has diverged quite substantially between master and 1.6.x,
so though it is marked as a "cherry-pick", this patch was substantially
rewritten for the 1.6 branch.  In particular, we must use afs_asprintf()
since asprintf() is not available everywhere.

Change-Id: Iac62cb8293e7b28b422e7401eccb1f26841aff66
Reviewed-on: http://gerrit.openafs.org/11436
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Daria Phoebe Brashear <shadow@your-file-system.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/auth/userok.c