From 54ea3c23e3bfd25008198e85fdcc1f48b0325eab Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 21 Jun 2006 02:31:12 +0000 Subject: r16435: Add in the uid info that Jerry needs into the share_mode struct. Allows us to know the unix uid of the opener of the file/directory. Needed for info level queries on open files. Jeremy. (This used to be commit d929323d6f513902381369d77bcd7b714346d713) --- source3/smbd/open.c | 4 ++-- source3/smbd/oplock.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 2e4091d937..832a8df755 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1685,7 +1685,7 @@ files_struct *open_file_ntcreate(connection_struct *conn, fsp->oplock_type = NO_OPLOCK; } } - set_share_mode(lck, fsp, 0, fsp->oplock_type); + set_share_mode(lck, fsp, current_user.ut.uid, 0, fsp->oplock_type); if (info == FILE_WAS_OVERWRITTEN || info == FILE_WAS_CREATED || info == FILE_WAS_SUPERSEDED) { @@ -1991,7 +1991,7 @@ files_struct *open_directory(connection_struct *conn, return NULL; } - set_share_mode(lck, fsp, 0, NO_OPLOCK); + set_share_mode(lck, fsp, current_user.ut.uid, 0, NO_OPLOCK); /* For directories the delete on close bit at open time seems always to be honored on close... See test 19 in Samba4 BASE-DELETE. */ diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 1f731e1729..e4f5c434b0 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -830,6 +830,7 @@ void share_mode_entry_to_message(char *msg, struct share_mode_entry *e) SDEV_T_VAL(msg,28,e->dev); SINO_T_VAL(msg,36,e->inode); SIVAL(msg,44,e->share_file_id); + SIVAL(msg,48,e->uid); } /**************************************************************************** @@ -849,6 +850,7 @@ void message_to_share_mode_entry(struct share_mode_entry *e, char *msg) e->dev = DEV_T_VAL(msg,28); e->inode = INO_T_VAL(msg,36); e->share_file_id = (unsigned long)IVAL(msg,44); + e->uid = (uint32)IVAL(msg,48); } /**************************************************************************** -- cgit