usb_moded 0.86.0+mer64
usb_moded-user.c File Reference
#include "usb_moded-user.h"
#include "usb_moded-control.h"
#include "usb_moded-log.h"
#include <systemd/sd-login.h>

Go to the source code of this file.

Functions

uid_t user_get_current_user (void)
 

Detailed Description

Copyright (c) 2021 Open Mobile Platform LLC. Copyright (c) 2021 Jolla Ltd.

Author
Mike Salmela mike..nosp@m.salm.nosp@m.ela@j.nosp@m.olla.nosp@m..com
Simo Piiroinen simo..nosp@m.piir.nosp@m.oinen.nosp@m.@jol.nosp@m.la.co.nosp@m.m

This program is free software; you can redistribute it and/or modify it under the terms of the Lesser GNU General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the Lesser GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Definition in file usb_moded-user.c.

Function Documentation

◆ user_get_current_user()

uid_t user_get_current_user ( void )

Get the user using the device

When built without Sailfish access control support, this returns root's uid (0) unconditionally.

Note: Whether this function is available or not depends on configure options -> usbmoded_get_current_user() can be used to avoid excessive ifdef blocks.

Returns
current user on seat0 or UID_UNKNOWN if it can not be determined

Definition at line 151 of file usb_moded-user.c.