* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* chkpath is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* chkpath is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with chkpath; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
* You should have received a copy of the GNU General Public License
* along with chkpath; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-{
- fprintf(fp, "%s version %s\n", QUIS, VERSION);
-}
+ { fprintf(fp, "%s version %s\n", QUIS, VERSION); }
-s, --sticky Consider sticky directories secure against\n\
modification by world and group (not recommended).\n\
-t, --trust-group Consider other members of your group trustworthy.\n\
-s, --sticky Consider sticky directories secure against\n\
modification by world and group (not recommended).\n\
-t, --trust-group Consider other members of your group trustworthy.\n\
- { "version", 0, 0, 'V' },
+ { "version", 0, 0, 'V' },
- { "verbose", 0, 0, 'v' },
+ { "verbose", 0, 0, 'v' },
{ "quiet", 0, 0, 'q' },
{ "sticky", 0, 0, 's' },
{ "trust-group", 0, 0, 't' },
{ "print", 0, 0, 'p' },
{ 0, 0, 0, 0 }
};
{ "quiet", 0, 0, 'q' },
{ "sticky", 0, 0, 's' },
{ "trust-group", 0, 0, 't' },
{ "print", 0, 0, 'p' },
{ 0, 0, 0, 0 }
};
- int i = mdwopt(argc, argv, "hVu vqstp", opts, 0, 0, 0);
+ int i = mdwopt(argc, argv, "hVu" "vqstpg:", opts, 0, 0, 0);
- cp.cp_what = (cp.cp_what & ~CP_WRGRP) | CP_WROTHGRP;
+ if (checkpath_setgid(&cp) || checkpath_setgroups(&cp))
+ die(1, "too many groups");
+ break;
+ case 'g':
+ allowgroup(&cp, optarg);