Use checkpath_addgid to implement the -g option. Don't call
checkpath_setids at all; instead use the effective user-id.
/* --- Initialize variables --- */
ego(argv[0]);
/* --- Initialize variables --- */
ego(argv[0]);
+ me = cp.cp_uid = geteuid();
cp.cp_what = (CP_WRWORLD | CP_WROTHGRP | CP_WROTHUSR |
CP_STICKYOK | CP_REPORT);
cp.cp_verbose = 0;
cp.cp_report = report;
cp.cp_what = (CP_WRWORLD | CP_WROTHGRP | CP_WROTHUSR |
CP_STICKYOK | CP_REPORT);
cp.cp_verbose = 0;
cp.cp_report = report;
cp.cp_gids = 0; /* ignore group membership */
pw = getpwuid(me);
if (!pw)
cp.cp_gids = 0; /* ignore group membership */
pw = getpwuid(me);
if (!pw)