Searched defs:gid (Results 1 - 25 of 46) sorted by relevance

12

/systemd/src/basic/
H A Dmkdir-label.c28 int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid) { argument
29 return mkdir_safe_internal(path, mode, uid, gid, mkdir_label);
H A Duser-util.h27 static inline bool gid_is_valid(gid_t gid) { argument
28 return uid_is_valid((uid_t) gid);
40 int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **home, const char **shell);
41 int get_group_creds(const char **groupname, gid_t *gid);
44 char* gid_to_name(gid_t gid);
46 int in_gid(gid_t gid);
H A Dmkdir.c32 int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, mkdir_func_t _mkdir) { argument
36 if (chmod_and_chown(path, mode, uid, gid) < 0)
46 (gid != GID_INVALID && st.st_gid != gid) ||
53 int mkdir_safe(const char *path, mode_t mode, uid_t uid, gid_t gid) { argument
54 return mkdir_safe_internal(path, mode, uid, gid, mkdir);
H A Dcapability-util.c283 int drop_privileges(uid_t uid, gid_t gid, uint64_t keep_capabilities) { argument
295 if (setresgid(gid, gid, gid) < 0)
H A Duser-util.c102 uid_t *uid, gid_t *gid,
121 if (gid)
122 *gid = 0;
159 if (gid) {
163 *gid = p->pw_gid;
175 int get_group_creds(const char **groupname, gid_t *gid) { argument
181 /* We enforce some special rules for gid=0: in order to avoid
187 if (gid)
188 *gid = 0;
207 if (gid) {
100 get_user_creds( const char **username, uid_t *uid, gid_t *gid, const char **home, const char **shell) argument
256 gid_to_name(gid_t gid) argument
294 in_gid(gid_t gid) argument
325 gid_t gid; local
[all...]
H A Dfs-util.c268 int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid) { argument
279 if (uid != UID_INVALID || gid != GID_INVALID)
280 if (chown(path, uid, gid) < 0)
286 int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid) { argument
297 if (uid != UID_INVALID || gid != GID_INVALID)
298 if (fchown(fd, uid, gid) < 0)
333 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode) { argument
353 if (uid != UID_INVALID || gid != GID_INVALID) {
354 r = fchown(fd, uid, gid);
/systemd/src/resolve/
H A Dresolved.c36 gid_t gid; local
57 r = get_user_creds(&user, &uid, &gid, NULL, NULL);
64 r = mkdir_safe_label("/run/systemd/resolve", 0755, uid, gid);
70 r = drop_privileges(uid, gid, 0);
/systemd/src/network/
H A Dnetworkd.c31 gid_t gid; local
46 r = get_user_creds(&user, &uid, &gid, NULL, NULL);
54 r = mkdir_safe_label("/run/systemd/netif", 0755, uid, gid);
58 r = mkdir_safe_label("/run/systemd/netif/links", 0755, uid, gid);
62 r = mkdir_safe_label("/run/systemd/netif/leases", 0755, uid, gid);
66 r = mkdir_safe_label("/run/systemd/netif/lldp", 0755, uid, gid);
70 r = drop_privileges(uid, gid,
H A Dnetworkd-netdev-tuntap.c69 gid_t gid; local
107 r = get_group_creds(&group, &gid);
111 r = ioctl(fd, TUNSETGROUP, gid);
/systemd/src/test/
H A Dtest-user-util.c33 static void test_gid_to_name_one(gid_t gid, const char *name) { argument
36 assert_se(t = gid_to_name(gid));
/systemd/src/shared/
H A Ddev-setup.c32 int dev_setup(const char *prefix, uid_t uid, gid_t gid) { argument
67 if (uid != UID_INVALID || gid != GID_INVALID)
68 if (lchown(n, uid, gid) < 0)
H A Dbase-filesystem.c60 int base_filesystem_create(const char *root, uid_t uid, gid_t gid) { argument
104 if (uid != UID_INVALID || gid != UID_INVALID) {
105 if (fchownat(fd, table[i].dir, uid, gid, AT_SYMLINK_NOFOLLOW) < 0)
122 if (uid != UID_INVALID || gid != UID_INVALID) {
123 if (fchownat(fd, table[i].dir, uid, gid, AT_SYMLINK_NOFOLLOW) < 0)
H A Dclean-ipc.c63 gid_t gid, cgid; local
74 &shmid, &cpid, &lpid, &n_attached, &uid, &gid, &cuid, &cgid) != 8)
117 gid_t gid, cgid; local
128 &semid, &uid, &gid, &cuid, &cgid) != 5)
168 gid_t gid, cgid; local
180 &msgid, &cpid, &lpid, &uid, &gid, &cuid, &cgid) != 7)
/systemd/src/timesync/
H A Dtimesyncd.c33 static int load_clock_timestamp(uid_t uid, gid_t gid) { argument
62 (void) fchown(fd, uid, gid);
66 (void) touch_file("/var/lib/systemd/clock", true, min, uid, gid, 0644);
87 gid_t gid; local
103 r = get_user_creds(&user, &uid, &gid, NULL, NULL);
109 r = load_clock_timestamp(uid, gid);
113 r = drop_privileges(uid, gid, (1ULL << CAP_SYS_TIME));
/systemd/src/core/
H A Dbus-policy.c73 gid_t gid; local
75 r = get_group_creds(&group, &gid);
80 item->policy_access.id = gid;
H A Dselinux-access.c64 gid_t gid = 0; local
73 if (sd_bus_creds_get_egid(audit->creds, &gid) >= 0)
74 xsprintf(gid_buf, GID_FMT, gid);
77 "auid=%s uid=%s gid=%s%s%s%s%s%s%s",
/systemd/src/login/
H A Dlogind-user.h41 gid_t gid; member in struct:User
63 int user_new(User **out, Manager *m, uid_t uid, gid_t gid, const char *name);
H A Dlogind-core.c97 int manager_add_user(Manager *m, uid_t uid, gid_t gid, const char *name, User **_user) { argument
106 r = user_new(&u, m, uid, gid, name);
119 gid_t gid; local
125 r = get_user_creds(&name, &uid, &gid, NULL, NULL);
129 return manager_add_user(m, uid, gid, name, _user);
/systemd/src/bus-proxyd/
H A Dbus-proxyd.c275 gid_t gid; local
286 r = get_user_creds(&user, &uid, &gid, NULL, NULL);
292 r = drop_privileges(uid, gid, 1ULL << CAP_IPC_OWNER);
H A Dbus-xml-policy.h60 gid_t gid; member in struct:PolicyItem
89 bool policy_check_own(Policy *p, uid_t uid, gid_t gid, const char *name);
90 bool policy_check_hello(Policy *p, uid_t uid, gid_t gid);
93 gid_t gid,
101 gid_t gid,
111 gid_t gid,
119 gid_t gid,
/systemd/src/nspawn/
H A Dnspawn-setuid.c99 gid_t gid; local
190 r = parse_gid(g, &gid);
250 r = mkdir_safe(home, 0755, uid, gid);
254 (void) fchown(STDIN_FILENO, uid, gid);
255 (void) fchown(STDOUT_FILENO, uid, gid);
256 (void) fchown(STDERR_FILENO, uid, gid);
261 if (setresgid(gid, gid, gid) < 0)
/systemd/src/libsystemd/sd-bus/
H A Dbus-creds.h37 gid_t gid; member in struct:sd_bus_creds
/systemd/src/libudev/
H A Dlibudev-device-private.c125 gid_t gid; local
130 r = device_get_devnode_gid(udev_device->device, &gid);
136 return gid;
/systemd/src/nss-mymachines/
H A Dnss-mymachines.c580 uid_t gid; local
600 r = parse_gid(e + 1, &gid);
620 machine, (uint32_t) gid);
632 if (mapped < HOST_GID_LIMIT || mapped == gid)
645 gr->gr_gid = gid;
662 gid_t gid,
676 if (!gid_is_valid(gid)) {
682 if (gid < HOST_GID_LIMIT)
697 (uint32_t) gid);
709 if (mapped == gid)
661 _nss_mymachines_getgrgid_r( gid_t gid, struct group *gr, char *buffer, size_t buflen, int *errnop) argument
[all...]
/systemd/src/udev/
H A Dudev-node.c253 mode_t mode, uid_t uid, gid_t gid,
282 if ((stats.st_mode & 0777) != (mode & 0777) || stats.st_uid != uid || stats.st_gid != gid) {
283 log_debug("set permissions %s, %#o, uid=%u, gid=%u", devnode, mode, uid, gid);
287 err = chown(devnode, uid, gid);
289 log_warning_errno(errno, "setting owner of %s to uid=%u, gid=%u failed: %m", devnode, uid, gid);
291 log_debug("preserve permissions %s, %#o, uid=%u, gid=%u", devnode, mode, uid, gid);
338 mode_t mode, uid_t uid, gid_t gid,
252 node_permissions_apply(struct udev_device *dev, bool apply, mode_t mode, uid_t uid, gid_t gid, struct udev_list *seclabel_list) argument
337 udev_node_add(struct udev_device *dev, bool apply, mode_t mode, uid_t uid, gid_t gid, struct udev_list *seclabel_list) argument
[all...]

Completed in 1904 milliseconds

12