diff options
author | Jeremy Allison <jra@samba.org> | 2001-10-18 20:15:12 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-10-18 20:15:12 +0000 |
commit | c416ff851b4ecc7a44aee9d00d07dd481d8ae2a7 (patch) | |
tree | a663818999f244e52704caab9906b7857edce355 /source3/smbd/notify_hash.c | |
parent | 9a903a08a7c4f8407b4d6d0937f0bfda932d2ce3 (diff) | |
download | samba-c416ff851b4ecc7a44aee9d00d07dd481d8ae2a7.tar.gz samba-c416ff851b4ecc7a44aee9d00d07dd481d8ae2a7.tar.xz samba-c416ff851b4ecc7a44aee9d00d07dd481d8ae2a7.zip |
Merge the become_XXX -> change_to_XXX fixes from 2.2.2 to HEAD.
Ensure make_conection() can only be called as root.
Jeremy.
(This used to be commit 8d23a7441b4687458ee021bfe8880558506eddba)
Diffstat (limited to 'source3/smbd/notify_hash.c')
-rw-r--r-- | source3/smbd/notify_hash.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source3/smbd/notify_hash.c b/source3/smbd/notify_hash.c index 0c69dc78769..d398fac214f 100644 --- a/source3/smbd/notify_hash.c +++ b/source3/smbd/notify_hash.c @@ -126,16 +126,19 @@ static void *hash_register_notify(connection_struct *conn, char *path, uint32 fl Check if a change notify should be issued. A time of zero means instantaneous check - don't modify the last check time. *****************************************************************************/ + static BOOL hash_check_notify(connection_struct *conn, uint16 vuid, char *path, uint32 flags, void *datap, time_t t) { struct change_data *data = (struct change_data *)datap; struct change_data data2; - if (t && t < data->last_check_time + lp_change_notify_timeout()) return False; + if (t && t < data->last_check_time + lp_change_notify_timeout()) + return False; - if (!become_user(conn,vuid)) return True; - if (!become_service(conn,True)) { - unbecome_user(); + if (!change_to_user(conn,vuid)) + return True; + if (!set_current_service(conn,True)) { + change_to_root_user(); return True; } @@ -144,14 +147,14 @@ static BOOL hash_check_notify(connection_struct *conn, uint16 vuid, char *path, data2.status_time != data->status_time || data2.total_time != data->total_time || data2.num_entries != data->num_entries) { - unbecome_user(); + change_to_root_user(); return True; } if (t) data->last_check_time = t; - unbecome_user(); + change_to_root_user(); return False; } |