aboutsummaryrefslogtreecommitdiff
path: root/modules/pam_xauth/pam_xauth.c
diff options
context:
space:
mode:
authorPino Toscano <toscano.pino@tiscali.it>2023-05-12 06:38:54 +0200
committerDmitry V. Levin <ldv@strace.io>2023-05-12 04:49:01 +0000
commit2d121ac1285958f4d9502d5b078af814b120dd3d (patch)
tree2acb504c68dc09b82b663ff3933c744450e77946 /modules/pam_xauth/pam_xauth.c
parentbcd540496d3fc1af59c129a508d22e235990e041 (diff)
downloadpam-2d121ac1285958f4d9502d5b078af814b120dd3d.tar.gz
pam-2d121ac1285958f4d9502d5b078af814b120dd3d.tar.bz2
pam-2d121ac1285958f4d9502d5b078af814b120dd3d.zip
pam_mkhomedir: simplify handling of newsource/newdest
To support OSes without PATH_MAX (which is optional in POSIX), there are two code paths for the 'newsource' and 'newdest' variables: one using a PATH_MAX-sized stack buffer, and one using heap allocation. The second is even more complicated than needed, doing manual calculations and allocations. To simplify the code a bit more, easing its maintenance, unify the two using asprintf() to allocate 'newsource' and 'newdest': the extra allocation needed should not be an issue, since this code runs in a separate helper executable. As additional change for this simplification, remove the reset to the two variables to NULL right after their free(), which is not needed since their scopes end.
Diffstat (limited to 'modules/pam_xauth/pam_xauth.c')
0 files changed, 0 insertions, 0 deletions