From 2a53d6f7077de596265a3e73e79827392054142c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 14 Apr 1998 00:41:59 +0000 Subject: Modified interfaces to getting smb password entries from get_smbpwd_entry (now an internal function to smbpass.c) to a more UNIX-like : getsmbpwnam() - get entry by name. getsmbpwuid() - get entry by uid. Changed the type returned by the smbpasswd enumeration functions to be a void * so that people don't come to depend on it being a FILE *. These abstractions should make it much easier to replace the smbpasswd file with a better backend in future. Other files changed are to match the above changes. Jeremy. (This used to be commit 1161cfb7f2b0d5a6d3e2b524a14a6f325ce70efb) --- source3/utils/smbpasswd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index 2433fa1bb4..b569ba96b3 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/utils/smbpasswd.c @@ -398,7 +398,7 @@ char *encode_acct_ctrl(uint16 acct_ctrl) int get_new_machine_uid(void) { int next_uid_start; - FILE *fp; + void *vp; struct smb_passwd *smbpw; if(sizeof(uid_t) == 2) @@ -407,12 +407,12 @@ int get_new_machine_uid(void) if(sizeof(uid_t) == 4) next_uid_start = 0x7fffffff; - fp = startsmbpwent(False); - while((smbpw = getsmbpwent(fp)) != NULL) { + vp = startsmbpwent(False); + while((smbpw = getsmbpwent(vp)) != NULL) { if((smbpw->acct_ctrl & (ACB_SVRTRUST|ACB_WSTRUST))) next_uid_start = MIN(next_uid_start, (smbpw->smb_userid-1)); } - endsmbpwent(fp); + endsmbpwent(vp); return next_uid_start; } -- cgit