adduser userdel uid not incrementing causing unexpected file ownership

I'm a little surprised at the following output

[[email protected] ~]# adduser a [[email protected] ~]# id a uid=507(a) gid=507(a) groups=507(a) [[email protected] ~]# su a [[email protected] root]$ echo 1 > /tmp/a [[email protected] ~]# chmod 0700 /tmp/a [[email protected] root]$ exit exit [[email protected] ~]# userdel a [[email protected] ~]# adduser b [[email protected] ~]# id b uid=507(b) gid=507(b) groups=507(b) [[email protected] ~]# su b [[email protected] root]$ cat /tmp/a 1 

Why is the uid resused? User b now owns all the files that user a had created before it was deleted. This was very unexpected. Why does it behave like this?

The uid increments if I don't delete the user before creating a new one. But, I think it should increment in the above scenario too.

Replay

Category: permissions Time: 2016-07-28 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 1.618 (s). 13 q(s)