glibc + uid ?
Άγγελος Οικονομόπουλος
aoiko at cc.ece.ntua.gr
Tue Aug 27 23:48:01 EEST 2002
On Tuesday 27 August 2002 22:30, V13 wrote:
> Mporei na moy eksigisei kapoios an ayto einai sfalma ths glibc h kapoioy
> alloy?
>
> Sto /usr/include/bits/types.h exei:
>
> typedef __u_int __uid_t; /* Type of user identifications.
> */ typedef __u_int __gid_t; /* Type of group
> identifications. */
>
> Eno sto man ths chown(2) leei kathara:
>
> int chown(const char *path, uid_t owner, gid_t group);
>
> If the owner or group is specified as -1, then that ID is
> not changed.
>
> To opoio kai doylevei alla me tin katallili xorodia:
>
> hell:/tmp$ cat a.cc
> #include "sys/types.h"
> #include "unistd.h"
>
> int main()
> {
> chown ("/dev/null",-1,-1);
> }
apo to fs/open.c
static int chown_common(struct dentry * dentry, uid_t user, gid_t group)
{
/* other stuff */
if (user == (uid_t) -1)
user = inode->i_uid;
if (group == (gid_t) -1)
group = inode->i_gid;
/* stuff */
}
kati eleges gia alxhmeies...
--
Use debugging compilers.
- The Elements of Programming Style (Kernighan & Plaugher)
More information about the Linux-greek-users
mailing list