mirror of
https://github.com/samba-team/samba.git
synced 2025-09-05 13:44:19 +03:00
More pstring/fstring removal.
Jeremy.
(This used to be commit 7646f4b284
)
This commit is contained in:
@@ -1434,17 +1434,17 @@ const char *uidtoname(uid_t uid)
|
|||||||
|
|
||||||
char *gidtoname(gid_t gid)
|
char *gidtoname(gid_t gid)
|
||||||
{
|
{
|
||||||
fstring name;
|
|
||||||
struct group *grp;
|
struct group *grp;
|
||||||
|
|
||||||
grp = getgrgid(gid);
|
grp = getgrgid(gid);
|
||||||
if (grp) {
|
if (grp) {
|
||||||
fstrcpy(name, grp->gr_name);
|
return talloc_strdup(talloc_tos(), grp->gr_name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
slprintf(name,sizeof(name) - 1, "%d",(int)gid);
|
return talloc_asprintf(talloc_tos(),
|
||||||
|
"%d",
|
||||||
|
(int)gid);
|
||||||
}
|
}
|
||||||
return talloc_strdup(talloc_tos(), name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
@@ -2963,18 +2963,23 @@ struct server_id interpret_pid(const char *pid_string)
|
|||||||
|
|
||||||
char *procid_str(TALLOC_CTX *mem_ctx, const struct server_id *pid)
|
char *procid_str(TALLOC_CTX *mem_ctx, const struct server_id *pid)
|
||||||
{
|
{
|
||||||
fstring str;
|
|
||||||
#ifdef CLUSTER_SUPPORT
|
#ifdef CLUSTER_SUPPORT
|
||||||
if (pid->vnn == NONCLUSTER_VNN) {
|
if (pid->vnn == NONCLUSTER_VNN) {
|
||||||
fstr_sprintf(str, "%d", (int)pid->pid);
|
return talloc_asprintf(mem_ctx,
|
||||||
|
"%d",
|
||||||
|
(int)pid->pid);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fstr_sprintf(str, "%u:%d", (unsigned)pid->vnn, (int)pid->pid);
|
return talloc_asprintf(mem_ctx,
|
||||||
|
"%u:%d",
|
||||||
|
(unsigned)pid->vnn,
|
||||||
|
(int)pid->pid);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
fstr_sprintf(str, "%d", (int)pid->pid);
|
return talloc_asprintf(mem_ctx,
|
||||||
|
"%d",
|
||||||
|
(int)pid->pid);
|
||||||
#endif
|
#endif
|
||||||
return talloc_strdup(mem_ctx, str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char *procid_str_static(const struct server_id *pid)
|
char *procid_str_static(const struct server_id *pid)
|
||||||
|
Reference in New Issue
Block a user