Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F11544144
chgdbmailusers.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
820 B
Referenced Files
None
Subscribers
None
chgdbmailusers.c
View Options
#include
<stdio.h>
#include
<string.h>
#include
<unistd.h>
// set the UID this script will run as (root user)
#define UID 0
#define CMD "/usr/sbin/dbmail-users"
#define RCOK 0x100
/* INSTALLING:
gcc -o chgdbmailusers chgdbmailusers.c
chown root.apache chgdbmailusers
strip chgdbmailusers
chmod 4550 chgdbmailusers
*/
main
(
int
argc
,
char
*
argv
[])
{
int
cnt
,
rc
,
cc
;
char
cmnd
[
255
];
strcpy
(
cmnd
,
CMD
);
if
(
argc
>
1
)
{
for
(
cnt
=
1
;
cnt
<
argc
;
cnt
++
)
{
strcat
(
cmnd
,
" "
);
strcat
(
cmnd
,
argv
[
cnt
]);
}
}
else
{
fprintf
(
stderr
,
"__ %s: failed %d %d
\n
"
,
argv
[
0
],
rc
,
cc
);
return
255
;
}
cc
=
setuid
(
UID
);
rc
=
system
(
cmnd
);
if
((
rc
!=
RCOK
)
||
(
cc
!=
0
))
{
fprintf
(
stderr
,
"__ %s: failed %d %d
\n
"
,
argv
[
0
],
rc
,
cc
);
return
1
;
}
return
0
;
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Mon, Sep 28, 11:15 PM (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1285639
Default Alt Text
chgdbmailusers.c (820 B)
Attached To
Mode
R3 roundcubemail
Attached
Detach File
Event Timeline
Log In to Comment