Blame modules/pam_console/modechange.h

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