2016-03-14 15:27 GMT+01:00 Mike Frysinger <[email protected]>:
> On 14 Mar 2016 11:07, Bartosz Golaszewski wrote:
>> +#ifndef __BB_NAMESPACE_H
>> +#define __BB_NAMESPACE_H
>
> use a naming style like other busybox headers
>
>> +/*
>> + * Longest possible path to a procfs file used in namespace utils. Must be
>> + * able to contain the '/proc/' string, the '/ns/user' string which is the
>> + * longest namespace name and a 32-bit integer representing the process ID.
>> + */
>> +#define NS_PROC_PATH_MAX (sizeof("/proc//ns/user") + sizeof(pid_t) * 3)
>
> using the sizeof pid_t as a proxy for how many chars it'd take to render
> a decimal number in ASCII is wonky.  just hardcode it as "10" since that
> is the largest unsigned 32bit number ("4294967296").
>

Can you elaborate on how it's wonky? While your solution is perfectly
fine I think that there's nothing wrong with the way I've done it
neither.

>> +             status = setgid(gid);
>> +             if (status < 0)
>> +                     bb_perror_msg_and_die("setgid failed");
>
> use xsetgid
>

Done in v4.

>> +             status = setuid(uid);
>> +             if (status < 0)
>> +                     bb_perror_msg_and_die("setuid failed");
>
> use xsetuid

Done in v4.

-- 
Best regards,
Bartosz Golaszewski
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to