From ec8e33cde691a6591bcd9846308ba7e6bd1cd882 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 29 Nov 1997 13:29:13 +0000 Subject: use -1 not 0xffffffff in SIVALS() macros use the same process_exists() code on all systems (it's probably faster anyway) (This used to be commit 901b95aa77ac1ecc45823c23fb4e1d9da8dc8318) --- source3/lib/util.c | 24 +----------------------- source3/smbd/ipc.c | 8 ++++---- 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/source3/lib/util.c b/source3/lib/util.c index ac9c701b70..2457dec14d 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -3779,29 +3779,7 @@ check if a process exists. Does this work on all unixes? ****************************************************************************/ BOOL process_exists(int pid) { -#ifdef LINUX - fstring s; - sprintf(s,"/proc/%d",pid); - return(directory_exist(s,NULL)); -#else - { - static BOOL tested=False; - static BOOL ok=False; - fstring s; - if (!tested) { - tested = True; - sprintf(s,"/proc/%05d",(int)getpid()); - ok = file_exist(s,NULL); - } - if (ok) { - sprintf(s,"/proc/%05d",pid); - return(file_exist(s,NULL)); - } - } - - /* CGH 8/16/96 - added ESRCH test */ - return(pid == getpid() || kill(pid,0) == 0 || errno != ESRCH); -#endif + return(kill(pid,0) == 0 || errno != ESRCH); } diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index c862ff3b38..50ad831eb3 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -2189,7 +2189,7 @@ static BOOL api_RNetUserGetInfo(int cnum,uint16 vuid, char *param,char *data, { SSVAL(p,usri11_priv,Connections[cnum].admin_user?USER_PRIV_ADMIN:USER_PRIV_USER); SIVAL(p,usri11_auth_flags,AF_OP_PRINT); /* auth flags */ - SIVALS(p,usri11_password_age,0xffffffff); /* password age */ + SIVALS(p,usri11_password_age,-1); /* password age */ SIVAL(p,usri11_homedir,PTR_DIFF(p2,p)); /* home dir */ strcpy(p2, lp_logon_path()); p2 = skip_string(p2,1); @@ -2198,8 +2198,8 @@ static BOOL api_RNetUserGetInfo(int cnum,uint16 vuid, char *param,char *data, p2 = skip_string(p2,1); SIVAL(p,usri11_last_logon,0); /* last logon */ SIVAL(p,usri11_last_logoff,0); /* last logoff */ - SSVALS(p,usri11_bad_pw_count,0xffffffff); /* bad pw counts */ - SSVALS(p,usri11_num_logons,0xffffffff); /* num logons */ + SSVALS(p,usri11_bad_pw_count,-1); /* bad pw counts */ + SSVALS(p,usri11_num_logons,-1); /* num logons */ SIVAL(p,usri11_logon_server,PTR_DIFF(p2,p)); /* logon server */ strcpy(p2,"\\\\*"); p2 = skip_string(p2,1); @@ -2209,7 +2209,7 @@ static BOOL api_RNetUserGetInfo(int cnum,uint16 vuid, char *param,char *data, strcpy(p2,""); p2 = skip_string(p2,1); - SIVALS(p,usri11_max_storage,0xffffffff); /* max storage */ + SIVALS(p,usri11_max_storage,-1); /* max storage */ SSVAL(p,usri11_units_per_week,168); /* units per week */ SIVAL(p,usri11_logon_hours,PTR_DIFF(p2,p)); /* logon hours */ -- cgit