1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-27 07:42:04 +03:00

use -1 not 0xffffffff in SIVALS() macros

use the same process_exists() code on all systems (it's probably
faster anyway)
This commit is contained in:
Andrew Tridgell
-
parent e360c79c9c
commit 901b95aa77
2 changed files with 5 additions and 27 deletions

View File

@ -3779,29 +3779,7 @@ check if a process exists. Does this work on all unixes?
****************************************************************************/ ****************************************************************************/
BOOL process_exists(int pid) BOOL process_exists(int pid)
{ {
#ifdef LINUX return(kill(pid,0) == 0 || errno != ESRCH);
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
} }

View File

@ -2189,7 +2189,7 @@ static BOOL api_RNetUserGetInfo(int cnum,uint16 vuid, char *param,char *data,
if (uLevel == 11) /* modelled after NTAS 3.51 reply */ if (uLevel == 11) /* modelled after NTAS 3.51 reply */
{ {
SSVAL(p,usri11_priv,Connections[cnum].admin_user?USER_PRIV_ADMIN:USER_PRIV_USER); SSVAL(p,usri11_priv,Connections[cnum].admin_user?USER_PRIV_ADMIN:USER_PRIV_USER);
SIVAL(p,usri11_auth_flags,AF_OP_PRINT); /* auth flags */ SIVAL(p,usri11_auth_flags,AF_OP_PRINT); /* auth flags */
SIVALS(p,usri11_password_age,-1); /* password age */ SIVALS(p,usri11_password_age,-1); /* password age */
SIVAL(p,usri11_homedir,PTR_DIFF(p2,p)); /* home dir */ SIVAL(p,usri11_homedir,PTR_DIFF(p2,p)); /* home dir */
@ -2198,8 +2198,8 @@ static BOOL api_RNetUserGetInfo(int cnum,uint16 vuid, char *param,char *data,
SIVAL(p,usri11_parms,PTR_DIFF(p2,p)); /* parms */ SIVAL(p,usri11_parms,PTR_DIFF(p2,p)); /* parms */
strcpy(p2,""); strcpy(p2,"");
p2 = skip_string(p2,1); p2 = skip_string(p2,1);
SIVAL(p,usri11_last_logon,0); /* last logon */ SIVAL(p,usri11_last_logon,0); /* last logon */
SIVAL(p,usri11_last_logoff,0); /* last logoff */ SIVAL(p,usri11_last_logoff,0); /* last logoff */
SSVALS(p,usri11_bad_pw_count,-1); /* bad pw counts */ SSVALS(p,usri11_bad_pw_count,-1); /* bad pw counts */
SSVALS(p,usri11_num_logons,-1); /* num logons */ SSVALS(p,usri11_num_logons,-1); /* num logons */
SIVAL(p,usri11_logon_server,PTR_DIFF(p2,p)); /* logon server */ SIVAL(p,usri11_logon_server,PTR_DIFF(p2,p)); /* logon server */
@ -2209,7 +2209,7 @@ static BOOL api_RNetUserGetInfo(int cnum,uint16 vuid, char *param,char *data,
SIVAL(p,usri11_workstations,PTR_DIFF(p2,p)); /* workstations */ SIVAL(p,usri11_workstations,PTR_DIFF(p2,p)); /* workstations */
strcpy(p2,""); strcpy(p2,"");
p2 = skip_string(p2,1); p2 = skip_string(p2,1);
SIVALS(p,usri11_max_storage,-1); /* max storage */ SIVALS(p,usri11_max_storage,-1); /* max storage */
SSVAL(p,usri11_units_per_week,168); /* units per week */ SSVAL(p,usri11_units_per_week,168); /* units per week */