diff options
author | Jeremy Allison <jra@samba.org> | 1998-07-14 21:23:59 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-07-14 21:23:59 +0000 |
commit | 4eccb47cfb3c8907a6558b6ea9a02b0184458e34 (patch) | |
tree | 754b3808204e727f8ba46ad34d7497e7f8edd3ce /source/smbd/reply.c | |
parent | d64ca4250ff0df4ceffe49b7d462df699a6981b4 (diff) | |
download | samba-4eccb47cfb3c8907a6558b6ea9a02b0184458e34.tar.gz samba-4eccb47cfb3c8907a6558b6ea9a02b0184458e34.tar.xz samba-4eccb47cfb3c8907a6558b6ea9a02b0184458e34.zip |
loadparm.c:
With apologies to Charlton Heston and Pierre Boule.
"You damn fools, you finally did it".
Changed default security mode to be security=user.
Yes this is a big (although small in code) change.
It's something we've been discussing for a while, to
finally wean people off the legacy security=share mode
which is *never* what you want.
Jeremy.
nmbd_incomingrequests.c: Bug fix for nmbd core dumps caused by overrun.
Found by <samuel@public.szonline.net>.
nttrans.c: More NT smb stuff.
reply.c: Unlink will overwrite an existing file. Well you learn
something new about POSIX every day. :-).
server.c: Tidyup unreadable code.
smbpasswd.c: Code to allow -U remote_username to allow ordinary
users to change remote passwords if their NT username
is different from their UNIX username.
Patch from <torbjorn.lindh@allgon.se>.
Jeremy.
Diffstat (limited to 'source/smbd/reply.c')
-rw-r--r-- | source/smbd/reply.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/source/smbd/reply.c b/source/smbd/reply.c index cb659e3ef91..07b72738c50 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -3258,21 +3258,21 @@ int rename_internals(char *inbuf, char *outbuf, char *name, char *newname, BOOL if(replace_if_exists) { /* - * NT SMB specific flag - we must remove a target - * file with the same name before continuing. + * NT SMB specific flag - rename can overwrite + * file with the same name so don't check for + * file_exist(). */ if(resolve_wildcards(directory,newname) && can_rename(directory,cnum) && - file_exist(newname,NULL)) { - sys_unlink(newname); - } - } - - if (resolve_wildcards(directory,newname) && - can_rename(directory,cnum) && - !file_exist(newname,NULL) && !sys_rename(directory,newname)) - count++; + count++; + } else { + if (resolve_wildcards(directory,newname) && + can_rename(directory,cnum) && + !file_exist(newname,NULL) && + !sys_rename(directory,newname)) + count++; + } DEBUG(3,("rename_internals: %s doing rename on %s -> %s\n",(count != 0) ? "succeeded" : "failed", directory,newname)); @@ -3319,9 +3319,7 @@ int rename_internals(char *inbuf, char *outbuf, char *name, char *newname, BOOL continue; } - if (replace_if_exists && file_exist(destname,NULL)) { - sys_unlink(destname); - } else if(file_exist(destname,NULL)) { + if (!replace_if_exists && file_exist(destname,NULL)) { DEBUG(6,("file_exist %s\n", destname)); error = 183; continue; |