#include "includes.h"
#include "system/filesys.h"
#include "auth.h"
-#include "lib/util/xfile.h"
/*******************************************************************
Map a username from a dos name to a unix name by looking in the username
bool map_username(TALLOC_CTX *ctx, const char *user_in, char **p_user_out)
{
- XFILE *f;
+ FILE *f;
char *mapfile = lp_username_map(talloc_tos());
char *s;
char buf[512];
if (!*mapfile)
return False;
- f = x_fopen(mapfile,O_RDONLY, 0);
+ f = fopen(mapfile, "r");
if (!f) {
DEBUG(0,("can't open username map %s. Error %s\n",mapfile, strerror(errno) ));
return False;
DEBUG(4,("Scanning username map %s\n",mapfile));
- while((s=x_fgets_slash(buf,sizeof(buf),f))!=NULL) {
+ while((s=fgets_slash(NULL,buf,sizeof(buf),f))!=NULL) {
char *unixname = s;
char *dosname = strchr_m(unixname,'=');
char **dosuserlist;
*p_user_out = talloc_strdup(ctx, unixname);
if (!*p_user_out) {
TALLOC_FREE(dosuserlist);
- x_fclose(f);
+ fclose(f);
return false;
}
if ( return_if_mapped ) {
TALLOC_FREE(dosuserlist);
- x_fclose(f);
+ fclose(f);
return True;
}
}
TALLOC_FREE(dosuserlist);
}
- x_fclose(f);
+ fclose(f);
/*
* If we didn't successfully map a user in the loop above,