Move the common path-is-directory check into tools.c and declare it in net.h. Replace the local NDIR and Trustee helper implementations with tool_path_is_dir(), and update NDIR, REMOVE and REVOKE callers to use the shared helper directly. The helper preserves the existing behavior of treating empty and current-directory paths as directories and otherwise falling back to stat(). No behavior change.
52 lines
1.9 KiB
C
52 lines
1.9 KiB
C
/*
|
|
* mars-nwe-dosutils - NetWare/DOS utility tools.
|
|
*
|
|
* Copyright (C) 2026 Mario Fetka
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify 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.
|
|
*
|
|
* This program 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 this program; if not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
/*
|
|
* Purpose: Public declarations for shared trustee and rights helper routines.
|
|
* Depends on: trustee.c implementation and command modules such as grant.c, remove.c and revoke.c.
|
|
*/
|
|
|
|
#ifndef TRUSTEE_H
|
|
#define TRUSTEE_H
|
|
|
|
#define TRUSTEE_BINDERY_USER 0x0001
|
|
#define TRUSTEE_BINDERY_GROUP 0x0002
|
|
|
|
#define TRUSTEE_RIGHT_READ 0x0001
|
|
#define TRUSTEE_RIGHT_WRITE 0x0002
|
|
#define TRUSTEE_RIGHT_OPEN 0x0004
|
|
#define TRUSTEE_RIGHT_CREATE 0x0008
|
|
#define TRUSTEE_RIGHT_DELETE 0x0010
|
|
#define TRUSTEE_RIGHT_OWNER 0x0020
|
|
#define TRUSTEE_RIGHT_SEARCH 0x0040
|
|
#define TRUSTEE_RIGHT_MODIFY 0x0080
|
|
#define TRUSTEE_RIGHT_SUPER 0x0100
|
|
|
|
#define TRUSTEE_RIGHT_ALL_386 (TRUSTEE_RIGHT_SUPER | TRUSTEE_RIGHT_READ | \
|
|
TRUSTEE_RIGHT_WRITE | TRUSTEE_RIGHT_CREATE | \
|
|
TRUSTEE_RIGHT_DELETE | TRUSTEE_RIGHT_MODIFY | \
|
|
TRUSTEE_RIGHT_SEARCH | TRUSTEE_RIGHT_OWNER)
|
|
|
|
int trustee_parse_right_word(char *s, uint16 *rights);
|
|
void trustee_rights_bracket(uint16 rights, char *out);
|
|
void trustee_header_path(char *out, char *path, int max);
|
|
uint32 trustee_lookup_object(char *name, uint16 *objtype, int objtype_given);
|
|
|
|
#endif
|