Blame modules/pam_console/modechange.h

Packit Service b29381
/* modechange.h -- definitions for file mode manipulation
Packit Service b29381
   Copyright (C) 1989, 1990 Free Software Foundation, Inc.
Packit Service b29381
Packit Service b29381
   This program is free software; you can redistribute it and/or modify
Packit Service b29381
   it under the terms of the GNU General Public License as published by
Packit Service b29381
   the Free Software Foundation; either version 2, or (at your option)
Packit Service b29381
   any later version.
Packit Service b29381
Packit Service b29381
   This program is distributed in the hope that it will be useful,
Packit Service b29381
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service b29381
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service b29381
   GNU General Public License for more details.
Packit Service b29381
Packit Service b29381
   You should have received a copy of the GNU General Public License
Packit Service b29381
   along with this program; if not, write to the Free Software Foundation,
Packit Service b29381
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
Packit Service b29381
Packit Service b29381
#ifndef _MODECHANGE_H
Packit Service b29381
#define _MODECHANGE_H
Packit Service b29381
Packit Service b29381
#ifndef STATIC
Packit Service b29381
#define STATIC
Packit Service b29381
#endif
Packit Service b29381
Packit Service b29381
Packit Service b29381
/* Masks for the `flags' field in a `struct mode_change'. */
Packit Service b29381
Packit Service b29381
/* Affect the execute bits only if at least one execute bit is set already,
Packit Service b29381
   or if the file is a directory. */
Packit Service b29381
#define MODE_X_IF_ANY_X 01
Packit Service b29381
Packit Service b29381
/* If set, copy some existing permissions for u, g, or o onto the other two.
Packit Service b29381
   Which of u, g, or o is copied is determined by which bits are set in the
Packit Service b29381
   `value' field. */
Packit Service b29381
#define MODE_COPY_EXISTING 02
Packit Service b29381
Packit Service b29381
struct mode_change
Packit Service b29381
{
Packit Service b29381
  char op;			/* One of "=+-". */
Packit Service b29381
  char flags;			/* Special operations. */
Packit Service b29381
  unsigned short affected;	/* Set for u/g/o/s/s/t, if to be affected. */
Packit Service b29381
  unsigned short value;		/* Bits to add/remove. */
Packit Service b29381
  struct mode_change *next;	/* Link to next change in list. */
Packit Service b29381
};
Packit Service b29381
Packit Service b29381
/* Masks for mode_compile argument. */
Packit Service b29381
#define MODE_MASK_EQUALS 1
Packit Service b29381
#define MODE_MASK_PLUS 2
Packit Service b29381
#define MODE_MASK_MINUS 4
Packit Service b29381
Packit Service b29381
/* Error return values for mode_compile. */
Packit Service b29381
#define MODE_INVALID (struct mode_change *) 0
Packit Service b29381
#define MODE_MEMORY_EXHAUSTED (struct mode_change *) 1
Packit Service b29381
Packit Service b29381
#ifndef __P
Packit Service b29381
# if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
Packit Service b29381
#  define __P(Args) Args
Packit Service b29381
# else
Packit Service b29381
#  define __P(Args) ()
Packit Service b29381
# endif
Packit Service b29381
#endif
Packit Service b29381
Packit Service b29381
STATIC struct mode_change *mode_compile __P ((const char *, unsigned));
Packit Service b29381
STATIC unsigned short mode_adjust __P ((unsigned, const struct mode_change *));
Packit Service b29381
STATIC void mode_free __P ((struct mode_change *));
Packit Service b29381
Packit Service b29381
#endif /* _MODECHANGE_H */