getuid() returns real process id not effective (closes #22307)
merge 3.4 (closes #22307)