summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-08-13 23:19:16 +0000
committerJeremy Allison <jra@samba.org>2001-08-13 23:19:16 +0000
commite08ca026319f39683e0e935e2ddc48d33f381e71 (patch)
treeed40868aa425d27d491c69029f800c55d36dd0a8
parent26ceb74063b78abc58f773641da66b9043a5518a (diff)
downloadsamba-e08ca026319f39683e0e935e2ddc48d33f381e71.tar.gz
samba-e08ca026319f39683e0e935e2ddc48d33f381e71.tar.bz2
samba-e08ca026319f39683e0e935e2ddc48d33f381e71.zip
Added Jim McDonough's Win9x take ownership fix.
Jeremy. (This used to be commit 800e46ea7e724460be2ba5f71e5baa2f2ddd2d3b)
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 735a429102..cf65d5119f 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -1693,6 +1693,7 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_
struct current_user user;
fstring user_name;
connection_struct *conn = NULL;
+ BOOL became_user = False;
ZERO_STRUCT(st);
@@ -1714,6 +1715,13 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_
goto error_exit;
}
+ if (!become_user(conn, conn->vuid)) {
+ DEBUG(0,("_srv_net_file_set_secdesc: Can't become connected user!\n"));
+ r_u->status = ERRnoaccess;
+ goto error_exit;
+ }
+ became_user = True;
+
unistr2_to_ascii(filename, &q_u->uni_file_name, sizeof(filename));
unix_convert(filename, conn, NULL, &bad_path, &st);
@@ -1742,6 +1750,7 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_
}
close_file(fsp, True);
+ unbecome_user();
close_cnum(conn, user.vuid);
return r_u->status;
@@ -1751,6 +1760,9 @@ uint32 _srv_net_file_set_secdesc(pipes_struct *p, SRV_Q_NET_FILE_SET_SECDESC *q_
close_file(fsp, True);
}
+ if (became_user)
+ unbecome_user();
+
if (conn)
close_cnum(conn, user.vuid);