19 #include <sys/types.h>
24 /* HM's must have / at the end !!! */
26 #if defined(__linux__)
28 #if defined(__i386__) || defined(__x86_64__)
29 #include "quota.h" /* From quota-3.09, works only for new quota! */
33 #elif defined(__sparc__)
34 #include <sys/quota.h>
37 #error Unknown architecture!
41 #include <sys/fs/ufs_quota.h>
42 #elif defined(__osf__)
45 #include <sys/security.h>
47 #include <ufs/quota.h>
48 int quotactl(char *, int, int, char *);
50 #define HM "/usr/users/"
51 #include <ufs/quota.h>
52 int quotactl(char *, int, int, char *);
55 #define HM "/usr/users/"
56 #include <sys/param.h>
57 #include <sys/quota.h>
58 int quota(int, int, int, caddr_t);
59 extern int setreuid(uid_t, uid_t);
60 extern int seteuid(uid_t);
61 extern int putenv(char *);
64 #define ALL 0 /* forbidden + srce + admin */
65 #define NOTALL 1 /* only forbidden */
66 #define ERROR 2 /* error condition */
67 #define OK 3 /* everything's fine */
69 #define OFF 0 /* drop privileges */
70 #define ON 1 /* get priviliges */
72 #define MAXLOGIN 16 /* max login size + 1 */
73 #define MAXGROUP 16 /* max group name + 1 */
74 #define MAXNAME 64 /* max username size + 1 */
75 #define MAXSTR 64 /* max input string for quota numbers + 1 */
76 #define MAXDIR 1024 /* max pathlen */
77 #define MAXCOMMAND 256 /* max string length for system() */
78 #define MAXQUOTA 262144 /* max quota in KB */
79 #define MAXMESS 200 /* max message length for shutdown */
80 #define MINGRACE 1 /* min grace period for shutdown */
81 #define MAXGRACE 60 /* max grace period for shutdown */
83 #define CONSOLE "/dev/console" /* console device */
85 #define CONF_NOCONSOLE "no_console_check" /* Config: don't check for console */
87 #if defined (__linux__) || defined(__SVR4)
88 #define LOGFILE "/var/log/sysadmin.log" /* logfile */
89 #define ACLFILE "/etc/sysadmin/users" /* acl file */
90 #define OPTFILE "/etc/sysadmin/config" /* config */
91 #define GROUPFILE "/etc/group" /* group file */
92 #define GROUPTMPFILE "/tmp/group" /* tmp group file */
93 #if defined (__linux__)
94 #define MANFILE "/usr/share/sysadmin/sysadm.man" /* online manual */
95 #define PARSE_USERADD_DEFAULTS 1
97 #define MANFILE "/usr/local/share/sysadmin/sysadm.man" /* online manual */
100 #define LOGFILE "/var/adm/adminlog" /* logfile */
101 #define ACLFILE "/etc/adminusers" /* acl file */
102 #define OPTFILE "/etc/adminconfig" /* config */
103 #define MANFILE "/etc/sysadm.man" /* online manual */
106 #if defined(__linux__)
107 #define DEFAULTSHELL "/bin/bash"
109 #define DEFAULTSHELL "/bin/csh"
112 /* function prototypes */
114 void logger(char *, ...);
115 void printpriv(char *);
123 void enter(char *, int);
124 void getuser(char *);
125 void getgroup(char *);
128 int getquota(int *, int *);
131 int system_default_shell_check(void);
140 void console_check(char *);