svn commit: samba r19056 - in branches/tmp/vl-messaging/source/lib: .

2006-10-03 Thread ab
Author: ab
Date: 2006-10-03 12:21:02 + (Tue, 03 Oct 2006)
New Revision: 19056

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=19056

Log:
Care about socket errors. Now smbd doesn't hang up when lockd exits and lockd 
honours SIGTERM. Patch from Aleksey Fedoseev
Modified:
   branches/tmp/vl-messaging/source/lib/messages_dgram.c
   branches/tmp/vl-messaging/source/lib/messages_socket.c
   branches/tmp/vl-messaging/source/lib/messages_stream.c


Changeset:
Modified: branches/tmp/vl-messaging/source/lib/messages_dgram.c
===
--- branches/tmp/vl-messaging/source/lib/messages_dgram.c   2006-10-03 
02:38:08 UTC (rev 19055)
+++ branches/tmp/vl-messaging/source/lib/messages_dgram.c   2006-10-03 
12:21:02 UTC (rev 19056)
@@ -35,7 +35,7 @@
  Send a message through the dgram socket
 /
 
-void send_on_socket_dgram(int socket_fd, struct message_list **queue)
+BOOL send_on_socket_dgram(int socket_fd, struct message_list **queue)
 {
struct message_list* li = *queue;
struct sockaddr_un sunaddr;
@@ -43,7 +43,7 @@
 
if(li == NULL) {
DEBUG(0, (No message available\n));   
-   return ;
+   return False;
}
 
ZERO_STRUCT(sunaddr);
@@ -61,6 +61,7 @@
}
DLIST_REMOVE((*queue), li);
TALLOC_FREE(li);
+   return True;
} else {
if (errno == EMSGSIZE) {
DEBUG(5, (Message (%d bytes) too large\n,
@@ -70,6 +71,7 @@
  socket %s: %s\n, li-msg-len,
  sunaddr.sun_path, strerror(errno)));
}
+   return False;
}
 }
 
@@ -118,28 +120,28 @@
   Receive a message through the dgram socket
 /
 
-void receive_on_socket_dgram(int socket_fd, struct message_list **queue)
+BOOL receive_on_socket_dgram(int socket_fd, struct message_list **queue)
 {
DATA_BLOB dgram = read_from_dgram_socket(socket_fd);
struct message_rec *msg;
struct message_list *li;
 
if (dgram.data == NULL) {
-   return;
+   return False;
}
 
msg = (struct message_rec *)dgram.data;
if (dgram.length  sizeof(msg-len)) {
DEBUG(5, (Message too short: %d\n, dgram.length));
data_blob_free(dgram);
-   return;
+   return False;
}
 
if (msg-len != dgram.length) {
DEBUG(5, (Invalid message length received, got %d, 
  expected %d\n, msg-len, dgram.length));
data_blob_free(dgram);
-   return;
+   return False;
}
 
/* save the received message */
@@ -147,18 +149,20 @@
if (!(li = TALLOC_ZERO_P(NULL, struct message_list))) {
DEBUG(0, (talloc failed\n));
data_blob_free(dgram);
-   return;
+   return False;
}
 
if (!(li-msg = (struct message_rec*)TALLOC(li, msg-len))) {
DEBUG(0, (talloc failed\n));
TALLOC_FREE(li);
data_blob_free(dgram);
-   return;
+   return False;
}   
 
memcpy(li-msg, msg, msg-len);
data_blob_free(dgram);
 
DLIST_ADD_END((*queue), li, struct message_list*);
+
+   return True;
 }

Modified: branches/tmp/vl-messaging/source/lib/messages_socket.c
===
--- branches/tmp/vl-messaging/source/lib/messages_socket.c  2006-10-03 
02:38:08 UTC (rev 19055)
+++ branches/tmp/vl-messaging/source/lib/messages_socket.c  2006-10-03 
12:21:02 UTC (rev 19056)
@@ -32,8 +32,8 @@
 #include includes.h
 
 /* main messaging functions - pointer to the selected implementation */
-static void (*receive_on_socket_func)(int socket_fd, struct message_list 
**queue);
-static void (*send_on_socket_func)(int socket_fd, struct message_list **queue);
+static BOOL (*receive_on_socket_func)(int socket_fd, struct message_list 
**queue);
+static BOOL (*send_on_socket_func)(int socket_fd, struct message_list **queue);
 
 static struct process_id socket_pid;
 static int socket_fd = -1;
@@ -61,7 +61,7 @@
 {
struct message_list *p;
 
-   if(wait_send) {
+   if(wait_send  socket_fd  0) {
time_t start_time;
size_t timeout;

@@ -272,11 +272,13 @@
 
 void message_select_setup_socket(int *maxfd, fd_set *rfds, fd_set *wfds)
 {
-   FD_SET(socket_fd, rfds);
-   if(sent_messages) {
-   FD_SET(socket_fd, wfds);
+   if(socket_fd  0) {
+   FD_SET(socket_fd, rfds);
+

svn commit: samba r19057 - in branches/SAMBA_3_0_23/source: passdb rpc_parse rpc_server utils

2006-10-03 Thread jmcd
Author: jmcd
Date: 2006-10-03 16:48:02 + (Tue, 03 Oct 2006)
New Revision: 19057

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=19057

Log:
backout 18726, 18748, 18754, 18758 from 3.0.23 until further testing in
SAMBA_3_0.  password times go back to previous functionality, for now.

Modified:
   branches/SAMBA_3_0_23/source/passdb/pdb_get_set.c
   branches/SAMBA_3_0_23/source/rpc_parse/parse_samr.c
   branches/SAMBA_3_0_23/source/rpc_server/srv_samr_util.c
   branches/SAMBA_3_0_23/source/utils/net_sam.c
   branches/SAMBA_3_0_23/source/utils/pdbedit.c


Changeset:
Modified: branches/SAMBA_3_0_23/source/passdb/pdb_get_set.c
===
--- branches/SAMBA_3_0_23/source/passdb/pdb_get_set.c   2006-10-03 12:21:02 UTC 
(rev 19056)
+++ branches/SAMBA_3_0_23/source/passdb/pdb_get_set.c   2006-10-03 16:48:02 UTC 
(rev 19057)
@@ -72,32 +72,12 @@
 
 time_t pdb_get_pass_can_change_time(const struct samu *sampass)
 {
-   uint32 allow;
-
-   if (sampass-pass_last_set_time == 0)
-   return (time_t) 0;
-   
-   if (!pdb_get_account_policy(AP_MIN_PASSWORD_AGE, allow))
-   allow = 0;
-
-   return sampass-pass_last_set_time + allow;
+   return sampass-pass_can_change_time;
 }
 
 time_t pdb_get_pass_must_change_time(const struct samu *sampass)
 {
-   uint32 expire;
-
-   if (sampass-pass_last_set_time == 0)
-   return (time_t) 0;
-
-   if (sampass-acct_ctrl  ACB_PWNOEXP)
-   return get_time_t_max();
-
-   if (!pdb_get_account_policy(AP_MAX_PASSWORD_AGE, expire)
-   || expire == (uint32)-1 || expire == 0) 
-   return get_time_t_max();
-
-   return sampass-pass_last_set_time + expire;
+   return sampass-pass_must_change_time;
 }
 
 uint16 pdb_get_logon_divs(const struct samu *sampass)

Modified: branches/SAMBA_3_0_23/source/rpc_parse/parse_samr.c
===
--- branches/SAMBA_3_0_23/source/rpc_parse/parse_samr.c 2006-10-03 12:21:02 UTC 
(rev 19056)
+++ branches/SAMBA_3_0_23/source/rpc_parse/parse_samr.c 2006-10-03 16:48:02 UTC 
(rev 19057)
@@ -6208,7 +6208,6 @@
pass_last_set_time, pass_can_change_time,
pass_must_change_time;

-   time_t must_change_time;
const char* user_name = pdb_get_username(pw);
const char* full_name = pdb_get_fullname(pw);
const char* home_dir  = pdb_get_homedir(pw);
@@ -6233,16 +6232,12 @@
}
 
/* Create NTTIME structs */
-   unix_to_nt_time (logon_time,   pdb_get_logon_time(pw));
-   unix_to_nt_time (logoff_time,  pdb_get_logoff_time(pw));
+   unix_to_nt_time (logon_time,   pdb_get_logon_time(pw));
+   unix_to_nt_time (logoff_time,  pdb_get_logoff_time(pw));
unix_to_nt_time (kickoff_time, pdb_get_kickoff_time(pw));
-   unix_to_nt_time (pass_last_set_time, pdb_get_pass_last_set_time(pw));
-   unix_to_nt_time 
(pass_can_change_time,pdb_get_pass_can_change_time(pw));
-   must_change_time = pdb_get_pass_must_change_time(pw);
-   if (must_change_time == get_time_t_max())
-   unix_to_nt_time_abs(pass_must_change_time, must_change_time);
-   else
-   unix_to_nt_time(pass_must_change_time, must_change_time);
+   unix_to_nt_time (pass_last_set_time,   pdb_get_pass_last_set_time(pw));
+   unix_to_nt_time (pass_can_change_time, 
pdb_get_pass_can_change_time(pw));
+   unix_to_nt_time 
(pass_must_change_time,pdb_get_pass_must_change_time(pw));

/* structure assignment */
usr-logon_time= logon_time;

Modified: branches/SAMBA_3_0_23/source/rpc_server/srv_samr_util.c
===
--- branches/SAMBA_3_0_23/source/rpc_server/srv_samr_util.c 2006-10-03 
12:21:02 UTC (rev 19056)
+++ branches/SAMBA_3_0_23/source/rpc_server/srv_samr_util.c 2006-10-03 
16:48:02 UTC (rev 19057)
@@ -99,6 +99,14 @@
pdb_set_kickoff_time(to, unix_time , PDB_CHANGED);
}   
 
+   if (from-fields_present  ACCT_ALLOW_PWD_CHANGE) {
+   unix_time=nt_time_to_unix(from-pass_can_change_time);
+   stored_time = pdb_get_pass_can_change_time(to);
+   DEBUG(10,(INFO_21 PASS_CAN_CH: %lu - %lu\n,(long unsigned 
int)stored_time, (long unsigned int)unix_time));
+   if (stored_time != unix_time) 
+   pdb_set_pass_can_change_time(to, unix_time, 
PDB_CHANGED);
+   }
+
if (from-fields_present  ACCT_LAST_PWD_CHANGE) {
unix_time=nt_time_to_unix(from-pass_last_set_time);
stored_time = pdb_get_pass_last_set_time(to);
@@ -107,6 +115,14 @@
pdb_set_pass_last_set_time(to, unix_time, 

svn commit: samba r19058 - in branches/SAMBA_3_0/source: auth passdb rpc_server smbd

2006-10-03 Thread jmcd
Author: jmcd
Date: 2006-10-03 17:14:18 + (Tue, 03 Oct 2006)
New Revision: 19058

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=19058

Log:
Implement user cannot change password, and complete user must change
password at next logon code.  The password last set time of zero now
means user must change password, because that's how windows seems to
use it.  The can change and must change times are now calculated
based on the last set time and policies.  

We use the can change field now to indicate that a user cannot change
a password by putting MAX_TIME_T in it (so long as last set time isn't
zero).  Based on this, we set the password-can-change bit in the
faked secdesc.



Modified:
   branches/SAMBA_3_0/source/auth/auth_sam.c
   branches/SAMBA_3_0/source/passdb/passdb.c
   branches/SAMBA_3_0/source/passdb/pdb_get_set.c
   branches/SAMBA_3_0/source/passdb/pdb_interface.c
   branches/SAMBA_3_0/source/passdb/pdb_ldap.c
   branches/SAMBA_3_0/source/rpc_server/srv_netlog_nt.c
   branches/SAMBA_3_0/source/rpc_server/srv_samr_nt.c
   branches/SAMBA_3_0/source/smbd/chgpasswd.c


Changeset:
Modified: branches/SAMBA_3_0/source/auth/auth_sam.c
===
--- branches/SAMBA_3_0/source/auth/auth_sam.c   2006-10-03 16:48:02 UTC (rev 
19057)
+++ branches/SAMBA_3_0/source/auth/auth_sam.c   2006-10-03 17:14:18 UTC (rev 
19058)
@@ -168,7 +168,7 @@
time_t last_set_time = pdb_get_pass_last_set_time(sampass);
 
/* check for immediate expiry must change at next logon */
-   if (must_change_time == 0  last_set_time != 0) {
+   if (last_set_time == 0) {
DEBUG(1,(sam_account_ok: Account for user '%s' 
password must change!.\n, pdb_get_username(sampass)));
return NT_STATUS_PASSWORD_MUST_CHANGE;
}

Modified: branches/SAMBA_3_0/source/passdb/passdb.c
===
--- branches/SAMBA_3_0/source/passdb/passdb.c   2006-10-03 16:48:02 UTC (rev 
19057)
+++ branches/SAMBA_3_0/source/passdb/passdb.c   2006-10-03 17:14:18 UTC (rev 
19058)
@@ -1106,7 +1106,7 @@
logoff_time = (uint32)pdb_get_logoff_time(sampass);
kickoff_time = (uint32)pdb_get_kickoff_time(sampass);
bad_password_time = (uint32)pdb_get_bad_password_time(sampass);
-   pass_can_change_time = (uint32)pdb_get_pass_can_change_time(sampass);
+   pass_can_change_time = 
(uint32)pdb_get_pass_can_change_time_noncalc(sampass);
pass_must_change_time = (uint32)pdb_get_pass_must_change_time(sampass);
pass_last_set_time = (uint32)pdb_get_pass_last_set_time(sampass);
 

Modified: branches/SAMBA_3_0/source/passdb/pdb_get_set.c
===
--- branches/SAMBA_3_0/source/passdb/pdb_get_set.c  2006-10-03 16:48:02 UTC 
(rev 19057)
+++ branches/SAMBA_3_0/source/passdb/pdb_get_set.c  2006-10-03 17:14:18 UTC 
(rev 19058)
@@ -74,15 +74,34 @@
 {
uint32 allow;
 
+   /* if the last set time is zero, it means the user cannot 
+  change their password, and this time must be zero.   jmcd 
+   */
if (sampass-pass_last_set_time == 0)
return (time_t) 0;

+   /* if the time is max, and the field has been changed,
+  we're trying to update this real value from the sampass
+  to indicate that the user cannot change their password.  jmcd
+   */
+   if (sampass-pass_can_change_time == get_time_t_max() 
+   pdb_get_init_flags(sampass, PDB_CANCHANGETIME) == PDB_CHANGED)
+   return sampass-pass_can_change_time;
+
if (!pdb_get_account_policy(AP_MIN_PASSWORD_AGE, allow))
allow = 0;
 
+   /* in normal cases, just calculate it from policy */
return sampass-pass_last_set_time + allow;
 }
 
+/* we need this for loading from the backend, so that we don't overwrite
+   non-changed max times, otherwise the pass_can_change checking won't work */
+time_t pdb_get_pass_can_change_time_noncalc(const struct samu *sampass)
+{
+   return sampass-pass_can_change_time;
+}
+
 time_t pdb_get_pass_must_change_time(const struct samu *sampass)
 {
uint32 expire;
@@ -100,6 +119,14 @@
return sampass-pass_last_set_time + expire;
 }
 
+BOOL pdb_get_pass_can_change(const struct samu *sampass)
+{
+   if (sampass-pass_can_change_time == get_time_t_max() 
+   sampass-pass_last_set_time != 0)
+   return False;
+   return True;
+}
+
 uint16 pdb_get_logon_divs(const struct samu *sampass)
 {
return sampass-logon_divs;
@@ -944,43 +971,14 @@
 
 /* Helpful interfaces to the above */
 
-/*
- Sets the last changed times and must change times for a normal
- password change.
- 

svn commit: samba r19059 - in branches/SAMBA_4_0/source/web_server: .

2006-10-03 Thread derrell
Author: derrell
Date: 2006-10-03 18:07:46 + (Tue, 03 Oct 2006)
New Revision: 19059

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=19059

Log:
allow dash in URLs
Modified:
   branches/SAMBA_4_0/source/web_server/http.c


Changeset:
Modified: branches/SAMBA_4_0/source/web_server/http.c
===
--- branches/SAMBA_4_0/source/web_server/http.c 2006-10-03 17:14:18 UTC (rev 
19058)
+++ branches/SAMBA_4_0/source/web_server/http.c 2006-10-03 18:07:46 UTC (rev 
19059)
@@ -114,7 +114,7 @@
if (url[0] != '/') return NULL;
 
for (i=0;url[i];i++) {
-   if ((!isalnum((unsigned char)url[i])  !strchr(./_, url[i])) 
||
+   if ((!isalnum((unsigned char)url[i])  !strchr(./_-, 
url[i])) ||
(url[i] == '.'  strchr(/., url[i+1]))) {
return NULL;
}



Build status as of Wed Oct 4 00:00:01 2006

2006-10-03 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2006-10-03 
00:00:12.0 +
+++ /home/build/master/cache/broken_results.txt 2006-10-04 00:00:19.0 
+
@@ -1,19 +1,19 @@
-Build status as of Tue Oct  3 00:00:01 2006
+Build status as of Wed Oct  4 00:00:01 2006
 
 Build counts:
 Tree Total  Broken Panic 
 SOC  0  0  0 
 build_farm   0  0  0 
-ccache   16 3  0 
-distcc   16 3  0 
-ldb  41 5  0 
+ccache   14 2  0 
+distcc   14 3  0 
+ldb  40 4  0 
 libreplace   40 1  0 
-lorikeet-heimdal 8  5  0 
+lorikeet-heimdal 7  4  0 
 ppp  17 0  0 
 rsync44 10 0 
 samba0  0  0 
 samba-docs   0  0  0 
-samba4   43 11 1 
+samba4   43 10 1 
 samba_3_042 15 1 
 smb-build29 3  0 
 talloc   44 4  0 


svn commit: samba-docs r989 - in trunk/Samba3-HOWTO: .

2006-10-03 Thread jht
Author: jht
Date: 2006-10-04 01:40:18 + (Wed, 04 Oct 2006)
New Revision: 989

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=samba-docsrev=989

Log:
Applying edits suggested by Jon Johnson.
Modified:
   trunk/Samba3-HOWTO/TOSHARG-NetworkBrowsing.xml
   trunk/Samba3-HOWTO/TOSHARG-ServerType.xml


Changeset:
Modified: trunk/Samba3-HOWTO/TOSHARG-NetworkBrowsing.xml
===
--- trunk/Samba3-HOWTO/TOSHARG-NetworkBrowsing.xml  2006-09-30 16:58:18 UTC 
(rev 988)
+++ trunk/Samba3-HOWTO/TOSHARG-NetworkBrowsing.xml  2006-10-04 01:40:18 UTC 
(rev 989)
@@ -2199,20 +2199,20 @@
 To remove the stale shortcuts found in emphasisMy Network Places/emphasis 
which refer to what are now
 invalid shares or servers it is necessary to edit the Windows Registry under
 literalHKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\/literal. 
Edit the entry
-literalMountPoints2/literal (on Windows XP and later, or 
literalMountPoints/literal on
-Windows 2000 and earlier). Remove all keys named 
literal\\server\share/literal (where 'server' and 'share' refer to a
+literalMountPoints2/literal (on Windows XP and later, or 
literalMountPoints/literal on Windows 2000
+and earlier). Remove all keys named literal\\server\share/literal (where 
'server' and 'share' refer to a
 non-existent server or share). Note that this must be done for every user 
profile that has such stale
-references.
+references. Alternately, you can delete the shortcuts from the MS Windows 
Explorer in literalMy Network
+Places/literal just by right-clicking them and selecting 
emphasisDelete./emphasis
 /para
 
 para
 Samba users have reported that these stale references negatively affect 
network browsing with Windows, Samba,
-and Novell servers. They suspect it is a universal problem not directly 
related to the existence of a Samba
+and Novell servers. It is suspected to be a universal problem not directly 
related to the Samba
 server. Samba users may experience this more often due to Samba being somewhat 
viewed as an experimenter's
 toolkit. This results from the fact that a user might go through several 
reconfigurations and incarnations of
 their Samba server, by different names, with different shares, increasing the 
chances for having stale
-(invalid) cached share references. Strangely (or not so strangely), Windows 
does not seem to expire these
-references. I am not sure how or why the registry keys are created.
+(invalid) cached share references. Windows clients do not seem to expire these 
references.
 /para
 
 para

Modified: trunk/Samba3-HOWTO/TOSHARG-ServerType.xml
===
--- trunk/Samba3-HOWTO/TOSHARG-ServerType.xml   2006-09-30 16:58:18 UTC (rev 
988)
+++ trunk/Samba3-HOWTO/TOSHARG-ServerType.xml   2006-10-04 01:40:18 UTC (rev 
989)
@@ -782,14 +782,13 @@
 sect2
 titleConstantly Losing Connections to Password Server/title
 
-para
-   quote
+paraquote
 Why does server_validate() simply give up rather than re-establish its 
connection to the
 password server?  Though I am not fluent in the SMB protocol, perhaps the 
cluster server
 process passes along to its client workstation the session key it receives 
from the password
 server, which means the password hashes submitted by the client would not work 
on a subsequent
-connection whose session key would be different. So server_validate() must 
give up./quote
-/para
+connection whose session key would be different. So server_validate() must 
give up.
+/quote/para
 
 para
 Indeed. That's why smbconfoption name=securityserver/smbconfoption
@@ -799,6 +798,36 @@
 
 /sect2
 
+sect2
+titleStand-alone Server is converted to Domain Controller smbmdash; Now 
User accounts don't work/title
+
+paraquote
+When I try to log in to the DOMAIN, the eventlog shows emphasistried 
credentials DOMAIN/username; effective
+credentials SERVER/username/emphasis
+/quote/para
+
+para
+Usually this is due to a user or machine account being created before the 
Samba server is configured to be a
+domain controller. Accounts created before the server becomes a domain 
controller will be
+emphasislocal/emphasis accounts and authenticated as what looks like a 
member in the SERVER domain, much
+like local user accounts in Windows 2000 and later.  Accounts created after 
the Samba server becomes a domain
+controller will be emphasisdomain/emphasis accounts and will be 
authenticated as a member of the DOMAIN
+domain.
+/para
+
+para
+This can be verified by issuing the command commandpdbedit -L -v 
username/command.  If this reports DOMAIN
+then the account is a domain account, if it reports SERVER then the account is 
a local account.
+/para
+
+para
+The easiest way to resolve this is to remove and recreate the account; however 
this may cause problems with
+established user profiles. You can also use commandpdbedit -u username -I 
DOMAIN/command. You may also
+need to change the