Re: [Samba] SMB Shares with subversion backing store

2007-11-10 Thread Gerald (Jerry) Carter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jeremy Allison wrote:
 On Fri, Nov 09, 2007 at 02:48:11PM -0500, Ross S. W. Walker wrote:
 I suppose I could contract it out to a development firm, but
 to put something like that together myself. Would the anti-virus
 VFS filter that's floating around provide a good enough framework
 for creating something like this?

 I don't know if the anti-virus VFS filter calls out to external
 applications or if it uses a library API, but even if I had to
 adapt it to an API (in fact a better approach) I could always
 use John Madden's FUSE svnfs as an example of how to write for
 that API.

 Even if I do decide to contract it out, I still need to get a
 feeling for the amount of work it will take so I don't get
 bilked on the job costs.
 
 Indeed. An anti-virus VFS would be a possible start point,
 but you'll need a more complete VFS implementation than
 just virus scanning.

Deryck wrote one a year or so ago I think.





jerry
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHNc7XIR7qMdg1EfYRAminAKDwRWOkBpD4y2hV4LpvaYflC9P4rwCgpVVw
NXWllUGnFkPWafS5NX5+JbM=
=v9Yk
-END PGP SIGNATURE-
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] smbldap-passwd fails

2007-11-10 Thread Jerome Tournier
Hello
which smbldap-tools'vesion ? What do you have defined for hash_encrypt
parameter in smbldap.conf ?
-- 
Jerome

On 11/9/07, Bernhard D Rohrer [EMAIL PROTECTED] wrote:
 Hi folks

 I am getting this error:

 [EMAIL PROTECTED]:/home/admin# smbldap-passwd testuser
 Changing UNIX and samba passwords for testuser
 New password:
 Retype new password:
 I cannot generate the proper hash!

 uncle google was rather quiet on the subject :(

 what do you need config file wise?

 thanks

 Bernhard

 --
 Graylion's Fetish  Fashion Store
 Goth and Kinky Boots, Clothing and Jewellery
 http://www.graylion.net
 --
 To unsubscribe from this list go to the following URL and read the
 instructions:  https://lists.samba.org/mailman/listinfo/samba



-- 
Jérôme
--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] A device attached to the system is not functioning.

2007-11-10 Thread Gerald (Jerry) Carter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Adam,

 Windows XP w/ SP2 is giving me that error message when I'm trying to log
 into my domain:
 
 A device attached to the system is not functioning.

This is always the result of returning NT_STATUS_UNSUCCESSUL
from smbd (which is wrong anyways).

 error log:
 
 [2007/11/09 10:21:01, 1]
 rpc_server/srv_netlog_nt.c:_net_sam_logon_internal(1004)
  _net_sam_logon: user TEST\testuser has user sid S-1-1-0
   but group sid S-1-5-21-3536689092-529281149-710501220-513.
  The conflicting domain portions are not supported for NETLOGON calls
...
 # testuser, People, gomer.mdah.state.ms.us
 dn: uid=testuser,ou=People,dc=gomer,dc=mdah,dc=state,dc=ms,dc=us
...
 homeDirectory: /home/testuser
 gecos: test user,IS,5766888,3738042
 sambaSID: S-1-1-0
^^^

That's wrong.  S-1-1-0 is Everyone.  How did that SID get
assigned?





cheers, jerry
=
Samba--- http://www.samba.org
Centeris ---  http://www.centeris.com
What man is a man who does not make the world better?  --Balian
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHNmFgIR7qMdg1EfYRArAnAKDbbLL3QVsNI4Kbo9nht4O4ENsEQQCg0sn5
PaaEjW9hF1rVLO7g0SVMxm0=
=X5aU
-END PGP SIGNATURE-
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] Re: weird smbclient authentication problem NT_STATUS_LOGON_FAILURE

2007-11-10 Thread Dan Wong
never mind. didn't receive all log files.

the traces were scattered to different log files due to log file being
defined with %m macro.

On Nov 6, 2007 9:36 PM, Dan Wong [EMAIL PROTECTED] wrote:
 I've installed samba 3.0.25c and did a net ads join successfully to
 Windows 2003 PDC.
 wbinfo -u list all users in windows domain correctly.

 I've disabled winbind enum user/groups because wbinfo -u  would time
 out due to large number of users/groups.

 when I execute smbclient -L localhost -U testuser on the local samba
 server I get NT_STATUS_LOGON_FAILURE

 I am absolutely sure that the password is correct.

 On the Windows Domain Controller, in the event logs under security, I
 saw a successful logon entry for testuser.
 this event was right after I executed smbclient command.

 I was actually expecting to see two succesfull logon events (samba
 tries twice I believe).

 I have log level =10 auth:10

 the last trace in the log file was:
 libsmb/ntlmssp.c:ntlmssp_server_auth(739)
   Got user=[testuser] domain=[D1] workstation=[WS1] len1=24 len2=96

 There were no traces of make_user_info_map and check_ntlm_password.

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] Samba Crash with nobody user account

2007-11-10 Thread Philippe MALADJIAN

Hello, i've migrate my domain samba-3.0.22-1 on old server (centos 4.3) to
samba-3.0.23c-2.el5.2.0.2 on new server (Centos 5.0). i'm use OpenLdap to
users accounts and computers accounts. 
Procedure :
 - stop old PDC;
 - copy smb.conf and secrets.tdb on new server;
 - start new PDC;
On the new PDC the localsid it's the localsid the old server and the
domainsid it's ok. But when i'm start the computer and connection with the
account, especially with public share, the connexion is very long and samba
crash with this erreur :

-
Nov 10 17:07:52 svct03 smbd[13627]: [2007/11/10 17:07:52, 0]
lib/fault.c:fault_report(41)
Nov 10 17:07:52 svct03 smbd[13627]:  
===
Nov 10 17:07:52 svct03 smbd[13627]: [2007/11/10 17:07:52, 0]
lib/fault.c:fault_report(42)
Nov 10 17:07:52 svct03 smbd[13627]:   INTERNAL ERROR: Signal 11 in pid
13627 (3.0.23c-2.el5.2.0.2)
Nov 10 17:07:52 svct03 smbd[13627]:   Please read the Trouble-Shooting
section of the Samba3-HOWTO
Nov 10 17:07:52 svct03 smbd[13627]: [2007/11/10 17:07:52, 0]
lib/fault.c:fault_report(44)
Nov 10 17:07:52 svct03 smbd[13627]:
Nov 10 17:07:52 svct03 smbd[13627]:   From:
http://www.samba.org/samba/docs/Samba3-HOWTO.pdf
Nov 10 17:07:52 svct03 smbd[13627]: [2007/11/10 17:07:52, 0]
lib/fault.c:fault_report(45)
Nov 10 17:07:52 svct03 smbd[13627]:  
===
Nov 10 17:07:52 svct03 smbd[13627]: [2007/11/10 17:07:52, 0]
lib/util.c:smb_panic(1614)
Nov 10 17:07:52 svct03 smbd[13627]:   PANIC (pid 13627): internal error
Nov 10 17:07:52 svct03 smbd[13627]: [2007/11/10 17:07:52, 0]
lib/util.c:log_stack_trace(1721)
Nov 10 17:07:52 svct03 smbd[13627]:   BACKTRACE: 18 stack frames:
Nov 10 17:07:52 svct03 smbd[13627]:#0 smbd(log_stack_trace+0x2d)
[0xc3e78d]
Nov 10 17:07:52 svct03 smbd[13627]:#1 smbd(smb_panic+0x5d) [0xc3e8bd]
Nov 10 17:07:52 svct03 smbd[13627]:#2 smbd [0xc29fba]
Nov 10 17:07:52 svct03 smbd[13627]:#3 [0x4ec420]
Nov 10 17:07:52 svct03 smbd[13627]:#4 /lib/libc.so.6(realloc+0xd9)
[0x3d97e9]
Nov 10 17:07:52 svct03 smbd[13627]:#5 smbd(Realloc+0x83) [0xc3f9d3]
Nov 10 17:07:52 svct03 smbd[13627]:#6 smbd(realloc_array+0x46)
[0xc3fae6]
Nov 10 17:07:52 svct03 smbd[13627]:#7 smbd(add_sid_to_array+0xa7)
[0xc37cd7]
Nov 10 17:07:53 svct03 smbd[13627]:#8
smbd(add_sid_to_array_unique+0x65) [0xc37d45]
Nov 10 17:07:53 svct03 smbd[13627]:#9
smbd(create_token_from_username+0x8aa) [0xc86b4a]
Nov 10 17:07:53 svct03 smbd[13627]:#10 smbd [0xad4ed6]
Nov 10 17:07:53 svct03 smbd[13627]:#11 smbd(make_connection+0x194)
[0xad6934]
Nov 10 17:07:53 svct03 smbd[13627]:#12 smbd(reply_tcon_and_X+0x217)
[0xa9a1d7]
Nov 10 17:07:53 svct03 smbd[13627]:#13 smbd [0xad1a90]
Nov 10 17:07:53 svct03 smbd[13627]:#14 smbd(smbd_process+0x7ab)
[0xad2bbb]
Nov 10 17:07:53 svct03 smbd[13627]:#15 smbd(main+0xbd0) [0xcece90]
Nov 10 17:07:53 svct03 smbd[13627]:#16
/lib/libc.so.6(__libc_start_main+0xdc) [0x385dec]
Nov 10 17:07:53 svct03 smbd[13627]:#17 smbd [0xa5cf21]
Nov 10 17:07:53 svct03 smbd[13627]: [2007/11/10 17:07:53, 0]
lib/fault.c:dump_core(173)
Nov 10 17:07:53 svct03 smbd[13627]:   dumping core in
/var/log/samba/cores/smbd
Nov 10 17:07:53 svct03 smbd[13627]:
Nov 10 17:07:52 svct03 smbd[13627]: [2007/11/10 17:07:52, 0]
lib/util.c:smb_panic(1614)
Nov 10 17:07:52 svct03 smbd[13627]:   PANIC (pid 13627): internal error
Nov 10 17:07:52 svct03 smbd[13627]: [2007/11/10 17:07:52, 0]
lib/util.c:log_stack_trace(1721)
Nov 10 17:07:52 svct03 smbd[13627]:   BACKTRACE: 18 stack frames:
Nov 10 17:07:52 svct03 smbd[13627]:#0 smbd(log_stack_trace+0x2d)
[0xc3e78d]
Nov 10 17:07:52 svct03 smbd[13627]:#1 smbd(smb_panic+0x5d) [0xc3e8bd]
Nov 10 17:07:52 svct03 smbd[13627]:#2 smbd [0xc29fba]
Nov 10 17:07:52 svct03 smbd[13627]:#3 [0x4ec420]
Nov 10 17:07:52 svct03 smbd[13627]:#4 /lib/libc.so.6(realloc+0xd9)
[0x3d97e9]
Nov 10 17:07:52 svct03 smbd[13627]:#5 smbd(Realloc+0x83) [0xc3f9d3]
Nov 10 17:07:52 svct03 smbd[13627]:#6 smbd(realloc_array+0x46)
[0xc3fae6]
Nov 10 17:07:52 svct03 smbd[13627]:#7 smbd(add_sid_to_array+0xa7)
[0xc37cd7]
Nov 10 17:07:53 svct03 smbd[13627]:#8
smbd(add_sid_to_array_unique+0x65) [0xc37d45]
Nov 10 17:07:53 svct03 smbd[13627]:#9
smbd(create_token_from_username+0x8aa) [0xc86b4a]
Nov 10 17:07:53 svct03 smbd[13627]:#10 smbd [0xad4ed6]
Nov 10 17:07:53 svct03 smbd[13627]:#11 smbd(make_connection+0x194)
[0xad6934]
Nov 10 17:07:53 svct03 smbd[13627]:#12 smbd(reply_tcon_and_X+0x217)
[0xa9a1d7]
Nov 10 17:07:53 svct03 smbd[13627]:#13 smbd [0xad1a90]
Nov 10 17:07:53 svct03 smbd[13627]:#14 smbd(smbd_process+0x7ab)
[0xad2bbb]
Nov 10 17:07:53 svct03 smbd[13627]:#15 smbd(main+0xbd0) [0xcece90]
Nov 10 17:07:53 svct03 smbd[13627]:#16
/lib/libc.so.6(__libc_start_main+0xdc) [0x385dec]
Nov 10 17:07:53 svct03 smbd[13627]:#17 smbd 

svn commit: samba r25923 - in branches/SAMBA_4_0/source/script: .

2007-11-10 Thread abartlet
Author: abartlet
Date: 2007-11-10 09:29:32 + (Sat, 10 Nov 2007)
New Revision: 25923

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

Log:
Make sure to install phpldapadmin-config.php

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/script/installmisc.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/installmisc.sh
===
--- branches/SAMBA_4_0/source/script/installmisc.sh 2007-11-10 05:48:38 UTC 
(rev 25922)
+++ branches/SAMBA_4_0/source/script/installmisc.sh 2007-11-10 09:29:32 UTC 
(rev 25923)
@@ -25,6 +25,7 @@
 cp setup/*.reg $SETUPDIR || exit 1
 cp setup/*.zone $SETUPDIR || exit 1
 cp setup/*.conf $SETUPDIR || exit 1
+cp setup/*.php $SETUPDIR || exit 1
 cp setup/provision.smb.conf.dc $SETUPDIR || exit 1
 cp setup/provision.smb.conf.member $SETUPDIR || exit 1
 cp setup/provision.smb.conf.standalone $SETUPDIR || exit 1



[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-291-gcdd9e5c

2007-11-10 Thread Jeremy Allison
The branch, v3-2-test has been updated
   via  cdd9e5cc8366cf0be4dc31f793fc0e5be6f63c3e (commit)
  from  52fe04df8e8c08126afe61d509fc1d3cb676e327 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -
commit cdd9e5cc8366cf0be4dc31f793fc0e5be6f63c3e
Author: Jeremy Allison [EMAIL PROTECTED]
Date:   Sat Nov 10 14:43:39 2007 -0800

Remove pstring from service.c.
Jeremy.

---

Summary of changes:
 source/smbd/service.c |  180 +---
 1 files changed, 109 insertions(+), 71 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/service.c b/source/smbd/service.c
index 2cd3363..dd09a69 100644
--- a/source/smbd/service.c
+++ b/source/smbd/service.c
@@ -21,16 +21,17 @@
 
 extern userdom_struct current_user_info;
 
-static bool canonicalize_path(connection_struct *conn, pstring path)
+static bool canonicalize_connect_path(connection_struct *conn)
 {
 #ifdef REALPATH_TAKES_NULL
-   char *resolved_name = SMB_VFS_REALPATH(conn,path,NULL);
+   bool ret;
+   char *resolved_name = SMB_VFS_REALPATH(conn,conn-connectpath,NULL);
if (!resolved_name) {
-   return False;
+   return false;
}
-   pstrcpy(path, resolved_name);
+   ret = set_conn_connectpath(conn,resolved_name);
SAFE_FREE(resolved_name);
-   return True;
+   return ret;
 #else
 #ifdef PATH_MAX
 char resolved_name_buf[PATH_MAX+1];
@@ -39,10 +40,9 @@ static bool canonicalize_path(connection_struct *conn, 
pstring path)
 #endif
char *resolved_name = SMB_VFS_REALPATH(conn,path,resolved_name_buf);
if (!resolved_name) {
-   return False;
+   return false;
}
-   pstrcpy(path, resolved_name);
-   return True;
+   return set_conn_connectpath(conn,resolved_name);
 #endif /* REALPATH_TAKES_NULL */
 }
 
@@ -52,12 +52,18 @@ static bool canonicalize_path(connection_struct *conn, 
pstring path)
  Observent people will notice a similarity between this and check_path_syntax 
:-).
 /
 
-void set_conn_connectpath(connection_struct *conn, const char *connectpath)
+bool set_conn_connectpath(connection_struct *conn, const char *connectpath)
 {
-   pstring destname;
-   char *d = destname;
+   char *destname;
+   char *d;
const char *s = connectpath;
-bool start_of_name_component = True;
+bool start_of_name_component = true;
+
+   destname = SMB_STRDUP(connectpath);
+   if (!destname) {
+   return false;
+   }
+   d = destname;
 
*d++ = '/'; /* Always start with root. */
 
@@ -142,7 +148,7 @@ void set_conn_connectpath(connection_struct *conn, const 
char *connectpath)
break;
}
}
-   start_of_name_component = False;
+   start_of_name_component = false;
}
*d = '\0';
 
@@ -155,6 +161,8 @@ void set_conn_connectpath(connection_struct *conn, const 
char *connectpath)
lp_servicename(SNUM(conn)), destname ));
 
string_set(conn-connectpath, destname);
+   SAFE_FREE(destname);
+   return true;
 }
 
 /
@@ -422,13 +430,17 @@ int find_service(fstring service)
 * could get overwritten by the recursive 
find_service() call
 * below. Fix from Josef Hinteregger [EMAIL 
PROTECTED].
 */
-   pstring defservice;
-   pstrcpy(defservice, pdefservice);
+   char *defservice = SMB_STRDUP(pdefservice);
+
+   if (!defservice) {
+   goto fail;
+   }
 
/* Disallow anything except explicit share names. */
if (strequal(defservice,HOMES_NAME) ||
strequal(defservice, PRINTERS_NAME) ||
strequal(defservice, IPC$)) {
+   SAFE_FREE(defservice);
goto fail;
}
 
@@ -437,6 +449,7 @@ int find_service(fstring service)
all_string_sub(service, _,/,0);
iService = lp_add_service(service, iService);
}
+   SAFE_FREE(defservice);
}
}
 
@@ -642,6 +655,7 @@ static connection_struct *make_connection_snum(int snum, 
user_struct *vuser,
fstring dev;
int ret;
char addr[INET6_ADDRSTRLEN];
+   bool on_err_call_dis_hook = false;
 

[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-292-g6312522

2007-11-10 Thread Jeremy Allison
The branch, v3-2-test has been updated
   via  63125225383f512f43002b9a92569d4b8f1b63bd (commit)
  from  cdd9e5cc8366cf0be4dc31f793fc0e5be6f63c3e (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -
commit 63125225383f512f43002b9a92569d4b8f1b63bd
Author: Jeremy Allison [EMAIL PROTECTED]
Date:   Sat Nov 10 15:02:08 2007 -0800

Fix the build when realpath doesn't take null
as a last arg.
Jeremy.

---

Summary of changes:
 source/smbd/service.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/service.c b/source/smbd/service.c
index dd09a69..c397239 100644
--- a/source/smbd/service.c
+++ b/source/smbd/service.c
@@ -38,7 +38,7 @@ static bool canonicalize_connect_path(connection_struct *conn)
 #else
 pstring resolved_name_buf;
 #endif
-   char *resolved_name = SMB_VFS_REALPATH(conn,path,resolved_name_buf);
+   char *resolved_name = 
SMB_VFS_REALPATH(conn,conn-connectpath,resolved_name_buf);
if (!resolved_name) {
return false;
}


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-293-g9ed12bf

2007-11-10 Thread Jeremy Allison
The branch, v3-2-test has been updated
   via  9ed12bfc48fe7f9b1863a9dd88e881974083053c (commit)
  from  63125225383f512f43002b9a92569d4b8f1b63bd (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -
commit 9ed12bfc48fe7f9b1863a9dd88e881974083053c
Author: Jeremy Allison [EMAIL PROTECTED]
Date:   Sat Nov 10 15:36:47 2007 -0800

Remove last pstring from sesssetup.c
Jeremy.

---

Summary of changes:
 source/smbd/sesssetup.c |   40 +---
 1 files changed, 21 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/smbd/sesssetup.c b/source/smbd/sesssetup.c
index 0e8483c..8ca012f 100644
--- a/source/smbd/sesssetup.c
+++ b/source/smbd/sesssetup.c
@@ -1491,30 +1491,32 @@ void reply_sesssetup_and_X(connection_struct *conn, 
struct smb_request *req)
lm_resp = data_blob(p, passlen1);
nt_resp = data_blob(p+passlen1, passlen2);
} else {
-   pstring pass;
+   char *pass = NULL;
bool unic= smb_flag2  FLAGS2_UNICODE_STRINGS;
 
-#if 0
-   /* This was the previous fix. Not sure if it's still
-* valid. JRA. */
-   if ((ra_type == RA_WINNT)  (passlen2 == 0)
-unic  passlen1) {
-   /* NT4.0 stuffs up plaintext unicode password
-* lengths... */
-   srvstr_pull(inbuf, pass, smb_buf(inbuf) + 1,
-   sizeof(pass), passlen1, STR_TERMINATE);
-#endif
-
if (unic  (passlen2 == 0)  passlen1) {
/* Only a ascii plaintext password was sent. */
-   srvstr_pull(req-inbuf, req-flags2, pass,
-   smb_buf(req-inbuf), sizeof(pass),
-   passlen1, STR_TERMINATE|STR_ASCII);
+   (void)srvstr_pull_talloc(talloc_tos(),
+   req-inbuf,
+   req-flags2,
+   pass,
+   smb_buf(req-inbuf),
+   passlen1,
+   
STR_TERMINATE|STR_ASCII);
} else {
-   srvstr_pull(req-inbuf, req-flags2, pass,
-   smb_buf(req-inbuf), sizeof(pass),
-   unic ? passlen2 : passlen1,
-   STR_TERMINATE);
+   (void)srvstr_pull_talloc(talloc_tos(),
+   req-inbuf,
+   req-flags2,
+   pass,
+   smb_buf(req-inbuf),
+   unic ? passlen2 : 
passlen1,
+   STR_TERMINATE);
+   }
+   if (!pass) {
+   reply_nterror(req, nt_status_squash(
+ NT_STATUS_INVALID_PARAMETER));
+   END_PROFILE(SMBsesssetupX);
+   return;
}
plaintext_password = data_blob(pass, strlen(pass)+1);
}


-- 
Samba Shared Repository


Build status as of Sun Nov 11 00:00:02 2007

2007-11-10 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2007-11-10 
00:00:35.0 +
+++ /home/build/master/cache/broken_results.txt 2007-11-11 00:00:51.0 
+
@@ -1,4 +1,4 @@
-Build status as of Sat Nov 10 00:00:02 2007
+Build status as of Sun Nov 11 00:00:02 2007
 
 Build counts:
 Tree Total  Broken Panic 


[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-294-ge203ba2

2007-11-10 Thread Jeremy Allison
The branch, v3-2-test has been updated
   via  e203ba22275320808bc11b17361ad1f2d5b0b897 (commit)
  from  9ed12bfc48fe7f9b1863a9dd88e881974083053c (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -
commit e203ba22275320808bc11b17361ad1f2d5b0b897
Author: Jeremy Allison [EMAIL PROTECTED]
Date:   Sat Nov 10 22:31:34 2007 -0800

Always define PATH_MAX. Makes code simpler (removes
a bunch of #defines). Remove pstring from msdfs.c.
Jeremy.

---

Summary of changes:
 source/lib/replace/replace.h |4 +++
 source/lib/system.c  |4 ---
 source/lib/util_unistr.c |   11 +++-
 source/smbd/msdfs.c  |   62 +++--
 source/smbd/service.c|4 ---
 source/smbd/vfs.c|   12 
 6 files changed, 55 insertions(+), 42 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/replace/replace.h b/source/lib/replace/replace.h
index 973c68e..36a355f 100644
--- a/source/lib/replace/replace.h
+++ b/source/lib/replace/replace.h
@@ -536,4 +536,8 @@ typedef int bool;
 #define QSORT_CAST (int (*)(const void *, const void *))
 #endif
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 #endif /* _LIBREPLACE_REPLACE_H */
diff --git a/source/lib/system.c b/source/lib/system.c
index 321bca8..7338ea7 100644
--- a/source/lib/system.c
+++ b/source/lib/system.c
@@ -573,12 +573,8 @@ char *sys_getwd(char *s)
 {
char *wd;
 #ifdef HAVE_GETCWD
-#ifdef PATH_MAX
wd = (char *)getcwd(s, PATH_MAX);
 #else
-   wd = (char *)getcwd(s, sizeof (pstring));
-#endif
-#else
wd = (char *)getwd(s);
 #endif
return wd;
diff --git a/source/lib/util_unistr.c b/source/lib/util_unistr.c
index e9e2c33..c4569e1 100644
--- a/source/lib/util_unistr.c
+++ b/source/lib/util_unistr.c
@@ -350,11 +350,20 @@ char *rpcstr_pull_unistr2_talloc(TALLOC_CTX *mem_ctx, 
const UNISTR2 *src)
 /* Converts a string from internal samba format to unicode
  */ 
 
-int rpcstr_push(void* dest, const char *src, size_t dest_len, int flags)
+int rpcstr_push(void *dest, const char *src, size_t dest_len, int flags)
 {
return push_ucs2(NULL, dest, src, dest_len, 
flags|STR_UNICODE|STR_NOALIGN);
 }
 
+/* Converts a string from internal samba format to unicode. Always terminates.
+ * Actually just a wrapper round push_ucs2_talloc().
+ */ 
+
+int rpcstr_push_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src)
+{
+   return push_ucs2_talloc(ctx, dest, src);
+}
+
 /***
  Convert a (little-endian) UNISTR2 structure to an ASCII string.
 /
diff --git a/source/smbd/msdfs.c b/source/smbd/msdfs.c
index cca1e0a..98a41e4 100644
--- a/source/smbd/msdfs.c
+++ b/source/smbd/msdfs.c
@@ -196,16 +196,26 @@ static NTSTATUS parse_dfs_path(const char *pathname,
  Note this CHANGES CWD  JRA.
 */
 
-static NTSTATUS create_conn_struct(connection_struct *conn,
+static NTSTATUS create_conn_struct(TALLOC_CTX *ctx,
+   connection_struct *conn,
int snum,
const char *path)
 {
-   pstring connpath;
+   char *connpath;
 
ZERO_STRUCTP(conn);
 
-   pstrcpy(connpath, path);
-   pstring_sub(connpath , %S, lp_servicename(snum));
+   connpath = talloc_strdup(ctx, path);
+   if (!connpath) {
+   return NT_STATUS_NO_MEMORY;
+   }
+   connpath = talloc_string_sub(ctx,
+   connpath,
+   %S,
+   lp_servicename(snum));
+   if (!connpath) {
+   return NT_STATUS_NO_MEMORY;
+   }
 
/* needed for smbd_vfs_init() */
 
@@ -844,7 +854,7 @@ NTSTATUS get_referred_path(TALLOC_CTX *ctx,
return NT_STATUS_OK;
}
 
-   status = create_conn_struct(conn, snum, lp_pathname(snum));
+   status = create_conn_struct(ctx, conn, snum, lp_pathname(snum));
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(pdp);
return status;
@@ -888,7 +898,7 @@ static int setup_ver2_dfs_referral(const char *pathname,
 {
char* pdata = *ppdata;
 
-   unsigned char uni_requestedpath[sizeof(pstring)];
+   smb_ucs2_t *uni_requestedpath = NULL;
int uni_reqpathoffset1,uni_reqpathoffset2;
int uni_curroffset;
int requestedpathlen=0;
@@ -898,12 +908,15 @@ static int setup_ver2_dfs_referral(const char *pathname,
 
DEBUG(10,(Setting up version2 referral\nRequested path:\n));
 
-   requestedpathlen = rpcstr_push(uni_requestedpath,
-   pathname, sizeof(pstring),
-