typedef uint16 smb_ucs2_t;
-/* ucs2 string types. */
-typedef smb_ucs2_t wpstring[PSTRING_LEN];
-typedef smb_ucs2_t wfstring[FSTRING_LEN];
-
#ifdef WORDS_BIGENDIAN
#define UCS2_SHIFT 8
#else
struct {
/* We deliberatedly don't split into domain/user to
avoid having the client know what the separator
- character is. */
+ character is. */
fstring user;
fstring pass;
- pstring require_membership_of_sid;
+ char require_membership_of_sid[1024];
fstring krb5_cc_type;
uid_t uid;
} auth; /* pam_winbind auth module */
fstring sid; /* lookupsid, sid_to_[ug]id */
struct {
fstring dom_name; /* lookupname */
- fstring name;
+ fstring name;
} name;
uint32_t num_entries; /* getpwent, getgrent */
struct {
pid_t pid;
struct winbindd_domain *domain;
- pstring logfilename;
+ char *logfilename;
struct fd_event event;
struct timed_event *lockout_policy_event;
fstring alt_name; /* alt Domain name, if any (FQDN for ADS) */
fstring forest_name; /* Name of the AD forest we're in */
DOM_SID sid; /* SID for this domain */
- uint32 domain_flags; /* Domain flags from rpc_ds.h */
- uint32 domain_type; /* Domain type from rpc_ds.h */
+ uint32 domain_flags; /* Domain flags from rpc_ds.h */
+ uint32 domain_type; /* Domain type from rpc_ds.h */
uint32 domain_trust_attribs; /* Trust attribs from rpc_ds.h */
bool initialized; /* Did we already ask for the domain mode? */
bool native_mode; /* is this a win2k domain in native mode ? */
/* Private data for the backends (used for connection cache) */
- void *private_data;
+ void *private_data;
/* A working DC */
fstring dcname;
const char *explicit_logfile)
{
if (explicit_logfile != NULL) {
- pstr_sprintf(child->logfilename, "%s/log.winbindd-%s",
- dyn_LOGFILEBASE, explicit_logfile);
+ if (asprintf(&child->logfilename, "%s/log.winbindd-%s",
+ dyn_LOGFILEBASE, explicit_logfile) < 0) {
+ smb_panic("Internal error: asprintf failed");
+ }
} else if (domain != NULL) {
- pstr_sprintf(child->logfilename, "%s/log.wb-%s",
- dyn_LOGFILEBASE, domain->name);
+ if (asprintf(&child->logfilename, "%s/log.wb-%s",
+ dyn_LOGFILEBASE, domain->name) < 0) {
+ smb_panic("Internal error: asprintf failed");
+ }
} else {
smb_panic("Internal error: domain == NULL && "
"explicit_logfile == NULL");
child->event.fd = 0;
child->event.flags = 0;
child->pid = 0;
+ SAFE_FREE(child->logfilename);
schedule_async_request(child);
}