a directory, the errno returned could end up as ENOENT rather than ENOTDIR.
- Fixes some compiler warnings which showed up on IRIX, as reported by
James Peach.
sbuf->st_ctime = interpret_long_date(rdata + 16); /* time of last change */
sbuf->st_atime = interpret_long_date(rdata + 24); /* time of last access */
sbuf->st_mtime = interpret_long_date(rdata + 32); /* time of last modification */
sbuf->st_ctime = interpret_long_date(rdata + 16); /* time of last change */
sbuf->st_atime = interpret_long_date(rdata + 24); /* time of last access */
sbuf->st_mtime = interpret_long_date(rdata + 32); /* time of last modification */
- sbuf->st_uid = IVAL(rdata,40); /* user ID of owner */
- sbuf->st_gid = IVAL(rdata,48); /* group ID of owner */
+ sbuf->st_uid = (uid_t) IVAL(rdata,40); /* user ID of owner */
+ sbuf->st_gid = (gid_t) IVAL(rdata,48); /* group ID of owner */
sbuf->st_mode |= unix_filetype_from_wire(IVAL(rdata, 56));
#if defined(HAVE_MAKEDEV)
{
sbuf->st_mode |= unix_filetype_from_wire(IVAL(rdata, 56));
#if defined(HAVE_MAKEDEV)
{
/* cope with ticket being in the future due to clock skew */
if ((unsigned)credsp->times.starttime > time(NULL)) {
time_t t = time(NULL);
/* cope with ticket being in the future due to clock skew */
if ((unsigned)credsp->times.starttime > time(NULL)) {
time_t t = time(NULL);
- int time_offset =(unsigned)credsp->times.starttime-t;
+ int time_offset =(int)((unsigned)credsp->times.starttime-t);
DEBUG(4,("ads_krb5_mk_req: Advancing clock by %d seconds to cope with clock skew\n", time_offset));
krb5_set_real_time(context, t + time_offset + 1, 0);
}
DEBUG(4,("ads_krb5_mk_req: Advancing clock by %d seconds to cope with clock skew\n", time_offset));
krb5_set_real_time(context, t + time_offset + 1, 0);
}
- DEBUG(10,("ads_krb5_mk_req: Ticket (%s) in ccache (%s) is valid until: (%s - %d)\n",
+ DEBUG(10,("ads_krb5_mk_req: Ticket (%s) in ccache (%s) is valid until: (%s - %u)\n",
principal, krb5_cc_default_name(context),
http_timestring((unsigned)credsp->times.endtime),
(unsigned)credsp->times.endtime));
principal, krb5_cc_default_name(context),
http_timestring((unsigned)credsp->times.endtime),
(unsigned)credsp->times.endtime));
if (rdata) {
if (res == 0 || res == ERRmoredata) {
if (rdata) {
if (res == 0 || res == ERRmoredata) {
- int i, converter, count;
- p = rparam + WORDSIZE; /* skip result */
- GETWORD(p, converter);
+ p = rparam + WORDSIZE + WORDSIZE; /* skip result and converter */
GETWORD(p, count);
for (i=0,p=rdata;i<count;i++) {
GETWORD(p, count);
for (i=0,p=rdata;i<count;i++) {
}
if (rdata) {
if (res == 0 || res == ERRmoredata) {
}
if (rdata) {
if (res == 0 || res == ERRmoredata) {
- int i, converter, count;
- p = rparam +WORDSIZE;
- GETWORD(p, converter);
+ p = rparam + WORDSIZE + WORDSIZE;
GETWORD(p, count);
for (i=0,p=rdata; i<count; i++) {
GETWORD(p, count);
for (i=0,p=rdata; i<count; i++) {
}
if (rdata) {
if (res == 0 || res == ERRmoredata) {
}
if (rdata) {
if (res == 0 || res == ERRmoredata) {
- int i, converter, count;
- p = rparam +WORDSIZE;
- GETWORD(p, converter);
+ p = rparam + WORDSIZE + WORDSIZE;
GETWORD(p, count);
for (i=0,p=rdata; i<count; i++) {
GETWORD(p, count);
for (i=0,p=rdata; i<count; i++) {
char username[RAP_USERNAME_LEN];
char userpw[RAP_UPASSWD_LEN];
pstring comment, homedir, logonscript;
char username[RAP_USERNAME_LEN];
char userpw[RAP_UPASSWD_LEN];
pstring comment, homedir, logonscript;
- int pwage, priv, flags;
p = rparam + WORDSIZE; /* skip result */
GETWORD(p, converter);
p = rparam + WORDSIZE; /* skip result */
GETWORD(p, converter);
GETSTRINGF(p, username, RAP_USERNAME_LEN);
p++; /* pad byte */
GETSTRINGF(p, userpw, RAP_UPASSWD_LEN);
GETSTRINGF(p, username, RAP_USERNAME_LEN);
p++; /* pad byte */
GETSTRINGF(p, userpw, RAP_UPASSWD_LEN);
- GETDWORD(p, pwage); /* password age */
- GETWORD(p, priv); /* 0=guest, 1=user, 2=admin */
+ p += DWORDSIZE; /* skip password age */
+ p += WORDSIZE; /* skip priv: 0=guest, 1=user, 2=admin */
GETSTRINGP(p, homedir, rdata, converter);
GETSTRINGP(p, comment, rdata, converter);
GETSTRINGP(p, homedir, rdata, converter);
GETSTRINGP(p, comment, rdata, converter);
+ p += WORDSIZE; /* skip flags */
GETSTRINGP(p, logonscript, rdata, converter);
fn(username, comment, homedir, logonscript, cli);
GETSTRINGP(p, logonscript, rdata, converter);
fn(username, comment, homedir, logonscript, cli);
}
if (rdata) {
if (res == 0 || res == ERRmoredata) {
}
if (rdata) {
if (res == 0 || res == ERRmoredata) {
- int i, converter, count;
char username[RAP_USERNAME_LEN];
char username[RAP_USERNAME_LEN];
- p = rparam + WORDSIZE; /* skip result */
- GETWORD(p, converter);
+ p = rparam + WORDSIZE + WORDSIZE; /* skip result and converter */
GETWORD(p, count);
for (i=0,p=rdata;i<count;i++) {
GETWORD(p, count);
for (i=0,p=rdata;i<count;i++) {
cli->rap_error = res;
if (res == 0 || res == ERRmoredata) {
cli->rap_error = res;
if (res == 0 || res == ERRmoredata) {
- int i, converter, count;
- p = rparam + WORDSIZE;
- GETWORD(p, converter);
+ p = rparam + WORDSIZE + WORDSIZE;
GETWORD(p, count);
p = rdata;
GETWORD(p, count);
p = rdata;
if (rdata) {
if (res == 0 || res == ERRmoredata) {
if (rdata) {
if (res == 0 || res == ERRmoredata) {
- int i, converter, count;
- p = rparam + WORDSIZE; /* skip result */
- GETWORD(p, converter);
+ p = rparam + WORDSIZE + WORDSIZE; /* skip result and converter */
GETWORD(p, count);
for (i=0,p=rdata;i<count;i++) {
GETWORD(p, count);
for (i=0,p=rdata;i<count;i++) {
res = GETRES(rparam);
if (res == 0 || res == ERRmoredata) {
res = GETRES(rparam);
if (res == 0 || res == ERRmoredata) {
pstring wsname, username, clitype_name;
uint16 num_conns, num_opens, num_users;
unsigned int sess_time, idle_time, user_flags;
p = rparam + WORDSIZE;
GETWORD(p, converter);
pstring wsname, username, clitype_name;
uint16 num_conns, num_opens, num_users;
unsigned int sess_time, idle_time, user_flags;
p = rparam + WORDSIZE;
GETWORD(p, converter);
+ p += WORDSIZE; /* skip rsize */
p = rdata;
GETSTRINGP(p, wsname, rdata, converter);
p = rdata;
GETSTRINGP(p, wsname, rdata, converter);
* Force use of port 139 for first try if share is $IPC, empty, or
* null, so browse lists can work
*/
* Force use of port 139 for first try if share is $IPC, empty, or
* null, so browse lists can work
*/
- if (share == NULL || *share == '\0' || strcmp(share, "IPC$") == 0)
- {
+ if (share == NULL || *share == '\0' || strcmp(share, "IPC$") == 0) {
port_try_first = 139;
port_try_next = 445;
port_try_first = 139;
port_try_next = 445;
port_try_first = 445;
port_try_next = 139;
}
port_try_first = 445;
port_try_next = 139;
}
fstring server, share, user, password, options;
pstring workgroup;
pstring path;
fstring server, share, user, password, options;
pstring workgroup;
pstring path;
+ uint16 mode;
+ char *p;
SMBCSRV *srv = NULL;
SMBCFILE *dir = NULL;
struct in_addr rem_ip;
SMBCSRV *srv = NULL;
SMBCFILE *dir = NULL;
struct in_addr rem_ip;
/* Now, list the files ... */
/* Now, list the files ... */
+ p = path + strlen(path);
pstrcat(path, "\\*");
if (cli_list(&srv->cli, path, aDIR | aSYSTEM | aHIDDEN, dir_list_fn,
pstrcat(path, "\\*");
if (cli_list(&srv->cli, path, aDIR | aSYSTEM | aHIDDEN, dir_list_fn,
SAFE_FREE(dir);
}
errno = smbc_errno(context, &srv->cli);
SAFE_FREE(dir);
}
errno = smbc_errno(context, &srv->cli);
+
+ if (errno == EINVAL) {
+ /*
+ * See if they asked to opendir something
+ * other than a directory. If so, the
+ * converted error value we got would have
+ * been EINVAL rather than ENOTDIR.
+ */
+ *p = '\0'; /* restore original path */
+
+ if (smbc_getatr(context, srv, path,
+ &mode, NULL,
+ NULL, NULL, NULL,
+ NULL) &&
+ ! IS_DOS_DIR(mode)) {
+
+ /* It is. Correct the error value */
+ errno = ENOTDIR;
+ }
+ }
+
if ( (last_check = trustdom_cache_fetch_timestamp()) == 0 )
trustdom_cache_store_timestamp(0, now+TRUSTDOM_UPDATE_INTERVAL);
if ( (last_check = trustdom_cache_fetch_timestamp()) == 0 )
trustdom_cache_store_timestamp(0, now+TRUSTDOM_UPDATE_INTERVAL);
- time_diff = now - last_check;
+ time_diff = (int) (now - last_check);
if ( (time_diff > 0) && (time_diff < TRUSTDOM_UPDATE_INTERVAL) ) {
DEBUG(10,("update_trustdom_cache: not time to update trustdom_cache yet\n"));
if ( (time_diff > 0) && (time_diff < TRUSTDOM_UPDATE_INTERVAL) ) {
DEBUG(10,("update_trustdom_cache: not time to update trustdom_cache yet\n"));
const char *domain)
{
unsigned char old_trust_passwd_hash[16];
const char *domain)
{
unsigned char old_trust_passwd_hash[16];
uint32 sec_channel_type = 0;
uint32 sec_channel_type = 0;
- up_domain = talloc_strdup(mem_ctx, domain);
-
if (!secrets_fetch_trust_account_password(domain,
old_trust_passwd_hash,
NULL, &sec_channel_type)) {
if (!secrets_fetch_trust_account_password(domain,
old_trust_passwd_hash,
NULL, &sec_channel_type)) {