X-Git-Url: https://git.cameronkatri.com/pw-darwin.git/blobdiff_plain/0b3bc144008c93d61f3720daf8aeff915df65ede..00ee02278a2638a5322e7af5c7f0791a62a17cb6:/pw/pw.h diff --git a/pw/pw.h b/pw/pw.h index 55edc21..1ff69a6 100644 --- a/pw/pw.h +++ b/pw/pw.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ + * $FreeBSD$ */ #include @@ -34,12 +34,14 @@ #include #include #include +#include #include #include #include #include #include "psdate.h" +#include "pwupd.h" enum _mode { @@ -48,6 +50,8 @@ enum _mode M_UPDATE, M_PRINT, M_NEXT, + M_LOCK, + M_UNLOCK, M_NUM }; @@ -65,7 +69,7 @@ struct carg LIST_ENTRY(carg) list; }; -extern LIST_HEAD(cargs, carg) arglist; +LIST_HEAD(cargs, carg); struct userconf { @@ -77,6 +81,7 @@ struct userconf char *newmail; /* Mail to send to new accounts */ char *logfile; /* Where to log changes */ char *home; /* Where to create home directory */ + mode_t homemode; /* Home directory permissions */ char *shelldir; /* Where shells are located */ char **shells; /* List of shells */ char *shell_default; /* Default shell */ @@ -90,6 +95,7 @@ struct userconf int numgroups; /* (internal) size of default_group array */ }; +#define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO) #define _PATH_PW_CONF "/etc/pw.conf" #define _UC_MAXLINE 1024 #define _UC_MAXSHELLS 32 @@ -98,30 +104,20 @@ struct userconf *read_userconfig(char const * file); int write_userconfig(char const * file); struct carg *addarg(struct cargs * _args, int ch, char *argstr); struct carg *getarg(struct cargs * _args, int ch); -void cmderr(int ec, char const * fmt,...); int pw_user(struct userconf * cnf, int mode, struct cargs * _args); int pw_group(struct userconf * cnf, int mode, struct cargs * _args); char *pw_checkname(u_char *name, int gecos); -int addpwent(struct passwd * pwd); -int delpwent(struct passwd * pwd); -int chgpwent(char const * login, struct passwd * pwd); -int fmtpwent(char *buf, struct passwd * pwd); - int addnispwent(const char *path, struct passwd *pwd); int delnispwent(const char *path, const char *login); int chgnispwent(const char *path, const char *login, struct passwd *pwd); -int addgrent(struct group * grp); -int delgrent(struct group * grp); -int chggrent(char const * login, struct group * grp); - int boolean_val(char const * str, int dflt); char const *boolean_str(int val); char *newstr(char const * p); -void pw_log(struct userconf * cnf, int mode, int which, char const * fmt,...); +void pw_log(struct userconf * cnf, int mode, int which, char const * fmt,...) __printflike(4, 5); char *pw_pwcrypt(char *password); extern const char *Modes[];