Re: SAMBA 3.0 alpha 19

2002-08-19 Thread Mike Brady

If it finds ldap it is automatically included.

Mike Brady
Auckland
New Zealand

On Tue, 20 Aug 2002 14:35, Ray Raszka wrote:
> I attempted to build the alpha 19 release with LDAP support included by
> using the --with-ldapsam as was done in the 2.2 branch. However when
> running "configure --help" that option does not appear. Is LDAP support
> automatically included, or if not what is the proper configure option to
> include it?
> Thanks for you help.
>
> Ray Raszka
> Partners Healthcare
> 70 Jackson Drive
> Cranford, New Jersey 07016
> (908)  931-9111 ext. 2716




SAMBA 3.0 alpha 19

2002-08-19 Thread Ray Raszka

I attempted to build the alpha 19 release with LDAP support included by
using the --with-ldapsam as was done in the 2.2 branch. However when running
"configure --help" that option does not appear. Is LDAP support
automatically included, or if not what is the proper configure option to
include it?
Thanks for you help.

Ray Raszka
Partners Healthcare
70 Jackson Drive
Cranford, New Jersey 07016
(908)  931-9111 ext. 2716




Re: Undocumented smb.conf

2002-08-19 Thread Gerald (Jerry) Carter

On Mon, 19 Aug 2002, Gerald (Jerry) Carter wrote:

> On Mon, 19 Aug 2002, Thomas Reifferscheid wrote:
> 
> > There is an undocumented feature in Samba_2_2, too.
> > rpc_server/srv_spoolss_nt.c, function static BOOL
> > add_printer_hook(NT_PRINTER_INFO_LEVEL *printer),
> > line 4880:
> > 
> > /* Set the portname to what the script says the portname should be. */
> > 
> > You could probably add some notes to "add printer command",
> > that a custom addprinter-script
> > should/can return the printer port, e.g. "Samba Printer Port".
> 
> This is documented. "addprinter command" "enumports command", etc...

OK.  Time to eat crow.  I have been correctd on this one.  You think I 
would know better.  Here's the source.  Thanks to Thomas for correcting.
We will update the docs. :-)

if(numlines) {
/* Set the portname to what the script says the portname 
   should be. */
strncpy(printer->info_2->portname, qlines[0], 
sizeof(printer->info_2->portname));
DEBUGADD(6,("Line[0] = [%s]\n", qlines[0]));

/* Send SIGHUP to process group... is there a better way? */
kill(0, SIGHUP);
add_all_printers();
}



cheers, jerry




Re: Prepending "\" to user name w/Win98 Domain Login

2002-08-19 Thread Simo Sorce

On Mon, 2002-08-19 at 22:21, Jeff Mandel wrote:
> In reply.c line 927
> if (sys_getpwnam(dom_user) != NULL) {
>   pstrcpy(user, dom_user);
>   DEBUG(3,("Using unix username %s\n", dom_user));
> 
> This call checks if sys_getpwnam is the same as the dom_user, but it 
> doesn't actually check the info returned from sys_getpwnam, it assumes 
> that if it returns at all, it must be the same. When you throw in the 
> winbind separator, with NIS on solaris, it seems you can get a positive 
> return from sys_getpwnam(\jeff).


I think this is a bug of you NIS/LDAP client, If I ask:
"does \jeff exist?"
and I get the reply:
"yes jeff exist!"
then there is a problem on the resolver not on me.

> The returned value though, is not \jeff but that getpwnam string, which 
> should probably be parsed for the user name if a validation was to be 
> done. That way you know if the value returned matches the value you were 
> testing.
> perhaps it should be something like
>  if (parse_user(sys_getpwnam(dom_user)) == dom_user.

I cannot double check every system call, we suppose system calls work as
documented (generally).

> >This log seem to avail your claim, can you provide informations about
> >client OS, NIS server OS, samba version 
> >
> This is win98 sp2 and samba-2.2.5, solaris 8 and NIS service is provided 
> by padl's ypldapd agains iPlanet directory server. When ypldapd is 
> searching,, I can see that the request is clean:
> [19/Aug/2002:09:01:35 -0700] conn=1908789 op=1583 SRCH base="o=probes" 
> scope=2 filter="(&(objectclass=posixAccount)(uid=jeff))"
> [19/Aug/2002:09:01:35 -0700] conn=1908789 op=1583 RESULT err=0 tag=101 
> nentries=1 etime=0
> 
> I'm guessing from this that the NIS client libraries must be cleaning up 
> the request before passing this along to ypldapd, though it's also 
> possible the ypldapd is cleaning up the request itself.

Then it a problem of ypldap, have you thought to change the separator u
use to say a '+' for example?

> There are certainly some other possibilities with nscd in the mix, but I 
> think it's safe to say that there is a situation when the sys_getpwnam 
> unexpectedly turns up positive.

It must not.

> Maybe it's only in rare cases where people are using ypldapd for NIS on 
> solaris that these lookups can return true, but I think the real issue 
> is the use of the winbind separator when winbind is not in use.

We may address it, but it is only a moderate performance problem (with
nscd nearly uninfluent).

> sys_getpwnam has only one instance in reply.c. When it gets called it's 
> always called with "winbind separator" "username" - never just user 
> name. A  lookup would have a better chance of sucess 
> then .

not true, there are 2 occurences of sys_getpwnam, this is the code:

  /*
   * Always try the "DOMAIN\user" lookup first, as this is the most
   * specific case. If this fails then try the simple "user" lookup.
   */

  {
pstring dom_user;

/* Work out who's who */

slprintf(dom_user, sizeof(dom_user) - 1,"%s%s%s",
   domain, lp_winbind_separator(), user);

if (sys_getpwnam(dom_user) != NULL) {
  pstrcpy(user, dom_user);
  DEBUG(3,("Using unix username %s\n", dom_user));
}
  }

  /*
   * Pass the user through the NT -> unix user mapping
   * function.
   */

  (void)map_username(user);

  /*
   * Do any UNIX username case mangling.
   */
  smb_getpwnam(user, True);



smb_getpwnam inside calls sys_getpwnam and pther stuff.

> This is why I'm wondering if winbind is not in use, why this test is 
> done this way. Without winbind, when would you use a winbind separator? 

lazyness I think, I'll see if I can arrange a test before the calls.

> Even if the domain came through properly, what other cases would this 
> syntax (MP\jeff) return true on a getpwnam lookup?

never, only if winbind is in use.

-- 
Simo Sorce - [EMAIL PROTECTED]
Samba Team - http://www.samba.org



Re: New sam system

2002-08-19 Thread Kai Krueger

From: "Kai Krueger" <[EMAIL PROTECTED]>  Sent: Wednesday, July 31, 2002
10:21 PM

> So now back to the structure of the handles. As mentioned before, I don't
> think it has actually been decided upon (but perhaps I'm just not aware of
> it). All opinions with reasons are therefore very welcome. Personally, I
can
> think of three different possibilities. The first possibility is a real
> handle, i.e. a simple integer that is used as a lookup key. The second
> possibility is to fully specify the structure including all data fields of
> the associated object (i.e. something like the current SAM_ACCOUNT). And
the
> third possibility would be a void pointer to a piece of data every sam
> backend defines for itself. However the handle is always passed back to
the
> caller, so that if it is a simple variable SAM_USER_HANDLE *user is
enough.
> For a pointer type handle SAM_USER_HANDLE **user is needed.
>
> Hopefully this clarifies the situation a little and helps to find a
suitable
> implementation for the handles.

As the definitions of the handles structs are important for implementing
some bits of the new sam infrastructure, I'll retry to get to a consense and
decision by making a (nearly) finished proposal. This suggestion is based as
closely as possible on the structure of sam_passwd in the current passdb
code and the first definitions of such structures in the early versions of
the sam interface with a few minor adoptions to the current handles concept.
The handles suggested are fully specified data structures that are the same
for all backends, but it should probably  not be to difficult to dynamically
allocate the sub structure "private" on a per backend basis if advantages
are seen later on.



typedef struct sam_domain {
 TALLOC_CTX *mem_ctx;
 uint32 access_granted;
 struct sam_methods *current_sam_methods; /* sam_methods creating this
handle */
 void (*free_fn)(struct sam_domain **);
 struct domain_data {
  DOM_SID domain_sid; /*SID of the domain. Should not be changed */
  char *domainname; /* Name of the domain */
  char *servername; /* */
  NTTIME max_passwordage; /* time till next password expiration */
  NTTIME min_passwordage; /* time till password can be changed again */
  NTTIME lockout_duration; /* time till login is allowed again after
lockout*/
  NTTIME reset_count; /* time till bad login counter is reset */
  uint16 min_passwordlength; /* minimum number of characters for a password
*/
  uint16 password_history; /* number of passwords stored in history */
  uint16 lockout_count; /* number of bad login attempts before lockout */
  BOOL force_logoff; /* force logoff after logon hours have expired */
  BOOL login_pswdchange; /* Users need to logon to change their password */
  uint32 num_users; /* number of users in the domain */
  uint32 num_groups; /* number of global groups */
  uint32 num_aliases; /* number of local groups */
 } private;
} SAM_DOMAIN_HANDLE;

typedef struct sam_user {
 TALLOC_CTX *mem_ctx;
 uint32 access_granted;
 struct sam_methods *current_sam_methods; /* sam_methods creating this
handle */
 void (*free_fn)(struct sam_user **);
 struct user_data {
  uint32 init_flag;
  NTTIME logon_time; /* logon time */
  NTTIME logoff_time; /* logoff time */
  NTTIME kickoff_time; /* kickoff time */
  NTTIME pass_last_set_time; /* password last set time */
  NTTIME pass_can_change_time; /* password can change time */
  NTTIME pass_must_change_time; /* password must change time */
  char * username; /* username string */
  char * domain; /* Windows Domain name */
  char * full_name; /* user's full name string */
  char * unix_home_dir; /* UNIX home directory string */
  char * home_dir; /* home directory string */
  char * dir_drive; /* home directory drive string */
  char * logon_script; /* logon script string */
  char * profile_path; /* profile path string */
  char * acct_desc; /* user description string */
  char * workstations; /* login from workstations string */
  char * unknown_str; /* don't know what this is, yet. */
  char * munged_dial; /* munged path name and dial-back tel number */
  DOM_SID user_sid; /* Primary User SID */
  DOM_SID group_sid; /* Primary Group SID */
  DATA_BLOB lm_pw; /* .data is Null if no password */
  DATA_BLOB nt_pw; /* .data is Null if no password */
  DATA_BLOB plaintext_pw; /* .data is Null if not available */
  uint16 acct_ctrl; /* account info (ACB_ bit-mask) */
  uint32 unknown_3; /* 0x00ff  */
  uint16 logon_divs; /* 168 - number of hours in a week */
  uint32 hours_len; /* normally 21 bytes */
  uint8 hours[MAX_HOURS_LEN];
  uint32 unknown_5; /* 0x0002  */
  uint32 unknown_6; /* 0x 04ec */
 } private;
} SAM_USER_HANDLE;

typedef sam_group {
 TALLOC_CTX *mem_ctx;
 uint32 access_granted;
 struct sam_methods *current_sam_methods; /* sam_methods creating this
handle */
 void (*free_fn)(struct sam_group **);
 struct group_data {
  char *name;
  char *comment;
  DOM_SID sid;
  int32 flags; /* specifies if the group is a lokal group 

Re: Prepending "\" to user name w/Win98 Domain Login

2002-08-19 Thread Jeff Mandel

Simo Sorce wrote:

>>3) The valadation doesn't really validate in this case since the value 
>>used is not what the sytem returned: \jeff != jeff, but the check in 
>>reply.c is only for != NULL. When this gets looked up the the samba 
>>password db, failure is certain. There's no \jeff in the samba password 
>>database.
>>
>>
>
>what != NULL case do you refer to? 
>  
>
In reply.c line 927
if (sys_getpwnam(dom_user) != NULL) {
  pstrcpy(user, dom_user);
  DEBUG(3,("Using unix username %s\n", dom_user));

This call checks if sys_getpwnam is the same as the dom_user, but it 
doesn't actually check the info returned from sys_getpwnam, it assumes 
that if it returns at all, it must be the same. When you throw in the 
winbind separator, with NIS on solaris, it seems you can get a positive 
return from sys_getpwnam(\jeff).

The returned value though, is not \jeff but that getpwnam string, which 
should probably be parsed for the user name if a validation was to be 
done. That way you know if the value returned matches the value you were 
testing.
perhaps it should be something like
 if (parse_user(sys_getpwnam(dom_user)) == dom_user.

>  
>
>>  sesssetupX:name=[JEFF]
>>[2002/08/11 12:21:44, 3] smbd/reply.c:reply_sesssetup_and_X(929)
>>  Using unix username \JEFF
>>[2002/08/11 12:21:44, 2] smbd/reply.c:reply_sesssetup_and_X(982)
>>  Defaulting to Lanman password for \jeff
>>[2002/08/11 12:21:44, 1] smbd/password.c:pass_check_smb(545)
>>  Couldn't find user '\jeff' in passdb.
>>[2002/08/11 12:21:44, 1] smbd/reply.c:reply_sesssetup_and_X(998)
>>  Rejecting user '\jeff': authentication failed
>>
>>
>
>This log seem to avail your claim, can you provide informations about
>client OS, NIS server OS, samba version 
>
This is win98 sp2 and samba-2.2.5, solaris 8 and NIS service is provided 
by padl's ypldapd agains iPlanet directory server. When ypldapd is 
searching,, I can see that the request is clean:
[19/Aug/2002:09:01:35 -0700] conn=1908789 op=1583 SRCH base="o=probes" 
scope=2 filter="(&(objectclass=posixAccount)(uid=jeff))"
[19/Aug/2002:09:01:35 -0700] conn=1908789 op=1583 RESULT err=0 tag=101 
nentries=1 etime=0

I'm guessing from this that the NIS client libraries must be cleaning up 
the request before passing this along to ypldapd, though it's also 
possible the ypldapd is cleaning up the request itself.

 When I drop NIS and just use nss_ldap, the leading slashes can be seen 
in the ldap logs.
[19/Aug/2002:09:05:52 -0700] conn=1922842 op=1 SRCH base="o=probes" 
scope=2 filter="(&(objectclass=posixAccount)(uid=\\jeff))"
[19/Aug/2002:09:05:52 -0700] conn=1922842 op=1 RESULT err=0 tag=101 
nentries=0 etime=0

There are certainly some other possibilities with nscd in the mix, but I 
think it's safe to say that there is a situation when the sys_getpwnam 
unexpectedly turns up positive.

>  
>
>>4) When the client is win2k which passes a domain in, this code is 
>>called to lookup getpwnam(). Without some special 
>>module, when would a unix system ever return a positive response to this 
>>kind of lookup?
>>
>>
>
>see above (if that lookup fails, username alone is tested)
>
Maybe it's only in rare cases where people are using ypldapd for NIS on 
solaris that these lookups can return true, but I think the real issue 
is the use of the winbind separator when winbind is not in use.
sys_getpwnam has only one instance in reply.c. When it gets called it's 
always called with "winbind separator" "username" - never just user 
name. A  lookup would have a better chance of sucess 
then .

This is why I'm wondering if winbind is not in use, why this test is 
done this way. Without winbind, when would you use a winbind separator? 
Even if the domain came through properly, what other cases would this 
syntax (MP\jeff) return true on a getpwnam lookup?

Jeff




Re: Dev. Effort

2002-08-19 Thread Rafal Szczesniak

On Mon, Aug 19, 2002 at 04:02:15PM -0400, Deshpande, Kalyan (Kalyan)** CTR ** wrote:
> Hi,
> 
> I am interested in development effort. Please send me more details.

arrr, more details on what ? If you really want to help (and
feel ready to spend some time on it) just start coding and
send patches. That's the usual way to do this. To avoid duplication
of your (or somebody's) efforts, take a look at samba webpages
to see what's under construction. These guidelines are a bit
out of date, but may be of some help for you.


-- 
cheers,
++
|Rafal 'Mimir' Szczesniak <[EMAIL PROTECTED]>   |
|*BSD, GNU/Linux and Samba  /
|__/



Dev. Effort

2002-08-19 Thread Deshpande, Kalyan (Kalyan)** CTR **

Hi,

I am interested in development effort. Please send me more details.

thanks
-Kalyan Deshpande



Re: Undocumented smb.conf

2002-08-19 Thread Bradley W. Langhorst

here it is...

just run it in the root of the cvs tree.

brad

On Mon, 2002-08-19 at 14:53, Jelmer Vernooij wrote:
> Could you send it ? I'm interested since I now had to do it by hand..
> 
> jelmer
> > I have a perl script that does this check (by comparing the smb.conf
> > parsing code to the docbook stuff)
> > Maybe somebody could put it into the release checking list?
> 
> > brad
> > On Mon, 2002-08-19 at 13:30, Simo Sorce wrote:
> > > On Mon, 2002-08-19 at 09:55, Jelmer Vernooij wrote:
> > > > Hi, 
> 
> > > > I've done some work trying to figure out what smb.conf options in HEAD
> > > > are currently not documented. Here they are:
> 
> > > > add group script
> > > > add user to group script
> > > > admin log
> > > > ads server
> > > > alternate permissions
> > > > block size
> > > > delete group script
> > > > delete user from group script
> > > > display charset
> 
> > > > hide unwriteable
> > > ok this one is the same as hide unreadable, but hides files you cannot
> > > write to. As always it only hides them so if you know the name you will
> > > be able to access them.
> 
> > > > hostname lookups
> 
> > > > mangling method
> > > This one make you able to select which mangling method is available
> > > Currently we have 'hash' and 'hash2'
> > > 'hash' is the old samba 2.2 compatible mangling algorithm
> > > 'hash2' (the default) is the new much better mangling algorithm
> 
> > > > max packet
> > > > name cache timeout
> > > > ntlm auth
> > > > paranoid server security
> > > > realm
> > > > smb ports
> > > > unicode
> > > > unix charset
> > > > wins partners
> > > > disable netbios
> > > > dos charset
> > > > packet size
> > > > vfs path
> > > > wtmp directory
> 
> > > > Please either document them or send me a clue about what they should
> > > > do so that I can document them. 
> 
> > > > jelmer
> > > -- 
> > > Simo Sorce - [EMAIL PROTECTED]
> > > Xsec s.r.l.
> > > via Durando 10 Ed. G - 20158 - Milano
> > > tel. +39 02 2399 7130 - fax: +39 02 700 442 399
> 
> 
> -- 
> Jelmer Vernooij <[EMAIL PROTECTED]> - http://nl.linux.org/~jelmer/
> Development And Underdevelopment: http://library.thinkquest.org/C0110231/
> Listening to Error: The server (moosicd) doesn't seem to be running.
>  20:52:41 up 4 days, 19:17,  5 users,  load average: 0.04, 0.01, 0.00
> 
> 
> 



#!/usr/bin/perl -w

#reads in the list of parameters from the source 
#compares this list to the list of parms documented in the docbook source
#prints out the names of the parameters that are in need of documentation

my $doc_file = "./docs/docbook/manpages/smb.conf.5.sgml";
my $source_file = "./source/param/loadparm.c";
my $ln;
my %params;

open(SOURCE, "<$source_file") || 
  die "Unable to open $source_file for input: $!\n";
open(DOC, "<$doc_file") || 
  die "Unable to open $doc_file for input: $!\n";

while ($ln= ) {
  last if $ln =~ m/^static\ struct\ parm_struct\ parm_table.*/;
} #burn through the preceding lines

while ($ln = ) {
  last if $ln =~ m/^\s*\}\;\s*$/;
  #pull in the param names only
  next if $ln =~ m/.*P_SEPARATOR.*/;
  $ln =~ m/.*\"(.*)\".*/;
  $params{lc($1)}='not_found'; #not case sensitive
}
close SOURCE;
#now read in the params list from the docs
@doclines = ;

foreach $ln (grep (/\\s*(?:\<.*?\>)*\s*(.*?)(?:\s*\(?[S,G]?\)?\s*(\<\/term\>)?){1}\s*$/;
  #print "got: $1 from: $ln";
  if (exists $params{lc($1)}) {
$params{$1} = 'found';
  }
}

foreach (keys %params) {
  print "$_\n" if $params{$_} eq 'not_found';
}



Re: Undocumented smb.conf

2002-08-19 Thread Jelmer Vernooij

Could you send it ? I'm interested since I now had to do it by hand..

jelmer
> I have a perl script that does this check (by comparing the smb.conf
> parsing code to the docbook stuff)
> Maybe somebody could put it into the release checking list?

> brad
> On Mon, 2002-08-19 at 13:30, Simo Sorce wrote:
> > On Mon, 2002-08-19 at 09:55, Jelmer Vernooij wrote:
> > > Hi, 

> > > I've done some work trying to figure out what smb.conf options in HEAD
> > > are currently not documented. Here they are:

> > > add group script
> > > add user to group script
> > > admin log
> > > ads server
> > > alternate permissions
> > > block size
> > > delete group script
> > > delete user from group script
> > > display charset

> > > hide unwriteable
> > ok this one is the same as hide unreadable, but hides files you cannot
> > write to. As always it only hides them so if you know the name you will
> > be able to access them.

> > > hostname lookups

> > > mangling method
> > This one make you able to select which mangling method is available
> > Currently we have 'hash' and 'hash2'
> > 'hash' is the old samba 2.2 compatible mangling algorithm
> > 'hash2' (the default) is the new much better mangling algorithm

> > > max packet
> > > name cache timeout
> > > ntlm auth
> > > paranoid server security
> > > realm
> > > smb ports
> > > unicode
> > > unix charset
> > > wins partners
> > > disable netbios
> > > dos charset
> > > packet size
> > > vfs path
> > > wtmp directory

> > > Please either document them or send me a clue about what they should
> > > do so that I can document them. 

> > > jelmer
> > -- 
> > Simo Sorce - [EMAIL PROTECTED]
> > Xsec s.r.l.
> > via Durando 10 Ed. G - 20158 - Milano
> > tel. +39 02 2399 7130 - fax: +39 02 700 442 399


-- 
Jelmer Vernooij <[EMAIL PROTECTED]> - http://nl.linux.org/~jelmer/
Development And Underdevelopment: http://library.thinkquest.org/C0110231/
Listening to Error: The server (moosicd) doesn't seem to be running.
 20:52:41 up 4 days, 19:17,  5 users,  load average: 0.04, 0.01, 0.00



Re: Undocumented smb.conf

2002-08-19 Thread Bradley W. Langhorst

I have a perl script that does this check (by comparing the smb.conf
parsing code to the docbook stuff)
Maybe somebody could put it into the release checking list?

brad
On Mon, 2002-08-19 at 13:30, Simo Sorce wrote:
> On Mon, 2002-08-19 at 09:55, Jelmer Vernooij wrote:
> > Hi, 
> > 
> > I've done some work trying to figure out what smb.conf options in HEAD
> > are currently not documented. Here they are:
> > 
> > add group script
> > add user to group script
> > admin log
> > ads server
> > alternate permissions
> > block size
> > delete group script
> > delete user from group script
> > display charset
> 
> > hide unwriteable
> ok this one is the same as hide unreadable, but hides files you cannot
> write to. As always it only hides them so if you know the name you will
> be able to access them.
> 
> > hostname lookups
> 
> > mangling method
> This one make you able to select which mangling method is available
> Currently we have 'hash' and 'hash2'
> 'hash' is the old samba 2.2 compatible mangling algorithm
> 'hash2' (the default) is the new much better mangling algorithm
> 
> > max packet
> > name cache timeout
> > ntlm auth
> > paranoid server security
> > realm
> > smb ports
> > unicode
> > unix charset
> > wins partners
> > disable netbios
> > dos charset
> > packet size
> > vfs path
> > wtmp directory
> > 
> > Please either document them or send me a clue about what they should
> > do so that I can document them. 
> > 
> > jelmer
> -- 
> Simo Sorce - [EMAIL PROTECTED]
> Xsec s.r.l.
> via Durando 10 Ed. G - 20158 - Milano
> tel. +39 02 2399 7130 - fax: +39 02 700 442 399





Re: [2.2 patch] client/client.c: reget and reput commands

2002-08-19 Thread Simo Sorce


Interesting, but can you make a patch against head instead?
Thank you,
Simo.

On Mon, 2002-08-19 at 19:52, Josef Zlomek wrote:
> Hello!
> 
> I have written the reget and reput commands for samba 2.2.
> When user gets/puts a large file and the connection brokes
> the user is unhappy (s)he has to transfer the file from the beginning.
> So with this patch (s)he can use command reget/reput that
> will continue in the transfer, i.e. it will seek both in local and remote file
> to position of the end of target file and continue with the transfer from this 
>position.
> Although the local networks are fast, it takes several minutes to tranfer
> a 650 MB large file (e.g. ISO image) so I think this commands are useful.
> 
> While writing these commands I found something that confuses me:
> the get and put commands are similar so one would thing that get and put would
> use similar functions.  But function writefile (that is used by command get)
> uses function write, and function readfile (that is used by command get) uses
> function fread.  I think that both functions should use either
> open/read/write/close, or fopen/fread/fwrite/fclose.
> Because of this, I'm not sending the patch for samba 3.0 right now, because
> seek is not supported by XFILE (that is used in 3.0's put) yet.  I would like
> to know first whether it is better to use syscalls in both get and put,
> or write x_fseek for reput.
> 
> Patch follows.
> 
> Josef Zlomek
> 
> Index: source/client/client.c
> ===
> RCS file: /cvsroot/samba/source/client/client.c,v
> retrieving revision 1.148.2.28
> diff -u -r1.148.2.28 client.c
> --- source/client/client.c14 May 2002 14:00:49 -  1.148.2.28
> +++ source/client/client.c19 Aug 2002 12:49:11 -
> @@ -57,6 +57,7 @@
>  /* value for unused fid field in trans2 secondary request */
>  #define FID_UNUSED (0x)
>  
> +BOOL restart_at_file_end = False;
>  time_t newer_than = 0;
>  int archive_level = 0;
>  
> @@ -638,7 +639,7 @@
>/
>  static void do_get(char *rname,char *lname)
>  {  
> - int handle=0,fnum;
> + int handle = -1, fnum;
>   BOOL newhandle = False;
>   char *data;
>   struct timeval tp_start;
> @@ -646,6 +647,7 @@
>   uint16 attr;
>   size_t size;
>   off_t nread = 0;
> + off_t start = 0;
>  
>   GetTimeOfDay(&tp_start);
>  
> @@ -663,7 +665,18 @@
>   if(!strcmp(lname,"-")) {
>   handle = fileno(stdout);
>   } else {
> - handle = sys_open(lname,O_WRONLY|O_CREAT|O_TRUNC,0644);
> + if (restart_at_file_end) {
> + handle = sys_open(lname,O_WRONLY|O_CREAT,0644);
> + if (handle >= 0) {
> + start = sys_lseek(handle, 0, SEEK_END);
> + if (start == -1) {
> + DEBUG(0,("Error seeking local file\n"));
> + return;
> + }
> + }
> + }
> + if (handle < 0)
> + handle = sys_open(lname,O_WRONLY|O_CREAT|O_TRUNC,0644);
>   newhandle = True;
>   }
>   if (handle < 0) {
> @@ -690,7 +703,7 @@
>   }
>  
>   while (1) {
> - int n = cli_read(cli, fnum, data, nread, read_size);
> + int n = cli_read(cli, fnum, data, nread + start, read_size);
>  
>   if (n <= 0) break;
>   
> @@ -702,7 +715,7 @@
>   nread += n;
>   }
>  
> - if (nread < size) {
> + if (nread + start < size) {
>   DEBUG (0, ("Short read when getting file %s. Only got %ld bytes.\n",
> rname, (long)nread));
>   }
> @@ -767,6 +780,17 @@
>  
>  
>  /
> +  get a file restarting at end of local file
> +  /
> +static void cmd_reget(void)
> +{
> + restart_at_file_end = True;
> + cmd_get();
> + restart_at_file_end = False;
> +}
> +
> +
> +/
>do a mget operation on one file
>/
>  static void do_mget(file_info *finfo)
> @@ -1015,16 +1039,31 @@
>/
>  static void do_put(char *rname,char *lname)
>  {
> - int fnum;
> + int fnum = -1;
>   FILE *f;
> - int nread=0;
> + size_t nread = 0;
> + size_t start = 0;
>   char *buf=NULL;
>   int maxwrite=io_bufsize;
>   
>   struct timeval tp_start;
>   GetTimeOfDay(&tp_start);
>  
> - fnum = cli_open(cli, rname, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE);
> + if (restart_at_file_end

[2.2 patch] client/client.c: reget and reput commands

2002-08-19 Thread Josef Zlomek

Hello!

I have written the reget and reput commands for samba 2.2.
When user gets/puts a large file and the connection brokes
the user is unhappy (s)he has to transfer the file from the beginning.
So with this patch (s)he can use command reget/reput that
will continue in the transfer, i.e. it will seek both in local and remote file
to position of the end of target file and continue with the transfer from this 
position.
Although the local networks are fast, it takes several minutes to tranfer
a 650 MB large file (e.g. ISO image) so I think this commands are useful.

While writing these commands I found something that confuses me:
the get and put commands are similar so one would thing that get and put would
use similar functions.  But function writefile (that is used by command get)
uses function write, and function readfile (that is used by command get) uses
function fread.  I think that both functions should use either
open/read/write/close, or fopen/fread/fwrite/fclose.
Because of this, I'm not sending the patch for samba 3.0 right now, because
seek is not supported by XFILE (that is used in 3.0's put) yet.  I would like
to know first whether it is better to use syscalls in both get and put,
or write x_fseek for reput.

Patch follows.

Josef Zlomek

Index: source/client/client.c
===
RCS file: /cvsroot/samba/source/client/client.c,v
retrieving revision 1.148.2.28
diff -u -r1.148.2.28 client.c
--- source/client/client.c  14 May 2002 14:00:49 -  1.148.2.28
+++ source/client/client.c  19 Aug 2002 12:49:11 -
@@ -57,6 +57,7 @@
 /* value for unused fid field in trans2 secondary request */
 #define FID_UNUSED (0x)
 
+BOOL restart_at_file_end = False;
 time_t newer_than = 0;
 int archive_level = 0;
 
@@ -638,7 +639,7 @@
   /
 static void do_get(char *rname,char *lname)
 {  
-   int handle=0,fnum;
+   int handle = -1, fnum;
BOOL newhandle = False;
char *data;
struct timeval tp_start;
@@ -646,6 +647,7 @@
uint16 attr;
size_t size;
off_t nread = 0;
+   off_t start = 0;
 
GetTimeOfDay(&tp_start);
 
@@ -663,7 +665,18 @@
if(!strcmp(lname,"-")) {
handle = fileno(stdout);
} else {
-   handle = sys_open(lname,O_WRONLY|O_CREAT|O_TRUNC,0644);
+   if (restart_at_file_end) {
+   handle = sys_open(lname,O_WRONLY|O_CREAT,0644);
+   if (handle >= 0) {
+   start = sys_lseek(handle, 0, SEEK_END);
+   if (start == -1) {
+   DEBUG(0,("Error seeking local file\n"));
+   return;
+   }
+   }
+   }
+   if (handle < 0)
+   handle = sys_open(lname,O_WRONLY|O_CREAT|O_TRUNC,0644);
newhandle = True;
}
if (handle < 0) {
@@ -690,7 +703,7 @@
}
 
while (1) {
-   int n = cli_read(cli, fnum, data, nread, read_size);
+   int n = cli_read(cli, fnum, data, nread + start, read_size);
 
if (n <= 0) break;
  
@@ -702,7 +715,7 @@
nread += n;
}
 
-   if (nread < size) {
+   if (nread + start < size) {
DEBUG (0, ("Short read when getting file %s. Only got %ld bytes.\n",
rname, (long)nread));
}
@@ -767,6 +780,17 @@
 
 
 /
+  get a file restarting at end of local file
+  /
+static void cmd_reget(void)
+{
+   restart_at_file_end = True;
+   cmd_get();
+   restart_at_file_end = False;
+}
+
+
+/
   do a mget operation on one file
   /
 static void do_mget(file_info *finfo)
@@ -1015,16 +1039,31 @@
   /
 static void do_put(char *rname,char *lname)
 {
-   int fnum;
+   int fnum = -1;
FILE *f;
-   int nread=0;
+   size_t nread = 0;
+   size_t start = 0;
char *buf=NULL;
int maxwrite=io_bufsize;

struct timeval tp_start;
GetTimeOfDay(&tp_start);
 
-   fnum = cli_open(cli, rname, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE);
+   if (restart_at_file_end) {
+   fnum = cli_open(cli, rname, O_RDWR|O_CREAT, DENY_NONE);
+   if (fnum >= 0) {
+   if (!cli_qfileinfo(cli, fnum, NULL, &start,
+  NULL, NULL, NULL, NULL, NULL) &&
+   

Re: Undocumented smb.conf

2002-08-19 Thread Simo Sorce

On Mon, 2002-08-19 at 09:55, Jelmer Vernooij wrote:
> Hi, 
> 
> I've done some work trying to figure out what smb.conf options in HEAD
> are currently not documented. Here they are:
> 
> add group script
> add user to group script
> admin log
> ads server
> alternate permissions
> block size
> delete group script
> delete user from group script
> display charset

> hide unwriteable
ok this one is the same as hide unreadable, but hides files you cannot
write to. As always it only hides them so if you know the name you will
be able to access them.

> hostname lookups

> mangling method
This one make you able to select which mangling method is available
Currently we have 'hash' and 'hash2'
'hash' is the old samba 2.2 compatible mangling algorithm
'hash2' (the default) is the new much better mangling algorithm

> max packet
> name cache timeout
> ntlm auth
> paranoid server security
> realm
> smb ports
> unicode
> unix charset
> wins partners
> disable netbios
> dos charset
> packet size
> vfs path
> wtmp directory
> 
> Please either document them or send me a clue about what they should
> do so that I can document them. 
> 
> jelmer
-- 
Simo Sorce - [EMAIL PROTECTED]
Xsec s.r.l.
via Durando 10 Ed. G - 20158 - Milano
tel. +39 02 2399 7130 - fax: +39 02 700 442 399



signature.asc
Description: This is a digitally signed message part


Re: Undocumented smb.conf

2002-08-19 Thread Gerald (Jerry) Carter

On Mon, 19 Aug 2002, Thomas Reifferscheid wrote:

> There is an undocumented feature in Samba_2_2, too.
> rpc_server/srv_spoolss_nt.c, function static BOOL
> add_printer_hook(NT_PRINTER_INFO_LEVEL *printer),
> line 4880:
> 
> /* Set the portname to what the script says the portname should be. */
> 
> You could probably add some notes to "add printer command",
> that a custom addprinter-script
> should/can return the printer port, e.g. "Samba Printer Port".

This is documented. "addprinter command" "enumports command", etc...





cheers, jerry
 -
 Hewlett-Packard http://www.hp.com
 SAMBA Team   http://www.samba.org
 --http://www.plainjoe.org
 "Sam's Teach Yourself Samba in 24 Hours" 2ed.  ISBN 0-672-32269-2
 --"I never saved anything for the swim back." Ethan Hawk in Gattaca--




Re: SAMBA_3_0 CVS Fails to Compile

2002-08-19 Thread Rafal Szczesniak

On Mon, Aug 19, 2002 at 11:26:17AM -0400, Richard Bollinger wrote:
> from build_env.h:
> #define BUILD_ENV_UNAME "Linux LS01 2.0.38 #4 Wed Jun 6 14:22:03 EDT 2001 i586 
>unknown"
> #define BUILD_ENV_DATE "Mon Aug 19 09:57:00 EDT 2002"
> #define BUILD_ENV_SRCDIR "."
> #define BUILD_ENV_BUILDDIR 
>"/usr/local/lxsrc/samba_3_0/samba-3.0-alpha18/source.Linux"
> #define BUILD_ENV_USER "rab"
> #define BUILD_ENV_HOST "LS01"
> #define BUILD_ENV_COMPILER "gcc"
> 
> First fixed Makefile.in as follows, so proto.h could be made:
> --- ../source/Makefile.in Mon Aug 19 07:15:58 2002
> +++ Makefile.in Mon Aug 19 09:52:52 2002
> @@ -170,9 +170,9 @@
>libsmb/passchange.o libsmb/unexpected.o libsmb/doserr.o \
>libsmb/namecache.o $(RPC_PARSE_OBJ1)
> 
> -LIBMSRPC_OBJ = rpc_client/cli_lsarpc.o rpc_client/cli_samr.o \
> +LIBMSRPC_OBJ = libsmb/cli_lsarpc.o rpc_client/cli_samr.o \
>  rpc_client/cli_netlogon.o rpc_client/cli_srvsvc.o \
> -rpc_client/cli_wkssvc.o rpc_client/cli_dfs.o \
> +rpc_client/cli_wkssvc.o libsmb/cli_dfs.o \
>  rpc_client/cli_reg.o rpc_client/cli_pipe.o \
>  rpc_client/cli_spoolss.o rpc_client/cli_spoolss_notify.o
> 
> Now, I get this error:
> Compiling nsswitch/winbindd_rpc.c
> nsswitch/winbindd_rpc.c: In function `trusted_domains':
> nsswitch/winbindd_rpc.c:595: warning: passing arg 6 of `cli_lsa_enum_trust_dom' from 
>incompatible
> pointer type
> nsswitch/winbindd_rpc.c:595: warning: passing arg 7 of `cli_lsa_enum_trust_dom' from 
>incompatible
> pointer type
> nsswitch/winbindd_rpc.c:595: too few arguments to function `cli_lsa_enum_trust_dom'
> make: *** [nsswitch/winbindd_rpc.o] Error 1

This is due to recent tridge's update of cli_lsa_enum_trust_dom.
In the next few days I'll send a patch that fixes winbind trusted
domain enumeration completely.


-- 
cheers,
++
|Rafal 'Mimir' Szczesniak <[EMAIL PROTECTED]>   |
|*BSD, GNU/Linux and Samba  /
|__/



SAMBA_3_0 CVS Fails to Compile

2002-08-19 Thread Richard Bollinger

from build_env.h:
#define BUILD_ENV_UNAME "Linux LS01 2.0.38 #4 Wed Jun 6 14:22:03 EDT 2001 i586 unknown"
#define BUILD_ENV_DATE "Mon Aug 19 09:57:00 EDT 2002"
#define BUILD_ENV_SRCDIR "."
#define BUILD_ENV_BUILDDIR "/usr/local/lxsrc/samba_3_0/samba-3.0-alpha18/source.Linux"
#define BUILD_ENV_USER "rab"
#define BUILD_ENV_HOST "LS01"
#define BUILD_ENV_COMPILER "gcc"

First fixed Makefile.in as follows, so proto.h could be made:
--- ../source/Makefile.in Mon Aug 19 07:15:58 2002
+++ Makefile.in Mon Aug 19 09:52:52 2002
@@ -170,9 +170,9 @@
   libsmb/passchange.o libsmb/unexpected.o libsmb/doserr.o \
   libsmb/namecache.o $(RPC_PARSE_OBJ1)

-LIBMSRPC_OBJ = rpc_client/cli_lsarpc.o rpc_client/cli_samr.o \
+LIBMSRPC_OBJ = libsmb/cli_lsarpc.o rpc_client/cli_samr.o \
 rpc_client/cli_netlogon.o rpc_client/cli_srvsvc.o \
-rpc_client/cli_wkssvc.o rpc_client/cli_dfs.o \
+rpc_client/cli_wkssvc.o libsmb/cli_dfs.o \
 rpc_client/cli_reg.o rpc_client/cli_pipe.o \
 rpc_client/cli_spoolss.o rpc_client/cli_spoolss_notify.o

Now, I get this error:
Compiling nsswitch/winbindd_rpc.c
nsswitch/winbindd_rpc.c: In function `trusted_domains':
nsswitch/winbindd_rpc.c:595: warning: passing arg 6 of `cli_lsa_enum_trust_dom' from 
incompatible
pointer type
nsswitch/winbindd_rpc.c:595: warning: passing arg 7 of `cli_lsa_enum_trust_dom' from 
incompatible
pointer type
nsswitch/winbindd_rpc.c:595: too few arguments to function `cli_lsa_enum_trust_dom'
make: *** [nsswitch/winbindd_rpc.o] Error 1




Windows XP logon problem - Smab 2.2.5

2002-08-19 Thread Yasser Sedky

Hi all,

I'm actually fed up with this problem. I saw many questions around this
problem, they are all giving same steps, and they are all failing to
solve the problem!

I'm installing Samba 2.2.5 on FreeBSD 4.6 box, I followed all steps of
HOW-TO to make Samba act as PDC.

I did the following:

1- Samba successfully installed as PDC.
2- WinXP patched with the RequireSignorSeal patch.
2- WinXP stations joined the Domain successfully , machine accounts
created manually with the "$" at end of machine name.
3- WinXP restarted successfully ;-)
4- I tried to login using an enabled user, sometimes I can log , other
times I get "Domain Controller is not available" 
6- In all cases I can see the SAMBA shares, when I log locally I get an
authentication dialog box to reach the Samba Shares!
7- Profile/Homes directory persmissions are checked.

PS: should I downgrade to Samba 2.2.3a ? Or should I through my XP away?

Anyone has solution to this very COMMON problem 


On my WinXP I set:
WINS IP = Samba IP 
NetBIOS over TCP/IP enabled

On my smb.conf I made:

-

[global]
;basic server settings
workgroup = MISRTECH
netbios name = ZEUS
interfaces = 192.168.1.1/24 127.0.0.0/24
server string = Zeus Domain Controller
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=8192
SO_RCVBUF=8192

;PDC and master browser settings
os level = 64
preferred master = yes
local master = yes
domain master = yes

;security and logging settings
security = user
encrypt passwords = yes
log file = /var/log/samba/log.%m
log level = 10
max log size = 50
hosts allow = 192.168.1., 127.

;user profiles and home directory
logon home = \\%L\%U\
logon drive = Z:
logon path = \\%L\profiles\%U

domain logons = Yes
dns proxy = No
wins support = Yes
admin users = root

[homes]
comment = Home Directories
path = /my/samba/homes
valid users = %S
read only = No
browseable = No
writable = yes

[netlogon]
comment = Network Logon Service
path = /usr/local/samba/lib/netlogon
guest ok = No
share modes = No
writable = no
browseable = No

[Profiles]
path = /my/samba/profiles
create mask = 0600
directory mask = 0700
guest ok = No
browseable = No
writable = Yes

-


Many thanks,
Yasser Sedky





Group ACL failure to lookup GID

2002-08-19 Thread bjorn . roden
When adding users to filesystem ACL (on IBM AIX 5.1 and Samba 2.2.5) it works nicely, however when trying the same with groups it fails (from W2K client). If my interpretation, of the level 10 logs I have enabled, is correct, smbd tries to map the SID to UID but not to GID, when the UID lookup for the group fails. It then maps the unmapped SID to the "system" group (I guess the primary group for the testuser which is "Administrator" user-mapped to "root"). Pulsen Systems AB (www.pulsen.se)==Björn RodénCTO+46 (0)8  553 33300  Stockholm office+46 (0)31 709 8200   Göteborg office+46 (0)40 101600  Malmö office+46 (0)33 171800  Borås+46 (0)70 592 8181   Mobile"Vade mecum"

Re: Undocumented smb.conf

2002-08-19 Thread Thomas Reifferscheid

There is an undocumented feature in Samba_2_2, too.
rpc_server/srv_spoolss_nt.c, function static BOOL
add_printer_hook(NT_PRINTER_INFO_LEVEL *printer),
line 4880:

/* Set the portname to what the script says the portname should be. */

You could probably add some notes to "add printer command",
that a custom addprinter-script
should/can return the printer port, e.g. "Samba Printer Port".


HTH
Thomas


Jelmer Vernooij wrote:

> I've done some work trying to figure out what smb.conf options in HEAD

> Please either document them or send me a clue about what they should
> do so that I can document them.



Undocumented smb.conf

2002-08-19 Thread Jelmer Vernooij

Hi, 

I've done some work trying to figure out what smb.conf options in HEAD
are currently not documented. Here they are:

add group script
add user to group script
admin log
ads server
alternate permissions
block size
delete group script
delete user from group script
display charset
hide unwriteable
hostname lookups
mangling method
max packet
name cache timeout
ntlm auth
paranoid server security
realm
smb ports
unicode
unix charset
wins partners
disable netbios
dos charset
packet size
vfs path
wtmp directory

Please either document them or send me a clue about what they should
do so that I can document them. 

jelmer



Linux kernel leases/oplocks and dirnotify

2002-08-19 Thread Stephen Rothwell

Hi all,

Just a heads up for those having problems with Linux's kernel oplocks
(leases) and/or directory notifications.  2.4.19 has fixes for all the
know (to me) directory notification problems and 2.4.20-pre3 (and therefore
most likely 2.4.20) has fixes for all the kernel oplocks problems
know to me.

Please try these new kernels out if you are so inclined and feel free
to report any further problems to me.

-- 
Cheers,
Stephen Rothwell[EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/